{"_id":"@material/tooltip","_rev":"1194-9b0a3c7081e3571a449ad52a88e9d00f","name":"@material/tooltip","description":"The Material Components Web tooltip component.","dist-tags":{"nightly":"12.0.0-nightly.778a0e8a.0","latest":"14.0.0","canary":"15.0.0-canary.423edc3dc.0"},"versions":{"8.0.0-canary.2e5711e04.0":{"name":"@material/tooltip","version":"8.0.0-canary.2e5711e04.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.2e5711e04.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2274552833dc23deea74fc2770d8ad3a400ab5bf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.2e5711e04.0.tgz","fileCount":42,"integrity":"sha512-ipa/6W2KlL+sM7Q7Xb9L0/3dyZi99biynHaLqfxAL9tzbJPBk3khsVXheGUm/Hp2RMgWgHJnqRXSZKyUXLxH3Q==","signatures":[{"sig":"MEQCIF2RCUELWeXI57fNcQmE3LztRcZFNGDkT0J4ZfBl2nU3AiB1R0E19wfyhn/IuzuBjJtEefbtV3rkego27G5zZYdEng==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBfkFCRA9TVsSAnZWagAAg1EQAIvlRD8/6ejU4bXoo2SA\namwe4a+BXEaT50ia79Pbw5f6E6ReDsp3bhsz0RqHSdwZp/U7rI2hFNWW19EN\n6xj99qUhNjAYX1hoiAwl2f8wk195AJqov8n26V6KTfmxEWXklLESvCcOgOCB\nhkqLIEbOOiDD6fTEhaR+QXvqeePVk0FdNqE2Bxg0Eh0tCbwbogd/UVZiAaM1\nH7vPSItqWlQ+0BTCPqcgZqELGdvfUnE6BGt6NsdfUvZ2yto7bWWPKqVa7Jd3\n+9boiRHyF6KBF/wmqqxQfCme2sLcqdpFTAgA8KR29AliBYrQVJqNCME0hsfK\nzJW5f6fCC3Vk2WhWb3PjkXZ4cgfPeAHEHvHIGLQJPRTe0n4Mvihyoe0CETW4\nvTVW7RQSn+VusHihWNb/Pk8rYI5VFfE16jWrBlfPD2M26UZS4b/VtaVmUQva\ngtt6CmvywRhZ6ZU8g8XAkmmZK7HCytG1M8Lw3ungdFkSp992ikjIq+Est6rN\nuE4YsddbHJNWAZoW5SaTxm5bC/BRXOqKd5IXMD0bmACfwJ9WyjrGseZ/+amt\n+aDjeDNdcHJbWpJk7/eo8kvkv3hWGwEV5Hru3QnN0y8+tsGXT2i3Jy6bZqZm\nJAJZXo9y6S6TJ2yEgXRYBfwd67ckXScX1qJ2Ovgr4KfXbOqXgvnv7rep1wKb\nD5i+\r\n=QOMM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","gitHead":"4786b99e99bbd4c7b7f10a9111b884c165f1bc7d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2e5711e04.0","@material/base":"8.0.0-canary.2e5711e04.0","@material/shape":"8.0.0-canary.2e5711e04.0","@material/theme":"8.0.0-canary.2e5711e04.0","@material/animation":"8.0.0-canary.2e5711e04.0","@material/typography":"8.0.0-canary.2e5711e04.0","@material/feature-targeting":"8.0.0-canary.2e5711e04.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.2e5711e04.0_1594226949453_0.6073323331855305","host":"s3://npm-registry-packages"}},"8.0.0-canary.811fc5d24.0":{"name":"@material/tooltip","version":"8.0.0-canary.811fc5d24.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.811fc5d24.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82c6c5a82044d3732926c9ad8f53e5de1546a460","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.811fc5d24.0.tgz","fileCount":42,"integrity":"sha512-JoHcdI9X9j3LzGli+GjzVvqOGlEQoebaY47miazk0q5UR2xgyOwLU549hhVjeMzA42W2WfC514TtPivEoSyuIw==","signatures":[{"sig":"MEQCID1VooqfBT1zpwdey1ihyWC8TpeujbCT4dRcr2AOEVu7AiBLtE4j6Xn+522YvoNpte1lJLsvOTCFxBQNaTuwbW4mbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBf9vCRA9TVsSAnZWagAArgwP/1AqwjgH9IR2VxsAVLHb\nfqjF9A31sQgp3tmfWGCgU1mxSGlmvuXDxu6jXkAfWb1E5CGb0TzCyX/iS6X2\nRCfRXqgXQxsMcwPJR4ggb2vXjCgRvHaXRhJV0iliVAn28ariFrpAcUGQ1EW7\nVj+p/ibX/ZOKLcbrxP2O5+LhwGXV5d3SE2fNF/Wg1uIwIOYBt1hIziHWeC8H\n6O6bLmFFsuWFmUGzKynKEQ5FMVkkrTDqKbzFLbf6S0C5D0tX9S/ZFMXq8RyQ\nNhZx+UT9usbhlLjLq2pSCWvVCvvt2FyuFQiOWBG9+nuQeXkS7BG8F7r+mTf0\nK85Og2OEUBonxa1P5LsB+L1nk1teWGMElc/BGId/XcC7+h6UQhAvU3HrallX\n8DvJXF0KVHPyIuSROor/TgFvICGf9ZlYMe9XJVLCLYiYZ7TYIUgNJzxmiEHX\nUrjQ8YOFHwrqwRosjDseCJ4hBlWRQSk1kgdsc/sMHGg5p5rOG6kle2dRYDuo\nLuNA4SGqOpQiwl5k+Rzazt8583KUBUxfVucXYYj6wFJc8HC4osVt5UFaAEZ6\nsHwIcsBeQLtsEtEeQyEXkYLmCTVZrDbrkxxh2rc3hr9iyujIPtmNvkAT41UT\ntBIS4Sk7o85uyno+6XM5RkyEeE1JoHodEmCNNPbGWH3HTN16HfONPNTZ4958\nK9sY\r\n=e6nX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d1a1abefb8800a6dcc0cb20f74923403ee1ca66d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.811fc5d24.0","@material/base":"8.0.0-canary.811fc5d24.0","@material/shape":"8.0.0-canary.811fc5d24.0","@material/theme":"8.0.0-canary.811fc5d24.0","@material/animation":"8.0.0-canary.811fc5d24.0","@material/typography":"8.0.0-canary.811fc5d24.0","@material/feature-targeting":"8.0.0-canary.811fc5d24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.811fc5d24.0_1594228591149_0.3410180122086084","host":"s3://npm-registry-packages"}},"8.0.0-canary.6ed717ddd.0":{"name":"@material/tooltip","version":"8.0.0-canary.6ed717ddd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.6ed717ddd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"78bd6c8cf4af5865fb79605182e9f8ba3e13f8c9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.6ed717ddd.0.tgz","fileCount":42,"integrity":"sha512-qbpMwh+QgUBYDQR3pv2MoLx5xCtrDI6Wn8i3nS8HzQPjvR8gC+thQPcyd2FiHxckHlrz2YBJHgJyk/vvK1pZXA==","signatures":[{"sig":"MEUCIDt5uaqmlTCiS/lCiSKNrpGS5hFPNH7DKIRJoRc58swfAiEApP5Bd8AEBWGUXaEaE8nultdy/pLVlwM1f154aYCFXeE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBiI0CRA9TVsSAnZWagAAzQUP/jvFtA0+aYp1FZMEeG7b\nA3CFb16UiZi6KRgVSbP4cxl78SxC4M/FPAZnNm1k81a492sOs5nMXw/bjG6w\nrzTsf8m/J9SfM9QXF5snPYHGoHIPooO6wa/14U+DCaAsV/9cn9kwXhROg1Ge\nAK6DbZ6kCqGiQzO6QKCJYiarK+MPIWpImDo4CfO7aQvvHvv9ED6u34rgc2rc\ngg9SPYY5mXrBGfPLmG0j179vQALCzajSLnpATi7KKDIVx/kh0u/uY2HG2KeL\n1AaIAAsTV3jDMUhp1cxXmKb0xFs3YqW8B1tdJV8mWkRTKAT7vLizuDVU9os6\nQyt0hEKgzi5z99EZ6IM4wOlj2wZvUi335IaN1KVhjSlisNk7EsczNxyqyhuh\nBFt2wOCr8USabnMWUAAnGQy9tTtZA3ixXHVVG0U8aVTGX5w+NQHnzJyaLT/H\nCfzXI3h3S0X2Tvy1RzH+7TThHHnEmZavMUQuAVFdGIZA5dbENt1ZTluGemtK\ndg4jgazKzsa8y0Pl12KwSMHXUJQLJpyN7ugOuT8Fv+f23YqIK/dG8B3uvTaI\ntFHbg2c7WvwGNsn7zD2e8Z8pMoSeApEIdqV/JYaWzPOq13YrUpfWHomqehaA\n4LWO1v624kFFlb4Mh1weDlweMcWOsao6Mdp5PS9MQeJarThV/Gr6MAYn/TXU\nY2ls\r\n=z3Dh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7c9c6df731e0edf42938b11082973eba27e870e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6ed717ddd.0","@material/base":"8.0.0-canary.6ed717ddd.0","@material/shape":"8.0.0-canary.6ed717ddd.0","@material/theme":"8.0.0-canary.6ed717ddd.0","@material/animation":"8.0.0-canary.6ed717ddd.0","@material/typography":"8.0.0-canary.6ed717ddd.0","@material/feature-targeting":"8.0.0-canary.6ed717ddd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.6ed717ddd.0_1594237492448_0.11957143692936878","host":"s3://npm-registry-packages"}},"8.0.0-canary.d850de590.0":{"name":"@material/tooltip","version":"8.0.0-canary.d850de590.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.d850de590.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"34d4127d477654f33e4313dd3a942dadb47cbb1f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.d850de590.0.tgz","fileCount":42,"integrity":"sha512-4r9hoWDbRpI237SOl/+BQDAmAGLSqIQWaqICx+jXGmhGjf5NWuljjD3jLoTHlyvtYE+iNjw1D2XvOckPvpI05A==","signatures":[{"sig":"MEUCIQDMJNGidpSroht1A5xbXet6gQer767XuDDsRy93u+xMEAIganJF4nuz/TAP3ASGUNLHZK//oQ/EQVyNeJAeCSUW+N8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB1yWCRA9TVsSAnZWagAAxb4P/3rl6+M5WaptXT/d9k8n\nNEXSt7zgYyktfwhHyRpPhY/V+M07YZxQ2nZfNd1pa+9jLHXza51FeSR8TC1l\n/MfCGjYDGi/lpqeI+hgdFEHOEreyTvQKiZ5/4wHIoupGO3Ud03iCKsF8x3bL\nrBjqGR+lz7oIVd6ye2Iu+eHdh9/JsEGSiFSNi99SIUEOLBSCn/FOnLnbnsK+\nQ6XHiCHe2PRt0u4PIzwMxqyWlF6heUxArdydcqG5U4LTfodhxs4MKcBZbRzH\nOqNJcFKDvDbCrJZOjsgK+XcwkzreV59WiMu5F0vglDeOxT0kikPiDhNPeFCU\nUtBJm8sEU9cj/iNcYLIMWzqOAXC1C08sXJ/Hvx/FcU+jS9MCaIaKpJe/zHF9\nmejxltu7UiS0OLojAT88hEFPqHsgo5MqOPfUVwOGeMbu7Td3dz+53Nvh7wwt\nJdtk7KMWNeuq/vhK0F2QHo47YO0HCPxjzWXmCo65CezOHMxvxGuOwxZqOVTY\nzBMFH0wcGprPjE4WWnGabKZXns21NpzVCPPqtyxIEp4RnVgPtn1w43ppAAdM\nJRdXGjVt0ezzjA0qGQE+Hr5Bf9VbA0MZghJru2d6aWJUSk8O0mmpt2SU/kdN\nIDjOPp5aff39RbYBJGHnyvNMWh2gvIVWDBMKQUsFL3Tt1IMBcGmszyIUENj6\nSIYO\r\n=PU/H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"85039ad97bde95db4d57918266320d54c581a680","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d850de590.0","@material/base":"8.0.0-canary.d850de590.0","@material/shape":"8.0.0-canary.d850de590.0","@material/theme":"8.0.0-canary.d850de590.0","@material/animation":"8.0.0-canary.d850de590.0","@material/typography":"8.0.0-canary.d850de590.0","@material/feature-targeting":"8.0.0-canary.d850de590.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.d850de590.0_1594317974440_0.5805048665168715","host":"s3://npm-registry-packages"}},"8.0.0-canary.e07a70841.0":{"name":"@material/tooltip","version":"8.0.0-canary.e07a70841.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e07a70841.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5d8f12094eb17e1cb6f2167092d7414e92581b8c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e07a70841.0.tgz","fileCount":42,"integrity":"sha512-6Ivh6jjqefi+TXQRyw2tqD0Mfnouu1TqNbDeCRK5/sZ3aJkJ1ZYQJnUlTlhbOA/Hf085TwY9r/EpRypeijdqPw==","signatures":[{"sig":"MEQCIQCxXEbcNAzchlwNIglgPywM4l+RTTqcGDSc3EeylFTkhgIfU3cXoDuQhvsKtAbWNHAFb4Ihu1fM47zpNcmWFUy2Gg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB2OPCRA9TVsSAnZWagAA6oIP/jIIkSwJBq5ly+tUUs5m\nFzoHVPp55uU3VDE+IFwezuJhmR5vIK2o7FkNwCMCxpU9OtYykKlJt7wUjs9S\ncE+hN16knEsoDOmX2mGBy0AxTzY6B1xpgH+j7Xk6xwVSuAf3Db3oWtSnBYfq\nTgDcqEGB+1hoE99fIRfzeHDoUvW/+xK61EDxvcGCXIFusRyTD890ZtEA/MJG\n+7Dz/6tHZuJDYvM2TBm6nvMX9DpHtpDvfAmchC+m99Nh2SgFNPwl73OsWpG8\nxNVTrx1mrqrFEd40TlsXcs0CMYdKjcD7qMv1xmHmfLYaQwsCUYKktDYSIyKY\nw1ggJsAtbutaNAQb2rkDGRk35OLBaIyGOWgm5A/SQ4hHzjYBuleCGbaqmXN7\nBvDNymZaNx2abv4X4VyEee7A0y1R4MKt++O9jC0PWpcZEKwwsfWgKMfuVLUp\ncIpIAxDawgkqszJPYO/Cc6DjYEPy8+AcuCBkysrDYa1Mim5uK03DpTmhCT+B\n6WFRXzPfp683+6Q53bReG0UOZ2dQ46w+48INfmqOznQ2+Fo8khr0DJjmSk8z\nrWYiY044rrz6t4pwav/Q39rcwoiFm8vu8TBe5PJ3378h4brWX1WDOZvASUUn\npOKtC9ecq0sAXn/twADJvBEwSZqRDQ4hB1jbqfqwSeVOFu+MhvT2zOESpnXV\nERwv\r\n=s2AU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"105e9fd32899b2c9a4309baf6e879287104cc0e9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e07a70841.0","@material/base":"8.0.0-canary.e07a70841.0","@material/shape":"8.0.0-canary.e07a70841.0","@material/theme":"8.0.0-canary.e07a70841.0","@material/animation":"8.0.0-canary.e07a70841.0","@material/typography":"8.0.0-canary.e07a70841.0","@material/feature-targeting":"8.0.0-canary.e07a70841.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e07a70841.0_1594319759406_0.6612190884993288","host":"s3://npm-registry-packages"}},"8.0.0-canary.37947ed6c.0":{"name":"@material/tooltip","version":"8.0.0-canary.37947ed6c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.37947ed6c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5a75276dbbbaa137f279913fb94cce98d3a4d22d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.37947ed6c.0.tgz","fileCount":42,"integrity":"sha512-wHIw9POXZb2PNgG+B1tcS6v6U/cx5+5MXfXFmaTviuBxKCVuQedis0m8djp1czhXfDEMv2l4s34kTmhh1y24zw==","signatures":[{"sig":"MEQCIEzh6X5JrgHHJ6qHn82GMXYFOiR+AJF5hcGScMfZi+MBAiAkZH2eL1vUhEwUAn0CCQ9eR+lrAHuOUlBr8m1/9tmu1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB3/pCRA9TVsSAnZWagAAHqIQAIFGcJGbpIOA8/Lp/6qB\n92VNsaK1WZnaleIXVFwlgfsxX1wOTKzZ8TIgHyQWszGq+aAwEEAzIGrTGw77\nSjwpOyzFEwzceEcpbH1DD1jPsmswYlVXJo/fW+eMn3o3cMxrM/r7qSlf5p7L\nOieVNsOnu1eSxSsoCd1S8zzI0uZMtxbrdVLdTb6wbiQjBrReQ8NUhh0Q86/Z\nA1U23EPIw3taGvwralEbG0e0+93T4FpupuSjGM20Rj+Vec8qeb9xHGFzWXpk\nKvEpy6Dq0hKmvr+71b/izZLu1DyEh4y426QamEHZHPbiVNEP6Tt9da0Fr04v\nLjep1g3KHOFnFMzjWZ9j8sbmlOcA+Xk1J2JVsK6ez4dlKnMUAKhbGSqRepGW\nFHnEsasVMcozVkNNSVP674JRo80DnPGOfMehbL1SNYd4peIj1EYkH1ms9QSY\nQMHyPN0fED82ueXeA22IrZyAwzMFM/mh0A5P5Mx/ZmBL9vAo3uvxaMuwTrjj\n4h/bijbpTnoOodxeyaEYiQO6F3aAq+ZLLy+iBC3V0428GSWNo0AAQw/SS1Ki\nn8jgpRuBF6/hNLonKsVKa9JYTviSxHiWbGo/spvjqCk09Mx3kBBAhXq7LlWw\nKgOFdzYwvR8YsryVBqzH6Lwfze4+33NOzB3Mj/OYOnQ0TFd4tmpFIHzB3QwU\nOB+s\r\n=6ZBP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"80c4a00e688d5a2b1a35ee55744d879b782effed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.37947ed6c.0","@material/base":"8.0.0-canary.37947ed6c.0","@material/shape":"8.0.0-canary.37947ed6c.0","@material/theme":"8.0.0-canary.37947ed6c.0","@material/animation":"8.0.0-canary.37947ed6c.0","@material/typography":"8.0.0-canary.37947ed6c.0","@material/feature-targeting":"8.0.0-canary.37947ed6c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.37947ed6c.0_1594327016755_0.027079730259517154","host":"s3://npm-registry-packages"}},"8.0.0-canary.5d443afec.0":{"name":"@material/tooltip","version":"8.0.0-canary.5d443afec.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.5d443afec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6f47689f3fb1ca3efb2362a8cc279dad4b6bb6d2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.5d443afec.0.tgz","fileCount":42,"integrity":"sha512-kRNBUhixQtGGsBCGAS83Cf3YWtbMjBp3UawbraPRJ3PWLSWUs6XBiGfzvR+F9FkIujmbGcsZ4OAnvinO2jr03w==","signatures":[{"sig":"MEQCIBmmLZBF3rHJhbRSv718q1mI3sHslYPx3k49NINVwb9NAiBZGKuhPL4DuxUGOP5EMZBCGS2l5s4B2Sp/DLje2Xhbrw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB4OKCRA9TVsSAnZWagAAWk4P+wXNXTsVM8q0blgXvyui\nr07LIGCWMnEGJfon7Ykc2xfD6lCfS/epWFzR90fFOZ/U3K61YzM+to5FFJKd\n9oNesx/oeKgclc/8zjiAzoZH1MIUplxF+guG4ZDyp+MN1L0kXYRsBCdxVDnS\nvtQtPNLhWZ/3NrXfsGvWAAnCV/BmdFt063zCaDUiu8Mezqh2UUKRZ57J2A/O\n6X22J1O/S6j+FhUOxFJPOk0Dhxv767ZJG7nwUNTyN74zW10VgjIIZ4C8hf6l\nQyT+ybBnBPdD9rb7uv/DTtwpaNQe/vA/eEnagq6xVWvA2YatO0bXuLojFqiL\ne/326p/0epllVvjvOUYBWqKsxjLqybXvF/OA7C+6O1Aib5EFlpAFCbUsFHsn\nFbFe3K7YZQPum9//PdoSK8s+gkhC0k1+KocznL4DlNXDdjIF9jlw+vtli3Hm\nI2Qn1Kfl9DhixZwAhSYSYmoM+2UhcBVoOmdx2BBvO2V3nqlCaHRclePNgITU\n1wG0uesa2aAoSngu4B25hYl8OD7G67xuAG9q3RoNfYXENEZJ5vdnQjixhm25\nU2HQssRhqFzxi2YSLYdw3ulEoT0JV0lsbzoW6pRooRh/kbCLdIjnL7NBBu2O\nT5U6lodrYCoDVgkcDaPdSIdcPNA0aTqGjmX6C5JjaGAo+wQTeC98YyJvVX5h\nVAqI\r\n=5J1G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5c493d15f89898617c3127c53145bc51e8e60930","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5d443afec.0","@material/base":"8.0.0-canary.5d443afec.0","@material/shape":"8.0.0-canary.5d443afec.0","@material/theme":"8.0.0-canary.5d443afec.0","@material/animation":"8.0.0-canary.5d443afec.0","@material/typography":"8.0.0-canary.5d443afec.0","@material/feature-targeting":"8.0.0-canary.5d443afec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.5d443afec.0_1594327945905_0.17494782644987605","host":"s3://npm-registry-packages"}},"8.0.0-canary.9ac1ed914.0":{"name":"@material/tooltip","version":"8.0.0-canary.9ac1ed914.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.9ac1ed914.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"df66692efa1ea512a726ab6fc9f9cb4ad955b673","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.9ac1ed914.0.tgz","fileCount":42,"integrity":"sha512-4rGo5xzrTbvgSDreHQGNQkn3b3vSNaaIuyEWyePAO2bpgXcUcpJtr/5l+bR8E1d/iYvN0qae25pppV6HlhKsvQ==","signatures":[{"sig":"MEQCIEzPJq0diXY3NLVbH/6yyIKYr7Lky7rPVekCTZ88sxS2AiAZmUlcJFm9Si1Cs3c56YDulnjxMbsd0jH8MLsm2yzK5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB4pSCRA9TVsSAnZWagAAhgQP/RSPS0LclaKeuBct1qTW\nABkHE9rOQAciAzfDjqbkS5mIz2y2l7gnsGPvxyWHehX5+fPxamDYh3AtiNk6\nVcafqWBQW/1g1pNnrWTDOyd7XkdmGLQ3eAQIFK4odPFm4RISRaUKzcJ8ablh\nBMvXLtTa0QSQDoxwxfWDsRumul/fUYZgTfu9LmpYi+H+AW8gCR8zVHuhcOYH\n1RLluuLik15372kZunV6dDJqI7jg14N0eBkAdPWE7Ym0dbRDY2tb1dHemSvg\nA/AJ9xrZqHtzxU0v6KPp6Zvof4Q/f44RN0LDri/B7sZSFUa22xoG+9+ovB19\n98Tppewbv+477T7mzI7H3P5lJhL0kvV7ofzhhera8aZxOg+1XmoA1Q4jfdOz\nN2Mg/fNODI3UbtsZ5rDSL7Qix+XTzidxHDUbt9kgft92UMtigRaDCYXkTdYt\npQ8wIL70YvZZn+fHhLPayoQLkRyUbfZCTea0PoncR+XpkBbEEOGKjeBec4/j\niqoYWMbJplSxeJNXgFfYhJayHtuc7LUEvBM18TI3t6LqEQfBWrDzG1A8LDEf\nelc+dBknOOmA8Vgbq500BIlYWH+5a9vxE4Cjglia22hKECLv2PbZBbW621N/\nXrfKwT3iKOveyHnHPf/OzpmHMDEiofljwwu2jiz4tb45Ec0x+LdPGoDbQtLH\nwAZ6\r\n=Xu+W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c08d3c600bb022db1bcb4efe520bed724e653a77","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9ac1ed914.0","@material/base":"8.0.0-canary.9ac1ed914.0","@material/shape":"8.0.0-canary.9ac1ed914.0","@material/theme":"8.0.0-canary.9ac1ed914.0","@material/animation":"8.0.0-canary.9ac1ed914.0","@material/typography":"8.0.0-canary.9ac1ed914.0","@material/feature-targeting":"8.0.0-canary.9ac1ed914.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.9ac1ed914.0_1594329681818_0.0970064468246643","host":"s3://npm-registry-packages"}},"8.0.0-canary.1e7cb6198.0":{"name":"@material/tooltip","version":"8.0.0-canary.1e7cb6198.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.1e7cb6198.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e3ea47c29ac73469ac1bd6a8a2d7eba550629173","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.1e7cb6198.0.tgz","fileCount":42,"integrity":"sha512-LzGzoGJjsYCejPju/VSUHtkFvXyMvSKMOtj+3RYkOh2VyeBXGVeEYHS+GIiZ9yKgfhhCOfPFzzjT20UM+kIfxg==","signatures":[{"sig":"MEUCIAtvjf9egx1CdUyn1qrqnBE9q7R63mBVBsO5yDM48vEiAiEAmFeao9bLPzB/d/L1oXiGejTwNmi7CbXbIr/lerJTnRk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB5Z4CRA9TVsSAnZWagAA3UwP/RKp3MmJU5nXOYqQDsU0\n1u3DzEZI6COTnwCf3/y9tJSNEXqiszdGPMZ4DH7+hF7Kc5rz6qr/2Fs9D6Xq\n+CuLUExpYVOwVZjlgKoB34moa5Mk5eZukDz/muFpEkXJZ8mvPKjKbgqYio34\npWCffT7HCB9tG6BR81RiIoej5HQqtVyfSVp/4fNNPVa4TrHsLJfpLAiztGFe\nF3IoleQP1z+A24bAtU/kNzheX9aEkF766Bh8NwxkkrsEe1NVjU4jyrxJP72W\nCzFhGmQ0Akr0nJRJyoEILJeZkOWCQkgzWCumiqcYxkV8pRPbRzTEY2kpooUS\nlVxkRpU8Jkr2jwKqKLlQIu7H+Kql9AoNAz6Ti5p9SHKdc5jpfegcKmcZkk96\n+PEG9epHBxJ01C+16HRBaHQdlg0XIGHFBQ+w2l7MKTp3yQmRI/KkNQh2rIs6\nRqcfztFcndYk7DmVdXdEtIqN/mfyHomVJJVXRaA4tTjURn2Dttpo1ZWuQnB7\nCJyLl8bqkXzO+g4vcXFfBgrQPUaTH0WcQTLhr1roDyeMeQA7D+e64hgX3+NX\n8j/GIW9uriUPX4D+d5DB3jNH53I4e5jZgBeLW3JQhODOzcOINz7zhpy+PZ8e\nQ1Z+re1FuUTV3GrixMH/Vn0VtqRGBk98Hh8ArLs/8M+OeAUmLoENe47l6/xp\nSONQ\r\n=Q+Gv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"cbdbb55d01ed2f63aeafe8d77fffd1da5fcfc011","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.1e7cb6198.0","@material/base":"8.0.0-canary.1e7cb6198.0","@material/shape":"8.0.0-canary.1e7cb6198.0","@material/theme":"8.0.0-canary.1e7cb6198.0","@material/animation":"8.0.0-canary.1e7cb6198.0","@material/typography":"8.0.0-canary.1e7cb6198.0","@material/feature-targeting":"8.0.0-canary.1e7cb6198.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.1e7cb6198.0_1594332791724_0.19186451502255375","host":"s3://npm-registry-packages"}},"8.0.0-canary.843f636c0.0":{"name":"@material/tooltip","version":"8.0.0-canary.843f636c0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.843f636c0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"634776617f4bd51b04ba929a494940ae7a78b1c5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.843f636c0.0.tgz","fileCount":42,"integrity":"sha512-CbAzE3iwWaFPHsShENtrWC6sm3bgmM2RZs/fhTzOYqt/9NXfZ7KFmoWYzhC50AwyOgINZ5S1XRn36WgBE1IKuA==","signatures":[{"sig":"MEUCIQDw/ojMDx2/VdFtTfQ2gQvbuBaPo4FFhM0olglCrb+BjAIgXdTbU0m/8zFPZiOhn/TBGJvDwHa76KiY45MXtEJJBU4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCKjFCRA9TVsSAnZWagAAM2IQAJQQ4moMGLkdNfnKUMQa\nfaRa/Jvw8OiEwJ8QMfYUrfuRfm/pVYPjrciJrZk1O/Wtf6yGssWm61VaOgtZ\n7uoNx2Bkd/i8SvO03SS27viSjtFXA+LZWAYLb4ROgfumOBDrznaR2pSbazr2\nMdRq2cGeYQ77WlpxX2Zt6NqNbMIIS+D+XhYJ2YXaJXBDlfYKipNw9hkNrNCJ\nqPz+54otIR73FnyP/oazfAMiOGSJL1mzY1wvwp8UM7hMrsp7+Wz1Vd/f/yap\nKDAcBz6wX8O0NSB0cEH2oXi68DzAdj2h4E1ZWSCVJOlq9wKdvko1KjL43DlQ\nBsP5KYCuJ2yWHPbD+lAo2W3pYE9B1M8ouVnTCnqGPS7F5Q9CO6pRpuMFhAv/\nOmHX58EcrH0iG0OKgFdBcsW02ru8ra1XDJwKVU9NIGnXHyW5HgqNOLxvdl6u\njlRBWePIedEdKouF73hYOHMP5i6LAiZQHkfXuhSWz8kJE0rSL8c3QzfiZHKC\nR7DL0h2T1arVApb5M1lz3DDD2QLGGr64t9X3bKnVnETesbu/qoOMU591d6nS\nmeZCeD8FvIFbfB1BjQ6M8hmgEaRkRefkFApsP4EszS8UUkmlt3rTWnkzjFYu\niQJbs6hZtUMaJ9JL+0Ay7ghUEx+Mx4P9zAw2DIXJbjKV7TtXoc8wJ0ltmFli\niv/D\r\n=dMou\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"641b40da40cd73b439cefa7fa18c86bfdf31e497","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.843f636c0.0","@material/base":"8.0.0-canary.843f636c0.0","@material/shape":"8.0.0-canary.843f636c0.0","@material/theme":"8.0.0-canary.843f636c0.0","@material/animation":"8.0.0-canary.843f636c0.0","@material/typography":"8.0.0-canary.843f636c0.0","@material/feature-targeting":"8.0.0-canary.843f636c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.843f636c0.0_1594403012852_0.2731360864443517","host":"s3://npm-registry-packages"}},"8.0.0-canary.b2edaeead.0":{"name":"@material/tooltip","version":"8.0.0-canary.b2edaeead.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.b2edaeead.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d842e03d4cf4d096119c02371f73d15633d91665","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.b2edaeead.0.tgz","fileCount":42,"integrity":"sha512-nrctaYJA7SL7ucInTtYcgBlJgdzUJ7hrasxEE+rOLDAEEWiroUYEg4mWfgcuqQJGdiwkdp/dKK4OFFvGiVu8NA==","signatures":[{"sig":"MEYCIQC+SSkvyw2SeLBeSnOTtkAZBg4AIGIoMikUtim69+PWxwIhAPAj6RMc1quDsiNrr1O2q42YIvbUR33HKiZ+ypKTKRKs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":348841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCK59CRA9TVsSAnZWagAADhIP/i8FQ6o0IGSX6Ut0x55O\n3xldnofvFwEwRDwi+cOcP0YNylesPueFvXbDmZFg21AhDlgn7FJpBcfTHGR3\ndduWUcbBSkDFjSINEm41XlNd/+nt9qr8D1ZUttR67kNFJOhxwFUXEQ6m97Za\n0UCN3qTN2LI8Wvljm6c7v/E4HvxlpU9EADmWzLCMjogv0/PjPQnGUK8SzUI6\nEcmsHNE7Pw2Z4dMpLPPmdV/12k0m4uLvPvSlkTMlyTA9PbUxJnvtY0bG37f6\noFgMqbjKn/81tD8/lL/nlm0F7iDL4hJhSeEngrcJq3bcDhdn8vJpzEkY2tok\nNzuOZ7j6c7l+j1Y0vhL+v4/+iZ7Y/+NXbusGlBzkeRf7rSMxLU7xQGg+JZHL\nf4T7h+pdz6Hcmc5hUJuCRU5t7yHxcpJ0ii5X49nYhTi/rjYA6JPl3F/FfHa0\nFsig/DXK7fcHdOxudCPJoQaBJWxOWfEP6ove+k3Cd+FNWJPnyfzRbjjvwTZw\nibX7QNNJf0B0TlUOfBZHrBkDqi8WX8/MtLQC3CN+bsFxFDW5fKO4cEhcnrW2\nNmlG11AQGFlGMgdvkE8s3VOjxffLdztpsRErYnkFD48ASWPa29e1eriDMIFi\nWdtKqaP7fwjEDFrIu6lo+1cTMWTZ3nWRnIzspSuUzrV5iJdIVBATscCyXNrY\nLAW5\r\n=/Va8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"874d83aed6fef221001b68d44bfceb30072cc18c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b2edaeead.0","@material/base":"8.0.0-canary.b2edaeead.0","@material/shape":"8.0.0-canary.b2edaeead.0","@material/theme":"8.0.0-canary.b2edaeead.0","@material/animation":"8.0.0-canary.b2edaeead.0","@material/typography":"8.0.0-canary.b2edaeead.0","@material/feature-targeting":"8.0.0-canary.b2edaeead.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.b2edaeead.0_1594404476791_0.6625449275136284","host":"s3://npm-registry-packages"}},"8.0.0-canary.5dac1f624.0":{"name":"@material/tooltip","version":"8.0.0-canary.5dac1f624.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.5dac1f624.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5aa046b0c68bae1ae0cebddc455ec36450ab301","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.5dac1f624.0.tgz","fileCount":42,"integrity":"sha512-KMEccmRqy1BENuRVLiBkefLnN1Hqlzp2cZH4+BdvgfdNOpk4myfK3xwdCOJQsZd+SFMzUZPk9sI84H77UCaQSg==","signatures":[{"sig":"MEYCIQDuY0wGInd+fQOqdfmu3qt87g6caKLzsW+cKcxxwkvuEQIhAIywhqVx1MGzomz5jhtx88jA1/LjwLu0/23rCB2VE7Oz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDI03CRA9TVsSAnZWagAAbXcP/1ijvJetJni5R/uqLTiT\noADqeXYVDaZATucgCXomG1jz2gXz9aH1BQMuq6fIkq2LOtC7X+ZYhfy5CmmO\nFQ7uYzlGRyysqLUfT6b9XDlhauhBk6fSD6+n3MXJN/eC/8HgXyeJQW2AYG9J\ncsktbddlMfY79+AfR8WLeFE5m1QaHuFkWdwyG6e21PSB0wPKE9dqRvY0oeay\ntADpq4YMVmyt+7URnjC3lfuiCi2AD8DJiQ9yQvoCEzxq/x1b6GPs5YEIUVjk\nwBHJQ0OgIkb1RDwO/cpxKTruq6dtkO+TcFy1BEcce9qnhTw5PKYFU9UfyWha\ndtphtBbAZA1aGJLipt+vlr8QqMVToHdxcDxZedOU/Afy0qzQWMJcuupbHsVv\nlW6U1X1smXIYGNNuXESM75vnayTW4dItLMHccDcrapuxOMI7I/BX/X3H0y1n\n/UcAZaI+KPXZv9c/qirDVyuOddtWQJC0ZQqO2Dx2nOIs5FTqigFbQhmUdXFg\nHCEt27GhZyCOGslPzspQ/b8ieaQVtegYj1zYdtA+aWnsatld3Drfr6L4Y+CL\nMRiI2EPjS8SytOS9uB/6nqaW93sb2O/+Ih4gDrNmKOMjmevUxVL+Rybb/kVb\ntufPDgR6Z89RynY9QtGu61csA1jILPLiKCeNLSlcyPefxdZUz9Ph7p8QuF6P\nAt1X\r\n=tcyI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3acf16b30fe876c0d319f5d1681d177bd0089cbd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5dac1f624.0","@material/base":"8.0.0-canary.5dac1f624.0","@material/shape":"8.0.0-canary.5dac1f624.0","@material/theme":"8.0.0-canary.5dac1f624.0","@material/animation":"8.0.0-canary.5dac1f624.0","@material/typography":"8.0.0-canary.5dac1f624.0","@material/feature-targeting":"8.0.0-canary.5dac1f624.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.5dac1f624.0_1594658103173_0.5068423721573099","host":"s3://npm-registry-packages"}},"8.0.0-canary.4497acef8.0":{"name":"@material/tooltip","version":"8.0.0-canary.4497acef8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.4497acef8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3d3b69319db7ed4effe75f7cf9b668e302bc1238","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.4497acef8.0.tgz","fileCount":42,"integrity":"sha512-Iglamsa2sIbOp6G4DMyzFV2he3GoMIlYIf0HDR3gh1NlaUVlOTeTYfN1hemxTiuwwSOVHTxmEDGVCMWgjNCwVg==","signatures":[{"sig":"MEUCIQCCRs+Q0YUU8AGQ6FJtHHKXcwYUgEXym37yiZ4ifWoGEQIgDTlSAPfouwZM03CfK1finy4Acu44uLeTPebC77tx0SM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDb9HCRA9TVsSAnZWagAA1nMQAIvCfmmeM2sw5xqd5Og9\nhJDPF7qwjuiTCtnrCUs8BVm9T4Ei024pa2CjTCs6qBdp46jxDVG3TxJZQwER\nm3gbc9CAdGh5AhtVUIgL/XX9DbFIg2g4rDQ4LpICudexrP5Kl0K/wKN/uPst\nVALiaUmf9wep3l5MJ0QM9MNBaEUp7ZMRPbQBX5Qem+vMLVpXSvhLdRWOsheg\nSLhNzNjAW0iHq/ld5ZlxAq99q0HLdvHEPksmM0MUwhcxslFBIuHY1AuFSj9C\nVx7mqZnEfcHD60y9ACrZnK9ftcdQRwKKXDMCMDZd232nCevIWDhWBINirQcU\ntE5nUBhkbLNaxPE95kaO4IGnKfbssgW0jPlqX3dEG36qjw4OM8fU1mm2br8a\n7sTp8HU5HsV3ZTMLuyquGDJljOgphamuD5X0TjMHm6yH+JzGSxLIEtJEZqkA\nnNpYAf6S7XtFbEuFFsBCNBzr1+RQuTCHxKYvzdY2Hi7ya1tQwMsCNJjTDFKX\n0i8Ka03fBFLn6UJVn2wX+ooDgPJmCSA5fvcE1PeECsommPqqQkOHbWqg1hp2\ntssLeqvKr5Z2D4OXl6zre4xyI6m2eFyZRQcX0rPUO3w9RTsmjHuNEZmj5u9Y\ntXwPVtNVY+6KXIsBcCSSTMpSGnINBaKekXtH9Bh21lpZQEWWJUroIv7EyxwW\n2KpI\r\n=fgAW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"dc90b63c1737c63427815af4f6de59841a57a1bb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4497acef8.0","@material/base":"8.0.0-canary.4497acef8.0","@material/shape":"8.0.0-canary.4497acef8.0","@material/theme":"8.0.0-canary.4497acef8.0","@material/animation":"8.0.0-canary.4497acef8.0","@material/typography":"8.0.0-canary.4497acef8.0","@material/feature-targeting":"8.0.0-canary.4497acef8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.4497acef8.0_1594736455081_0.7070322242959166","host":"s3://npm-registry-packages"}},"8.0.0-canary.e6e23019d.0":{"name":"@material/tooltip","version":"8.0.0-canary.e6e23019d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e6e23019d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4c9f4395978d3470de753b65212dc694d4479679","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e6e23019d.0.tgz","fileCount":42,"integrity":"sha512-YTmuYAXusALxuU6Mph5DRvHoy63JHSooAYj8D+ohc49mdh3LBQbyuTlUiyTIkwW7W0jxc0roBYMnp1ELWQSE5g==","signatures":[{"sig":"MEQCIHNNzwO2tSoEOHGVju4HnBPHvo1SAGKqykI5IwL8wOqlAiBUEi9+9O2pzDLtDAAWJ6MgjcQik235fMBaYiel6nvKDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDhFtCRA9TVsSAnZWagAAftkP/At6Wp4rzs3NH3+vcLpq\nOMEtp+4Lo8aHZrgXDevL73bc6FLMkaIjPoKj5sLFAC7Odg3RI31gCqYs3beZ\nCXVI630Nw6m4q9AA4FyLXw07vBbyxCz4Hb8hgw8Bs0iHYf1wE78pNwExHg8Z\nT5SjSjoiuDVetNpDX+I9uayCaK7ggSXKW+YyhS9eEcJfDkSejLGZ+UJD/n5v\nwCb9uQZPMMLmU0MG6j/yvtd9D8ibOP98fWk2J1XZZHqh63Oi+wW1TBYXbjPD\nv4KFL+AwrUiIjg0a0kEinJsBbdrqDfL18+YgxGPHIeHGel9ouEXzKbzxsYJQ\n6dHvRDx8jIiekrY2SErqlNPuFAkDS2V8DkWpDKBUaYeg/ttmzkKQn1BiVVcm\nqlYPk8mR4OEgj0uSSrCIA7x0ZyCNx1n5KiFk3/WJ/8JULfqSm4HGzZsf/ga2\nma+xezW9hFqZeUUnZEqCCXJYucxpKM5atvQcqNFEMmmgo5KywXtAMq3In/rC\ntuzzmE/2CdiKLcRG6jCKXElGgSkiV+DvHDXss317mn0Y4B05DOhpAZL+vGjE\nTsLwHJoJem+CV455EUie+6iH/oDqH/wP7kSVgk7WZokE4IXUlJSF/YyCI9Fy\nAqKrk8eFpKJSld25o25jea8wDuJR115+Ee3sl0K37QOOjUvjRXy5dznhERCv\nWAtq\r\n=eILY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"db31520d2bb46404d9d5c364a2db4e2bc564e4f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e6e23019d.0","@material/base":"8.0.0-canary.e6e23019d.0","@material/shape":"8.0.0-canary.e6e23019d.0","@material/theme":"8.0.0-canary.e6e23019d.0","@material/animation":"8.0.0-canary.e6e23019d.0","@material/typography":"8.0.0-canary.e6e23019d.0","@material/feature-targeting":"8.0.0-canary.e6e23019d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e6e23019d.0_1594757484833_0.5892350678917806","host":"s3://npm-registry-packages"}},"8.0.0-canary.d548d7a92.0":{"name":"@material/tooltip","version":"8.0.0-canary.d548d7a92.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.d548d7a92.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ee3abbd5215d8c5cc66ff7febce7e09c5d972dc9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.d548d7a92.0.tgz","fileCount":42,"integrity":"sha512-NqY1JiLfCvqbm8I2fairwc6AGZJn98Mt2AzxwhmuXmHZd4uCa7+OhFAhENE/XfiewWG7MVdjwUIjDNYW1Sqydg==","signatures":[{"sig":"MEQCIHI2wnXsVmnQ030yj7FbpwQgpI1DJdY59sRNFakhF6BdAiA/VCEo+qA/+PTAUbg2fOt3H9i6UfGqUbESqaPczKZCyA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDiALCRA9TVsSAnZWagAAfNUP/itTLASKEqaNnW0JuBvV\nSSPT93kIoFAxAT3eIkGg865g4o1sb/LOegKVuYo9Cd9lcnbWwmjo6Vvs9wtB\nNcHOr+Hs5741Zu2oPSPjfuYyw1eIXhXbWAodDFOxdTvnkMXjWRshrjJ2Mgj/\naunnI8guij4JTJCqT8VeAp10s4Rrn/0a69yxB/po7LHLcEuPMDnPLEpGrd1X\ncJu395uHnWgywds/Y0dfjIchE5DuA9rLSGCBuoO+K+nl08ijLTswWnVQF9UX\nBw7cmN6MBI6/tXkFBr27ZuqBvsiBtd7GsEOouHqisLwbMzO0jGknF+xhemgY\nHo92hN88lwM1oUgqjnXYJtd7X6JS6VsmLE0V03oKXQGRe7Qbhi70YXwMX2d9\nSCpwRf7BaZkBC1y0l7Lf6r7mGsnUjrvezIKR+ggJSZ+hHhRT7R2rvQM3cPYG\n0ZqIXA+stnUlvyCZ7H1k4h4NyT5bYHSv40NMieLSikR7llArrhy9d9eObNFf\ntLzVOcnBdRAo1nTkNLOgiUVJZwGHy5ZgDnDk3PNpY7e0mPilqHUtC6pfgtBF\nnpgF7vmUnP2JNHrc3w/aijGxLxnvslSImZh1kD+D2crkeoJl6t8X7ohy0ltx\nCqRMmNYvx/4Du0PHEVtZI//kqCExfhd9Y9MxsnUPi7d1FuOgPeTTYstVCw7n\nWCz2\r\n=OfkF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9ac3956fa3f0b35d113404de60048e8aa1c1a0a9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d548d7a92.0","@material/base":"8.0.0-canary.d548d7a92.0","@material/shape":"8.0.0-canary.d548d7a92.0","@material/theme":"8.0.0-canary.d548d7a92.0","@material/animation":"8.0.0-canary.d548d7a92.0","@material/typography":"8.0.0-canary.d548d7a92.0","@material/feature-targeting":"8.0.0-canary.d548d7a92.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.d548d7a92.0_1594761227375_0.02202460163520259","host":"s3://npm-registry-packages"}},"8.0.0-canary.58ce529cc.0":{"name":"@material/tooltip","version":"8.0.0-canary.58ce529cc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.58ce529cc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"27a665e1aa7588b21e5ded622813efd8db407f42","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.58ce529cc.0.tgz","fileCount":42,"integrity":"sha512-GChboLhUrwZ7qWf4IfgprmMsWwWY/gyC6aJyAXJ3h0JchqHkemzeDwEVgefPjYH2T5NQIvi43z6665Q2v2RnJA==","signatures":[{"sig":"MEUCIEfwyo5+uxQoMCzFQhcDPwp8FvTYlHKfWPEo8yzKetkVAiEAwq+4nW5Wg6wnM/JnVU8V6kN5kRCP/2K4uY6PEVL6Yyw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDiCGCRA9TVsSAnZWagAALloP+QHEZC/ru8lhBUZz+p3B\nYM0ftmmRqaoehHZX2TAD78BB1BzAQa/cLuXa23bSWRJYW0Vnci8zwqXI4QuG\nLnM81CQAEaV3AMp4C3FqT+aZ82qFVrFgklugS7oYZ+latjJqOaDUXqCTa5bV\nN+dlHQDceji4fxo7jLG30ZwIFIglUpenCzEARRaw1t/BKlXt5j63cnXgq5HK\nJRUrzEPIXjD6+XA51r8NDCR38vHmS/g5+Y/aFJXzOk3d0zSQiX4AwQvODTHV\nL00L6s34bD4ByPFal1+MdoYzJQZirqssrppPdVwA1XtD99y/pMKTwLVHOtc5\nYBh7H5fpH1rH86HMrQUi4btzYdakT0jP1pGzFxCMFHVijjHfCjmJvs+1lp+t\n7GTfwgbPRMqX2Wlw7GnE/+NRF2kviYhNbD+FUEQpSPDAropRWIrUUb0/O12A\nEQf4VqTg/la/ViuvtCy74ZtoArkdsertgeeAbODS86m9wYawQqFBg6POkT2t\nZ+p8iYlkQExcnNxlXBhcpr9Ykchr44l1qDtOnt1jpQrMQolWOPR0DHhFq9Ju\nGZlgaV6KS8Mjk3RZnwcMMN525q6xW0fVSy/mvdLgvAZwkgmkLHSc1h+QK4Eo\n/ayLJfWInvk5WBXoNz/5EviEQiSh88o3VWcqju6TJd8OXYwMFB6NT9N6YRU8\nXuA6\r\n=HM8t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c45eee764d94f6c07b8a5b3770c89c8bb4ccfeaf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.58ce529cc.0","@material/base":"8.0.0-canary.58ce529cc.0","@material/shape":"8.0.0-canary.58ce529cc.0","@material/theme":"8.0.0-canary.58ce529cc.0","@material/animation":"8.0.0-canary.58ce529cc.0","@material/typography":"8.0.0-canary.58ce529cc.0","@material/feature-targeting":"8.0.0-canary.58ce529cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.58ce529cc.0_1594761349648_0.9581401741458198","host":"s3://npm-registry-packages"}},"8.0.0-canary.a0f1202dc.0":{"name":"@material/tooltip","version":"8.0.0-canary.a0f1202dc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.a0f1202dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2968647ea31f3bf1321a0a214a947b1cb17e5e20","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.a0f1202dc.0.tgz","fileCount":42,"integrity":"sha512-Hb51GFlPCFTPXguN+R8wVgT7qLq9GwD/u8OuV+PN0lnYvWcyHUnb6lABgDXXmpEw5lnbT2vWqxyWCl6rmnQxuQ==","signatures":[{"sig":"MEUCIHRmPcg2ervYCkvEXCbma33WjwQYudIsj2zuog1TPBhHAiEAg5HfCDS1WREHsmsMBcBWEtLErTCiBkoBGWkb4aai63I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDiUWCRA9TVsSAnZWagAAB5IQAIWw6RW+K1CZ+G5hpksb\ni8OxA3hYzKzLJMp/AUuahQaZMS4VfevjTqd7V0FbHO+IwmDUTKe9womBJFcT\nDmbuv98IO4/Ki8EUIpZPA0WWhFzrB33cAMF+wfOwEDH99iFFNYCaI0CtfdYZ\nTnc1q1Zt3p9iSZ7osEOHb5PQUrF+voZfZz1liIHmFHecHxNRsGw6IzFcPbyp\n8Y+RUkFMm6d8DO1ICozzXE1974PunlzPVLFHzJOHnnNLMj2C34KpkfQe2ndL\n9K7EVWVXZe9r8qetpUD6RD8nabwYX48f2UAgyag9bJxmXJsKSHqfojNCKpJ1\n9lKHCEaM1mYRWa+5SBp37GwKgKE1TlSZyDgT6Xph4cG9oy6fOY29WGcM37pO\ns/pwXF1Jw0Nsw5Kn8UKQwA6fcysEGZhaSLb9RjNvg9Bg4mDbqKtzbENRnV7f\noxoR0WxVswpPb9pECBAyvmxsCX7DvO4R6h/yTIVybYKMgiYd7EleqdLyNaf+\nYXC8saVNYd9UzOBetFfYwq1QzMXa75vVkmEgC/Hk6i2dQglwAuZlNnLaoKe2\nix/BvWpViYGdbPtE1R8KA7S3ihYTju/HoKuOV/j7IajR83b8f0ASoeoSOT1z\neUINczDJcmMhDvzMFLzjvypGlC2BxNvIpZYNzluSAnZlgogwImbNvVoa1y9z\nrD8n\r\n=5E7d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"93fc447a8bb5a55abbcf4b72084f1c65147f3cc3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a0f1202dc.0","@material/base":"8.0.0-canary.a0f1202dc.0","@material/shape":"8.0.0-canary.a0f1202dc.0","@material/theme":"8.0.0-canary.a0f1202dc.0","@material/animation":"8.0.0-canary.a0f1202dc.0","@material/typography":"8.0.0-canary.a0f1202dc.0","@material/feature-targeting":"8.0.0-canary.a0f1202dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.a0f1202dc.0_1594762518509_0.4146004149731759","host":"s3://npm-registry-packages"}},"8.0.0-canary.ad4df58c1.0":{"name":"@material/tooltip","version":"8.0.0-canary.ad4df58c1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.ad4df58c1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b8661005617d716e7768f0bc9bf80419583a541b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.ad4df58c1.0.tgz","fileCount":42,"integrity":"sha512-/dtfEvJGrBf6XsSKJCJu3u09mz9omhIh+V4ioNj1gCp7IcG+QN2SB0VRrU0I9vrsxOx6fttoMnIXqje/e+AfjA==","signatures":[{"sig":"MEYCIQDz+nDuaeFlr6yqkNvHIFJojk5ekA5AXVVNe60qFO6JkQIhAORVyYJrndQ0k8k3KrBgJvNLUR0s53Xbcnb5lEiQTJ3v","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDklhCRA9TVsSAnZWagAAc0MP/1kCAz5+TCa7KNaesMVH\nD4utg2W+ZfQLUkAOnbYJbHUniAHY9rBxSQxXir6vPzuMcp1vSmv1QoKODaPs\n5ICtDHecNm6EoCjc5AkmyIsJyrDYjOgZayGtLj52/WNGkjaF2JPgraoC+jft\nGeaUwbxSkmDcJ4dToleGZJIOut/WO032hhfBiAVgX+ladY+yFTgkJD1W0gFY\nyIlXLXV6fGsRKJX/Mg+O9coEJLEuC1svIOm0DC6WpZSZrW/XK4X35U4SBuKX\nrfY7lkP3+T+kk0LG/b32y+BXm3TuCCGnR2FTtUeDn+mTvhievOy1cSbM4i9J\nd9790dJ4ZFY9Ue3T2sYRpQJeN5TFobwbQegIa+oUJyQwhAZfJW6g8HXbO1j+\nl6smfwhe5s/uvu2AR7NMoaTmj+AMoByrY0J8/JM5/EJuONSEDyaty70+5GpC\nVXRVrRN2gZ4ecJ9HQYqYKwieAOAK6LaR7qIgnq872IZOfH0ziMgwM5iSlkLE\n/tl+PoDCuSFvmmweedbJ2bTaJ8lamhPjNMjsL4eOHLNCrzaz1U7B1jrZGVSD\numaAeVlu9wkjaZ9J9j7/hM30w8TVk8aA2VUjNh2owGTMrIsrfnt2bsbKVvf8\nCVEVDwiNn2Oc+3Zgf+SPZpi7Dd1wldY4I1FZpXrD4F/Qvl5+Hg+54ZjyavPA\n+OKe\r\n=GGhZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f3541b13d081357419478232ca7ae0021f2a6b43","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ad4df58c1.0","@material/base":"8.0.0-canary.ad4df58c1.0","@material/shape":"8.0.0-canary.ad4df58c1.0","@material/theme":"8.0.0-canary.ad4df58c1.0","@material/animation":"8.0.0-canary.ad4df58c1.0","@material/typography":"8.0.0-canary.ad4df58c1.0","@material/feature-targeting":"8.0.0-canary.ad4df58c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.ad4df58c1.0_1594771809041_0.31153572726643897","host":"s3://npm-registry-packages"}},"8.0.0-canary.01db89053.0":{"name":"@material/tooltip","version":"8.0.0-canary.01db89053.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.01db89053.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"170d39579bdf3ed3f61476602e551a6bff350554","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.01db89053.0.tgz","fileCount":42,"integrity":"sha512-nyOYUIoIIqu+IwrtdVLm+pYg6kwVP8ZLKOwHV6SvZ/e/KmfWUd1ElDNRIfZlefLYBZRxhOeDM8bvFLCmnNsVSg==","signatures":[{"sig":"MEYCIQCLIR8//2xEjohxcVQPpRCUpo5aLjDar2Yasq+acqxz8QIhANlZOPjinTrHMWZJ8/hg5ryie6XR2CyDaD8ubj4RPQt+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEIL3CRA9TVsSAnZWagAAXXgP/jBJwi+vXpTrT/Jni6uk\nsOk9KDVsn+6Ws5omdssBtyDqnz33EQ0fr2foLMob6GnV0R/DTRCW6taNZ2zE\nClNo4F+zy7mrswVT0b8GaGXxz4u9a5JoBkOiAynpVUdhOAkjf96aF0N3/uCe\nlUXnFTUQdITfhgkacsklZqZ9gIi1tCzM6sfwfE3m4JFBAZcN1E7Cuzy52J/0\nNaMWjYCLgVMgUslV//bMS66vmKHZhsb+xngvD1rn5GmcWegZghXxbPC8SpOc\n46j2tZZBZSOhrivMPLYzROZ988hCMHv86sCQyXVt2uhYgyd1Rr5AalCQMi+y\nQ0i/RG2OWFqPu0lKufKfNYPOH/+VVDiMyfIGcP5d5Hy/mNP+aOXzXuPZbbcV\nLM6lqbOUINFpdfPnQADH7AU6CNQZp+tpTdzx3qtAjr7EyjBw0A4QvKYrq/CC\nr0F8iA8N+UQhJ+Nj8qW9nztF5Bwhia0tsV1wcRGcG+28+fNOLQhD/KIbMyzS\nnHGkDU4UD8b0Pc0SLUrf8w0wB5zuzaZnGT+BBd2fMua2AZ3/FkZFPXJdvNDC\nJWKdlNqWLDrfTbr3k45I3trvW1IkF+mkC9d0qdRThFU+sGqEJGaCqUXGC/t/\n57BnNztgXKv+uXxQPxBG366OWe9qokSWILNrtC30NG3zRsIrD1xwF/rb3kZx\n02QN\r\n=eKKq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8780c29a82c64caee37ec22f279b264af42412b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.01db89053.0","@material/base":"8.0.0-canary.01db89053.0","@material/shape":"8.0.0-canary.01db89053.0","@material/theme":"8.0.0-canary.01db89053.0","@material/animation":"8.0.0-canary.01db89053.0","@material/typography":"8.0.0-canary.01db89053.0","@material/feature-targeting":"8.0.0-canary.01db89053.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.01db89053.0_1594917622805_0.13836029449439602","host":"s3://npm-registry-packages"}},"8.0.0-canary.fb5a4cdeb.0":{"name":"@material/tooltip","version":"8.0.0-canary.fb5a4cdeb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fb5a4cdeb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3616e1591bfa80f6fb8d095d638ceaa43c7cdbbb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fb5a4cdeb.0.tgz","fileCount":42,"integrity":"sha512-dFjFK8VRfPVW+Zhx4PJJmj9Q+ShB5CWc09xOqffM6EXfdXR1WzAQRoa0kDDZiO5+TkzRzHGM7a0iAupTY6TD/w==","signatures":[{"sig":"MEQCIFFw59LBPyTvnaKNfcuv7kWWop3HV4L24jel43EcHqunAiA9JIcJynTEXOTeY6CkCEoONC0Z5XSTfwsX2xMlGe1Idw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFe6MCRA9TVsSAnZWagAARKYP+QDPyQZsBNsmwKv67kI8\n2UuqU1nn9eDucgeTEYCeEh+J0wevZmJFUfX5mOuK+qqOgAKO59LJWJ+qWh/J\nlKOfD9/kkdfjYAdDCj1OLvwb+qXqNNpOhMlS93+mCtqlDC1Wq1XbnEXg46Tg\nrM6caT2FPK/SFm9f2ObDWhmvAjrr59vyWZvyybu56abvsKMVRAAwXVbgkdmQ\nBeWViXahPfPlfQtDyEYjkCvL0rR9Fz8kwOCgpCErf3iuz8wOHt4Ps5Pwxntt\ngIDEvFwN2OP7hlqqJluu1I49EX6pMbjQ/bg/K55hcPPY5JiuWwzEtJhrtCaf\nEKxHSxDYvdjK1wRQxwJw99z7FRLgvdtCnJ+y4jCMxAIkwfI0eEvEOr3wLLEM\nF7yrG+fKwgI5ecjEjxuFy7yWGYhuEfdnTbFhLgYsTVYfhLdg/UB+IfcwDYIc\n2gb5zalWmCovUx25uxITpdGqkd+8vnIYupyAxUnv0yIRVp7o9HeqN3ehpcOc\npMFC3TyN8AUSBsqqdj07RQ2Rec3bLSnNGWlhqdl3e+ML9M88IbZSyFZqt8Fu\n/q0rDpJObs/DXh1MObAsJHWci1iSxqFP52ea+zFPm4os7IY4blKlMgrk1ska\nUAOVUVakfWAT7uwXezsXbL9JRMlBD3iM0TX/ntBkmmE8aQR0eHoQntEn4pc/\n4d8A\r\n=FWBJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8e80295b6b3e0ec36934f8d691b193c740458d1f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fb5a4cdeb.0","@material/base":"8.0.0-canary.fb5a4cdeb.0","@material/shape":"8.0.0-canary.fb5a4cdeb.0","@material/theme":"8.0.0-canary.fb5a4cdeb.0","@material/animation":"8.0.0-canary.fb5a4cdeb.0","@material/typography":"8.0.0-canary.fb5a4cdeb.0","@material/feature-targeting":"8.0.0-canary.fb5a4cdeb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fb5a4cdeb.0_1595272844234_0.6031212480975718","host":"s3://npm-registry-packages"}},"8.0.0-canary.8df0f517c.0":{"name":"@material/tooltip","version":"8.0.0-canary.8df0f517c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.8df0f517c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c23745d7fc3d1ec87902177c7eb3014bdc6bcd70","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.8df0f517c.0.tgz","fileCount":42,"integrity":"sha512-tly0SOj0V7KjMtcymp+Z+y2rh/dsUUHnjHuqAfFg16x0sLLND8R7KmgQcPqdrJAUmHY4jNdPCh0K2f+A9pT8WQ==","signatures":[{"sig":"MEUCICxoHv2CovZSW9CFryht5JLik1tPoa3QBaU5mrEELbB4AiEAk24vJn+d5Zyf3ZGHjYC2MPx+FnHItMqOgyND3rVexHw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFi8rCRA9TVsSAnZWagAANdsP/RZ2fsTrLN6MG5AFUGJy\nZI0r1Glwm+DQZCLjJ/osFGQxQJ4v54UCi6HNuwD2nwgRYMvwAullXybQimz2\nzKga4HA+kKo8/Q+T/bWsMG+h5Rb3/EoqQxuxLnK+riyl5u+TuzE49Oc6bAz4\nfH+lQhPZNmqgAoL871Mz7RK893/Zl0kYb0zg5zxnD4CWQkwedKCxaS01d7uD\n+79+kpx2RY0p4U77968N87nGD3EZ8PskACMRT+T5IQmozuMUP01Zuu6oe+7a\n4dtO1mhHB+F2WvA4LxGjqPlDYrFpPLQ42hvN5o4CdwmIMoFKK6u5AhIAUcL4\nfMR4yHP/0wk8fyro9yMkXnl1Ll37lfzEojOV+jcocLsdLJhKuE7pH/mm0QkH\nIrUdumxvnxL7vTUtQ8IAOa0Nt7aAS950z8k/4NElO0IkD+CDXgC3sd2dViJn\nxbov+L2ZBn37hRzJQRyd6O2Ew6fTnPmfM9n/3GwrgdeznZEFUn+w5rr1Sjpa\noTQINCA4OazdOAwPBra6s3Q22NChIGBD42y01Fr55Mg0FVWeim9l2hYGiHpH\nQXo+RhbiAxh39Igl3PfKJY4dWUULH5dosvJ0tmVaEwN9y4VKNQ1q1/Eu+MXB\nyTCKJ5eBz3solDlCLzmNsJNokrzLrePvAbPJe4xIiPSaLcHqE7W1POgTROXp\n9S4q\r\n=K16a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5fca8679b0dad51628e898ac223795eea8e54d56","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.8df0f517c.0","@material/base":"8.0.0-canary.8df0f517c.0","@material/shape":"8.0.0-canary.8df0f517c.0","@material/theme":"8.0.0-canary.8df0f517c.0","@material/animation":"8.0.0-canary.8df0f517c.0","@material/typography":"8.0.0-canary.8df0f517c.0","@material/feature-targeting":"8.0.0-canary.8df0f517c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.8df0f517c.0_1595289386599_0.9125008623676056","host":"s3://npm-registry-packages"}},"8.0.0-canary.abcdbcfeb.0":{"name":"@material/tooltip","version":"8.0.0-canary.abcdbcfeb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.abcdbcfeb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"16515990ac8f0ac6086b8403b66050bf16323734","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.abcdbcfeb.0.tgz","fileCount":42,"integrity":"sha512-M/Wu03eAzvlEk53Q9Yo7vX5dELxlGaXwrGN8eBhz4GfTza7Nvi/Jp2dOzYDg2q1GqXXvqyVkx+N5q9J0hV7Vug==","signatures":[{"sig":"MEUCIQDjEST1DSclySgHsSPBhTsnSOqoEIqDME9XXejb+oLbwQIgUsrxZwuBCsys+Q2YFaH6KlvhLqPfJWiQkzLTmuefy+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFjvzCRA9TVsSAnZWagAARWkP/3RRJvT7mmXM2yZ+/A/7\nlsIkEe7p+Cou/8/mgvfATQRxFSnNA+IJ63ttuXiaEWxwhMb69ueHKP3TuqAM\nwsF79Mhi5RI0G9Jnww616FDSqsCDxM0d7PMeJQdEx8tVsU58eOwacFPA3x9T\n4Pose42it9fh9WtcJV1/irStBzgDcNQ0XX3WFoPTCgWTpufndMleRWVx21rv\niHWJsEscFVMx1nKBrNfvLNjy/PYlKx6/qLQsgZUjtsNNwdPGGNhtHV2MDmqf\npaGxz8fyy97gPEvTGs08RHer6icydu2nhzRvqomfwv1etSF3n5mwISlbJTFN\nGbjsxwJpI0ewONn6QZ+QrkUWgn7E9/pzcWyhCvQhASAaAm6wiF8B1i8Qf9MT\nz1QGXn4cwcltxVuMG1x4B3DCs531I16mJywAK6RqQO8ms69nggaRtOcvsIOK\n7O9G0jgqvCx6YJegaGubLzeEshd4j/U6P+WOrhAC6fTaQcs1OtoC8IfjbUq2\n0aRR91Mh7M1T5Pb0v+8YGfUl20YmYZVmz30EKZilei/JMyQDUDWv5GrPxOBU\n8p9YRWzyz5JieWE8ZcTSwu46wPB0J6ENXW+iDXV6ej+uxunePd4KwAwv5Jc9\nqYhoyXZSgYc0ijl6gJp5jsnzK4G07g9OFRh50ooNXCOkmcCOEPlA2H+ei5rP\nqz1D\r\n=bjfE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"946720776dd73c7539bfa072ea415124b3e08a55","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.abcdbcfeb.0","@material/base":"8.0.0-canary.abcdbcfeb.0","@material/shape":"8.0.0-canary.abcdbcfeb.0","@material/theme":"8.0.0-canary.abcdbcfeb.0","@material/animation":"8.0.0-canary.abcdbcfeb.0","@material/typography":"8.0.0-canary.abcdbcfeb.0","@material/feature-targeting":"8.0.0-canary.abcdbcfeb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.abcdbcfeb.0_1595292658634_0.8402413229779884","host":"s3://npm-registry-packages"}},"8.0.0-canary.7bd5075de.0":{"name":"@material/tooltip","version":"8.0.0-canary.7bd5075de.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.7bd5075de.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b814c1aa27ea0d6ae42fa27a29b095344e457571","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.7bd5075de.0.tgz","fileCount":42,"integrity":"sha512-GZgbZr3Vq5X+nWKUQg1Ob0XE2aACBPTSxRAURNuGGi6Gdq8P4I9OTKMwNNGMrjiw3Hv4Utew1O70whVyLu7iIA==","signatures":[{"sig":"MEYCIQCqw24NaUMGEM81k1BMaNSY6vMX3aVhr2YK/seKOjmzkAIhALYUe70Xk/Bl2pJYrTiMegQZB/EThc8uGo4UxKRIiJmi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":349144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFzheCRA9TVsSAnZWagAA3vsP/2f4Hvwalc79cH28jx3+\nI5y68itfaGUeHW8Be+QNSlvHoBiMIMZ5dtOTFQVQJwIzAXd20TU14tHlEkN/\nX4jMI4z0N5aGxDNDYchau2YxsPuKqx8ADEpuZ00JfUjItGktkinwR/Yrd6PL\n8C0k4D8foGXuUhMtoHE5H57CvPPvGzZnFnRGns0tL5+tQeA8Fo3SrmLsj9nj\nNUU4T+2jhOGgw9A6u31AFi0VJe5NT74+0KiMB8Y+Sa505mGReDYhF4qedu16\nnl4+mc4KFo4ljxH3mr7sa+4DK3qR1v1rrAszZ1NRjJ08q8BdcSYBw56bdOqR\nrtIzSMDD+u++YDYm9C60u5/sVKEoKWxm3NprpdwxhMwLsDcmb3biAK3/Jau5\nc6YxPb/5Y5DIEdPSZdqT3mM9MhDZXz/DpLUs1cxFJstZrZvfgKp9oGblT0jm\nnlU8p3XFP/V48NPYERh5IbdGQcLmvtrtwCE9mMaRvG90zKxQGf79mKfJmJQ4\nyLiLTrWROcvs6SrEOFxI/UBwNT+JSCUxk0cQle3gIwS6EMF5kVikgE2dPKFj\nGj33Az/rf307PaHsc3lq2Pz/OOrRRvj+2P2ZSX+PXi4YAZcsl6J0fTHrAPln\nrAo9ByXoJBbT4ARVVS1U1ACex+NsE5jQ1nXKNRw+X1QffltRXec5UISHPEpL\nMtI1\r\n=+lDq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5ae456e961b208e98164fa21047b3ff2e3f3d8e2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.7bd5075de.0","@material/base":"8.0.0-canary.7bd5075de.0","@material/shape":"8.0.0-canary.7bd5075de.0","@material/theme":"8.0.0-canary.7bd5075de.0","@material/animation":"8.0.0-canary.7bd5075de.0","@material/typography":"8.0.0-canary.7bd5075de.0","@material/feature-targeting":"8.0.0-canary.7bd5075de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.7bd5075de.0_1595357277995_0.5196213573241124","host":"s3://npm-registry-packages"}},"8.0.0-canary.405a29a20.0":{"name":"@material/tooltip","version":"8.0.0-canary.405a29a20.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.405a29a20.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebdd0dddfe0c001215ae65dcadcf4e5aca8ae3df","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.405a29a20.0.tgz","fileCount":42,"integrity":"sha512-TH0PqjHdE0PXR90zFaIc8daQ3URFblY4AWbdq2KwdG68kIB98jxvCs63cnQ7fWWNYfvv3Gzdnk3TrVdRdEJp4g==","signatures":[{"sig":"MEUCICDHrwjFU827baPB2hOPYDp/WrW3FnoiD2byOqFSkX1tAiEAlT2jNxBwHgEI+bCKt1PGAmMXM+QRcELZCNNyCVJKn5M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":356314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGLyDCRA9TVsSAnZWagAAaccP/Am9NIPPDknkbH25PViY\njSUlOb0sirgDPR6GU9yM+3ysXXK86JzMKeNjp0e/jqoUakA84vU7PbnSlpaR\nBL8iQkyCFLthhth+Scfu31TYzzyKwCJqnIe6gitgMoMgks5wnnjhn9n2Pg9D\n2Vr1Pbq7tWEQpLMGhuLEZifMGPGhrVn5W91MI00lNJs8/wTyENrTxrFiRl+P\nYzItABMiuTE4wsnshmBvRK7OFTD7kWhVG/leg7G0JvFDw+5y8G/nSj3gVRwp\n0venkwnxj1t5FMLM8SmH2VcB4dF3rdzdNnofoSwdHTzqKviYtG+9wmoPngpn\nvv16hWY7ELAEH3sqNQSpUgXB2wJ4bLX3wcPCyaSuguZsFGUQevnMA+hNG3D+\nm59C4c6eiTtJIzh3dZAQErYbp/LsvBCb4J2MHOdy1tG2oX+B6w/rBwkm1d0f\n/myETeaUO8epJNCOVcC/K/6a2AdA8Nv1vtv8vS94tckJknsEvUOXiM9lptFz\nIjRHb1hDbfZNhgu+25XP8a8MRu1S1FqeRlaDRAQ7cUUSFINJkQwtrkm1DqDr\nBSVeCm12H+nHKAd1ToSXVilPe0YmKN4TcS4FJpZMmIXbMvGORvJizLyGMLBp\nnNQbqPe2XlittftZfRlHQwqsvPBxvTiT5s30x/iAHwHaBUNQj/KT2peuOslB\nCcG6\r\n=Z2Ce\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"02c4f49285e8229cf49d9e4a0df213ff914b949f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.405a29a20.0","@material/base":"8.0.0-canary.405a29a20.0","@material/shape":"8.0.0-canary.405a29a20.0","@material/theme":"8.0.0-canary.405a29a20.0","@material/animation":"8.0.0-canary.405a29a20.0","@material/typography":"8.0.0-canary.405a29a20.0","@material/feature-targeting":"8.0.0-canary.405a29a20.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.405a29a20.0_1595456643506_0.7846629146789044","host":"s3://npm-registry-packages"}},"8.0.0-canary.f3693ac4c.0":{"name":"@material/tooltip","version":"8.0.0-canary.f3693ac4c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.f3693ac4c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d6680b2a58eb665f54c0076d46d0f653520416bc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.f3693ac4c.0.tgz","fileCount":42,"integrity":"sha512-xlOF308D50Xk/lFut++c+HyFTedubl+zYwOacK7aVR4wbsWHFTbJGmrESNZt2/EnzZChHFXcLbt8KoSYcVs2mQ==","signatures":[{"sig":"MEYCIQDYYaw+DzW8kF7haGn96N/sI3lcOKhAQgKlxoVf5suMfwIhALK2iW+3ha9gdyqzLoEmlSGRCStHhMXPAax94veISn8/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":357424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGL70CRA9TVsSAnZWagAA+9oP/3/shjHzVZvt6vSa6CqG\nd+qPrhbn0hJPTSufmpbHbThZda3sEK3ubyWodIh90UwZ1TO6id9zTQ1bn6BU\nI3mY6gd9q85tsRo2+H4vS8If9YaVnEfmxNqKn4L5iiMP6rPIPsNxDw62z+UU\no1K/kehMP7SXZ4OXg6MTreZAW124kTA7KYhQ+ZQpdgLkyAmE9N1YQgU5AAo1\n7LKdjXIexAGZSmDk4nCsqEvrs5H8bL/TF9qCGwh1ZpByJK8tuCMAVplQGjH6\nBBqLslcAc8q3iUNQT+rO260EoGdk/IL4qDmDk8na00lscpxXMcZRTAHQd6l0\nbQVfY+mECpDPJt+QzSf5AEMgw4TZIF3+FYK7oox3JmhLfuWm4BTddO0E7BAa\nPUe/TSBf7TQgBGlqaGidtEdzFjCILeOJyiWo21UlumXD2aqTTmdr3XzI5Tpb\nv5QmL9fPknF9DULcNjhA06JUfM11i8+ZJHPxtBGY5XJpA3C3UOhBedY2MmdN\nieSexNnsIXcyxZddJa7YTRX55Uy8D7LZfuMExp709op18piN4xL8umqiZgwY\ncw1AhK+zcWujH3YXVnx+FtYNToeBN5rUSF9ArTOmp2cZluT1tfq/PysPR0g1\nTOylNHcZppK3KKxIC+WcVFUvA8XnlWeEPJIRd22DPInK1myxrbePRfVNNNH+\nymf+\r\n=tnI2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d3170e3936d96d26a6ca17df46c1febcfc33078f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f3693ac4c.0","@material/base":"8.0.0-canary.f3693ac4c.0","@material/shape":"8.0.0-canary.f3693ac4c.0","@material/theme":"8.0.0-canary.f3693ac4c.0","@material/animation":"8.0.0-canary.f3693ac4c.0","@material/typography":"8.0.0-canary.f3693ac4c.0","@material/feature-targeting":"8.0.0-canary.f3693ac4c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.f3693ac4c.0_1595457268378_0.7167003170920572","host":"s3://npm-registry-packages"}},"8.0.0-canary.12a109680.0":{"name":"@material/tooltip","version":"8.0.0-canary.12a109680.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.12a109680.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8d14fc1ff12b946d4f6737eb084348dd345c2163","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.12a109680.0.tgz","fileCount":42,"integrity":"sha512-IFqgE1bu2Q4B7BVcE9JmTqdXyGpDBlZmUc5RGBVpAEGJxDdZM4Mzpucp/wqLKCcG34hxVWgPoMIgTEdpNQyPMg==","signatures":[{"sig":"MEUCIAqzPVVTzlHCdEP0DB7fWns68mQE53YFGIxxyUz6GNbUAiEArjyA6gOohYG3IMV4Dk17W0mdmBNsco6XnxG6cz2u4X0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":357424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGMXxCRA9TVsSAnZWagAAM7kP/AxMY6kGQET4HpUnmJb+\nwZ9rQggbw10L1DHCUqfl9mGAL8qRUksOFzqu4hUoRU1dATqbPBcbnygxjsvw\nE24/Sv/Ru5nRAQveygjOXhLYN9gs8rUDVDStIEu6PC50EtImyhHRp6jHU4ou\n7y2WeolxG9hMPGrHWlBugfev95DvxAVl/uJp7cz5kPEGYo/Vx+lwgqRdruBp\nTbKZxajmtV0GR9AYMDLWrS5HJL1OPnGW1+cnqwGaD4gNctL006hQwvFClryI\n/f2xdO45TTKGnaTF3ZC2cgfO4u7q+r56IMDNr4rOoo/Qc5dbzpUiFv/+/M8T\n4ZVJJ4zMMyQS6qKW375nlKHWCuHBjL63xC/XQUN1+8WHu5i01yMD8RJ7s8B2\nsNDpXDh+ItxrTC/GVHALvyfh2PJdkNGXO7QjNxABZa/8x0me3Ko9zsa/DjJb\nTWvYJDmn4IGAMnLQTB0Za5/S1VKvec2oYsmG6864I3TB0mmGtGPBwDeok3C+\nDFKTMCC5USeEs8hep6Z0M3OOd7tPLUa6NlMAAgzEWQE/XIzMjeaqoj53duwW\nilvKXpL4QaQlTkR1kIHGlXwc0BhwZh/OYmCa4kkODYnRb3Hf2cUOkcJDsL9v\nqe7S9weBAclO4SKRj0wG/kbMJx/YWLoumGsTSzUYDPtPfugvk8FKiljQWGRt\nV9HO\r\n=d6EL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a403e743d7da095028c3ba6d0a66ef2f7812aa8e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.12a109680.0","@material/base":"8.0.0-canary.12a109680.0","@material/shape":"8.0.0-canary.12a109680.0","@material/theme":"8.0.0-canary.12a109680.0","@material/animation":"8.0.0-canary.12a109680.0","@material/typography":"8.0.0-canary.12a109680.0","@material/feature-targeting":"8.0.0-canary.12a109680.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.12a109680.0_1595459056803_0.8866571513165624","host":"s3://npm-registry-packages"}},"8.0.0-canary.bbd06696e.0":{"name":"@material/tooltip","version":"8.0.0-canary.bbd06696e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.bbd06696e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4f18f7bd61c7a969429cb2fdba8cb22c48cef713","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.bbd06696e.0.tgz","fileCount":42,"integrity":"sha512-+hBN892S55MoS47iKV60dBQTkYdiI34haWS1PLVg/V+p/hE3h0ZwmemMwtyjmHBqjNuwej9vbnR8K6iGPfet9g==","signatures":[{"sig":"MEUCIG/xssKG8x2GXNh85VJ099MQGvTaAzWWNHrJ9kRUrsy2AiEAvfzP83aO324gMMn/30YUfjLy85lTSGrWBgNkEq4+bTc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":356427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGNGKCRA9TVsSAnZWagAAUGcP/iRhyW5KBBLegwejKzOg\n8Deeoc6xhBKSU6oFrYbkEUIVLoH+be/mSbcMaSHtF/Mci7IrWc3kU0hkbgr+\nmTCO8my7kgbyTL5/FNXf/94QDn1j72oWlAnJznrYMzFsf3fSDHs5NygT0M+Z\nhhMPLigKe1yAd0bGWI5UyuBkUlPgtQCJ+jS9PqosVLfYNnNcQht6qOIEf5cb\nPF2q8U+NYLzPZ9jPL2Zz6KbisUGBVkD3qYTClO7dhpuBeKrf67z8HVl4iZRH\nzUkOPJHa44b9aQP81g04LbosvM21+Rj76y/2Y29R1AiqnDsdFK1dIbJQaMBx\nqTYOCU1HA6KWuQV1xy/Z0FprOQWDi4GLNKS+x1+8Q6+O4zWJUrEdg1hkj9uA\nSpiL/EJc/nPZHbbiG8fl93U+cwpB7G2fcJGsViDSAoMjj960GfdMHCHQ+EO0\nbAQZZENrO+ADnPv2y3tkeZQNti1wnHg2ks8vLU02q+HdAWVxbk4yjxh6rLbh\npnWBC9MaG7BoGAXyJbk+LWGawAOebAxIZmaH1IuAayK+QGWhn8QQgK8Vtn40\ngBgG31jbkgx1XztLC8y56LN8HhzPGx/WmM1cJUwajCcrgBzJvbr9Z9C7DRdI\nSo46LfRVx6IXp5OCdMekwWK7gM29XefLKfEvXiQahecX/PIbJMnPoYz4nxA2\nYL9n\r\n=5vuF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1d34a386a37996e326b9ca18440ff1cda261f3aa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bbd06696e.0","@material/base":"8.0.0-canary.bbd06696e.0","@material/shape":"8.0.0-canary.bbd06696e.0","@material/theme":"8.0.0-canary.bbd06696e.0","@material/animation":"8.0.0-canary.bbd06696e.0","@material/typography":"8.0.0-canary.bbd06696e.0","@material/feature-targeting":"8.0.0-canary.bbd06696e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.bbd06696e.0_1595462026250_0.8881542306232388","host":"s3://npm-registry-packages"}},"8.0.0-canary.4951e7651.0":{"name":"@material/tooltip","version":"8.0.0-canary.4951e7651.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.4951e7651.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a8ff5183cb64a5f375c19eb56a41b6d77bb2896a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.4951e7651.0.tgz","fileCount":42,"integrity":"sha512-uN7IEaufSnQJsjPvaTCZkzAGhmgF22w24OhiqEdwGEwg1a4inEPGZaw26qnTn1023anAdOByM5wEcSrDpOprXw==","signatures":[{"sig":"MEUCIQDk0a2Mtp3FOAy13diVg7CDu7BfIjePwFJnKSeYJWWMiwIgHpJUZOOyQbWmnA9AQEEhYwXPneWfnEw8enbYjWKWVO8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":356427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGOzmCRA9TVsSAnZWagAAamMP/3DdavGEuZIoiKc5GE6e\nIqCuMCxEuhuHbbQhvIYWhomPgFrH535tgJvDwhqR5FoRNBpXfqhf6SCMXwNM\nBPc3rHrg+pfWYXZrAHVczpIEzO4FbFkWhW3IkkZWdClOu5IDLrE3k5GlP4m2\nd7Z+qvHtJLc+voiBRvydnprqpLkg46ZyyK5Ip2/0PKuAG7eggMkV+RM9vkB9\naOhXXw7VsTjfqznP1k2z/gbicqTh8+f/rfXW0rIRGlzuoZK6yqw8iA7o/GRW\nBHyBncvIbkFjywYljSR40AvHjzBrKSAArou3fULlp9EiZE8om6eJYblY+rcC\nTSO0s3DsZ0zpQGG8+4oeDjaj8MU6cBUpzw25s2Vwj4kw+MbNeSq7RvR6+zKB\nkR4mczDezAxMU73wcG1nwSapn9fdQcJTyqbKv/UUgtgbZiUB66sPeeWc6fr5\nf66szS1F9VAT2Ze9SNRSKPIAkcHp096trk4jOI484kcdXkNv7rcmZt6wBdUa\nW/uq4e4t53Vhxi22PMxoKVroK57j53WAIGEaQcHcJQ3FqiLcC/dzuV/wIUyh\nbKidW6Ur3V+MkCPDdQUapSGKp4z6icfUAFdX1PrSxvFitbQmX9Rs04gJAkBH\n01wMN0TddPS4CzDjTV1YTr9ag6EUU4kkT8Ttn6Acfsn6jgwW412YOz/8JDv8\nHwzs\r\n=mRj5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"32ca9cc0ab948e59f91965e96adf325a142b8336","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4951e7651.0","@material/base":"8.0.0-canary.4951e7651.0","@material/shape":"8.0.0-canary.4951e7651.0","@material/theme":"8.0.0-canary.4951e7651.0","@material/animation":"8.0.0-canary.4951e7651.0","@material/typography":"8.0.0-canary.4951e7651.0","@material/feature-targeting":"8.0.0-canary.4951e7651.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.4951e7651.0_1595469029967_0.6329405242501842","host":"s3://npm-registry-packages"}},"8.0.0-canary.75deebbef.0":{"name":"@material/tooltip","version":"8.0.0-canary.75deebbef.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.75deebbef.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"15661bf7fdd8d308980a43ab398cabd75f3b1b58","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.75deebbef.0.tgz","fileCount":42,"integrity":"sha512-5hzLrblmf0N/yvVR4455DdR0NdIdmYytrWa//I5YU+JKmwPIiMQej+XjJzChwV+oBtJ8AeZ1Ra4kqGG3vK8XNQ==","signatures":[{"sig":"MEUCIEaIPP8/h7Mi0w8c4kgwvdNmKZh4VxG2JT3OzkhvJgwvAiEA4Gge1CZPlUFD0tXazfipMIlMF1iGG0Ccg81Xo0ijKG8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":356427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGc1MCRA9TVsSAnZWagAAbYQP/Al5t4hwneBX3ItDa7tx\nQ2/f/BSP+MVJT/2uzOYTep/WP3NGNv5N1uYltXyI/UPwt56laPDV9XLkaakl\npFzCrBiWP5Omfwo41KfyyjcYEI9lkkyA+ibA9/NSHR6WO2Ge6pq2QJR0ZG+n\nIaL0kH+lxbB4yLB7PueoL6cJRZU+azD719PgEj7Ys/g1e7/dssJBidXI5Xvd\nfXKW8SHPvyFk331hqILfEi22hNC717XJ57+VQraW5XPgtQFY2GlmsIpV/PB2\nqSizrkMvvY2AC2Xyf8X8BNWBzqvyjT+a+qVgeOG4D3/2enywRXFfM255FU+Q\nCEpZEezua7NQV/mcK8ss6pbsoQo9BJ0DuSx6YQ2QBwwIEajBnpyfWB/uxT2J\nOJw0Fz0mrEEWvsnDswOmOtdiIq23/ZTSx1E51su0zZ8CKsx5LQZ0r1JJ3lEL\nWdYtWJBKVW5Y+jY7Nv4WBEEzjaw2kqxAqlAVwrCeOMGG/1YKl3OlXi1beVA4\nQV7EfHH1IC43V17zRQ+x5xRXwmQ2Lp1+0gZN3DDixrff8nbPIoGRtpSVufmM\n/CKSRx5QwXF+D/yO1VDDhf4HwGjCq97jHo3zNtjwqAULnQc3dLZfeqfIPtd1\nb7volWALrtyFBY7ipPnVgYEoyOeyyOw8bLeW90ubOjOBvENVFaT1c+NuHMix\nmb2q\r\n=3uU5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3df5ec3c8a254202fe3ba9017528cce3d5d906ed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.75deebbef.0","@material/base":"8.0.0-canary.75deebbef.0","@material/shape":"8.0.0-canary.75deebbef.0","@material/theme":"8.0.0-canary.75deebbef.0","@material/animation":"8.0.0-canary.75deebbef.0","@material/typography":"8.0.0-canary.75deebbef.0","@material/feature-targeting":"8.0.0-canary.75deebbef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.75deebbef.0_1595526476455_0.08213563018799497","host":"s3://npm-registry-packages"}},"8.0.0-canary.95aff33ee.0":{"name":"@material/tooltip","version":"8.0.0-canary.95aff33ee.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.95aff33ee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9908dc3062dde583657e1f1e990514550cda671b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.95aff33ee.0.tgz","fileCount":42,"integrity":"sha512-ruL9IF2OB8vJLvKY5LUgW9qd12d24AvGT17SvqHzy9z7t2M2B7XHgDDRF2bdfhubDKV8QtZSH1hs58olTv/Upw==","signatures":[{"sig":"MEQCIGWiLVshjy81CdSX+ZwrMS76IAWONUEnJHnKn9UQq1lJAiBX8AC61DIdUasdlNJxkuBRX1GW+zBRfKnJyxYEO3lIAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGdtsCRA9TVsSAnZWagAANVcP/28QhfW4JxWouz7NcXdy\nm7FwOmjoUlqzEafzre17W9bJtNw7ECDadmp0VfR6H3/TO+94Vsu2gzgNe803\nurGpzfMjjiKyIl/pCjIaLTlEJm0f53abOItjutv7F8s237WTG6QT4IyCXTAb\n5jmw+FS1WlPruxFIBNPWwwm2kpbmr6dsOIt/ZHO+srBnQRYrt1m1TEF9N9Xq\n78wLFXMWg1q+LDbbcWVz85C0TkKDXPFnI5Q2F61XjbG90d1vW5QdrFuVV9Ic\nhojB3yDdK3pRY3lSMJoAN7vfF5BI8d9xnbsA05H8dS6jzV6Al9BAFLaLLvdx\nd5z5KD2mU2Sm7yWKaMrb5ThuDCkTreMOCT5pgopVo5i0a6Goigvf5ABBuDdn\nv+5nPhvzznc3oY26ZFmbnLCTYaKxN8vD682duCVsnu3OIJQRKSpjS2VfG90Q\n85myTzoExFNtKOAYFKTOk1TjLCEsRh4lnm3s4bbT0WKZL8iEptFCFVPXwzzh\n3Ec0jPPToqYExtr9egB2+fL0rRj3cA3Bjnno+ge7TYs8v/H9xtMtdkUuRNQE\nNiyRyrb+ulxZDgoA4if7uec+Ym7qYPYYly9n1QR6ZxD5tlJ3pKXZsdgaWzim\nJj1IZZRvlcJbS94s6QoeDoTKGnuG07EstfgZ5HqiZbxCTYx7cKulyJi5/wZF\nA3Xh\r\n=BMuq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0343ebd62969f5d4315e249ad81f2837fdbaa096","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.95aff33ee.0","@material/base":"8.0.0-canary.95aff33ee.0","@material/shape":"8.0.0-canary.95aff33ee.0","@material/theme":"8.0.0-canary.95aff33ee.0","@material/animation":"8.0.0-canary.95aff33ee.0","@material/typography":"8.0.0-canary.95aff33ee.0","@material/feature-targeting":"8.0.0-canary.95aff33ee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.95aff33ee.0_1595530092381_0.7962597397312616","host":"s3://npm-registry-packages"}},"8.0.0-canary.9d9f47473.0":{"name":"@material/tooltip","version":"8.0.0-canary.9d9f47473.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.9d9f47473.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"18ece372bc3c44fb5e156b7e24b66989f196f523","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.9d9f47473.0.tgz","fileCount":42,"integrity":"sha512-iReic1goprKycSChjd4iRxRmUU3X4ACzF+ZRDT7XqFl9zCiSzyiuRxyk6BFqqv31ecV/b9Vlaq9gNIxRJ7CCJA==","signatures":[{"sig":"MEYCIQDIozVAu/oBkqT3tonLbvdP4+m0OkiZMob6YgFAbZyIcAIhALUtSC4DnTysTsm0P4nMCFofNj5emjRPQ7gXEVTtk1R0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGewoCRA9TVsSAnZWagAAx50P/Rofip+ddEVQJtVs0viw\n15rMzHMPGKDzxbXYmCaU+bpKwF/YG8eEA8PDLDA2m2HNtqk/UPzx0l9yD2d9\nU2srD00Xfoihta96z7vbczUVR68ZzwNudtjbeyZLSoastFLei4bLOtyQVwi4\nZxTHfLZt6PFIUxn6zCCXF7YoEqrKugJJSZl9nUmgKIYIgwe9TBheqNaZoZAw\nUVi+xt8/sC+5XJR/hninJgEStnzPALwwXOen41EUkSQUHAlFEXgyYtcTlFx7\no7RkDLCJ8ER/B/pbafjmGZ50SL4sTR88TM+lwPeFaGuhkc6SHFjLseO/duv5\nsWAwtysgCfbd78g/gh4XDRvAJc/mu0ib2UMZp5D4lBiKPkU0J/gYZqMW4wwp\na24Qcx5RY/PAOHGPdxmstdUXi1zqXUESac8veB4Gp6EQGT9835ShLM0IbDEh\n2lSHHMfQJ/A/8BzhCMT/uwwq8hUtN+N8NC2QwEaT7XScNs3nxlY4TpORxw6n\n5RKwd+jQRTPAljKCuOSsD2GVjKmcx42HIM1SfqS2m3N3xms/AEGlXPtCTmh5\n5TMccuHg0q2IsjBqCgnynl0mf6GTJS208L80cuB4Hwtx1aImmX2FeIz9nwMa\nsSy/jR1tNVWLKZkLIHSFcvt3/9rkC+RF5uxNGae7NK8qJpvpMjx/XT7gosDW\nieSc\r\n=bpJD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b21be0611a45dd7df8e3b48a3fd0aab09d6cb236","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9d9f47473.0","@material/base":"8.0.0-canary.9d9f47473.0","@material/shape":"8.0.0-canary.9d9f47473.0","@material/theme":"8.0.0-canary.9d9f47473.0","@material/animation":"8.0.0-canary.9d9f47473.0","@material/typography":"8.0.0-canary.9d9f47473.0","@material/feature-targeting":"8.0.0-canary.9d9f47473.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.9d9f47473.0_1595534376141_0.08268030557352857","host":"s3://npm-registry-packages"}},"8.0.0-canary.00dfbf6be.0":{"name":"@material/tooltip","version":"8.0.0-canary.00dfbf6be.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.00dfbf6be.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"537efde4bcc10917a5d19992b423fc510443f3a6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.00dfbf6be.0.tgz","fileCount":42,"integrity":"sha512-N9DRgOtiHYVNt1zgt2zSwBcVeTI2GbK+IjQiM4xPb8UgAkn5Ekg8pq9agbEvvaHLas4cX257MWyjDHG3/8YYDg==","signatures":[{"sig":"MEUCIETSgOccSqFB1EGOynVZxaMbTn7qEQlhejNdI1SefAdcAiEA0vbotD7BNJPsrIKX7/0huRVEH2exUr8hBZqlXPGH8P0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGfpsCRA9TVsSAnZWagAAJYAP/je11A26aPYOeIiuoG1j\nFLFp4RZ8h09pGYFNFAXIfF6/I88EsD8iN9aZXCSjtVchFaMlPI/0oKoOuc++\nls1JaSkxe3YY4ftIgD93pdXEEFOUGpZ6yKARmam2SyxUzpKkSqC39cbVf8eM\nAGpGM5Hz2MHKnhNS/k6sXGqXw8Ja3mD7Ui34YnHwfHroDpG6yeVfz9uRX5TC\ntvBeHV6I6TiI5To9BGJm+bZXHQKbe4JySpjhknnwi5OV0uQ+pp3thJduJawh\nz/MJTjfG6PphMaRwVW7kjdh8nnE3yf/tyx7SkLKG81E3Slqjd2umkPw/nkfC\nDlqKAXSyXk9bq/BxSqL4h+lTubSaxnQ+l1yN0VlclskKSrJd3OcjqR7Ew8RD\nCenqs+KWtjAjF+yX0eWEBhS4cyoEn4C+r3OCeWtlo2UTLBTWcl93qWrKOsxr\nmrDHgJPsmsjocZ3GUjI3CUkOg7BgghreUkXb2J4Sxy4mf/0RSistjw1FnAHj\neESYMDdzDX7YWVsKXzfJMZxWpGGW+bId3mNEgxg5Zkqx4YNExiNZ0m0bqdAA\nODJq+4/Pwymvxg7y39wA0rIs2cIdxskiXccT3RdMnkZWzFGoOHIBgg/BdyMN\naPfrOj/O34mdrYgFRwLnhxNI/pWWLnka2sdL9EUf6AStAeeZb24LjJaFhTa1\nXXVK\r\n=6Q/Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e4a97455c736fab77028e52beabb53323eb60ed3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.00dfbf6be.0","@material/base":"8.0.0-canary.00dfbf6be.0","@material/shape":"8.0.0-canary.00dfbf6be.0","@material/theme":"8.0.0-canary.00dfbf6be.0","@material/animation":"8.0.0-canary.00dfbf6be.0","@material/typography":"8.0.0-canary.00dfbf6be.0","@material/feature-targeting":"8.0.0-canary.00dfbf6be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.00dfbf6be.0_1595538028395_0.3164365988219724","host":"s3://npm-registry-packages"}},"8.0.0-canary.b87e522d2.0":{"name":"@material/tooltip","version":"8.0.0-canary.b87e522d2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.b87e522d2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7dc64487f0cbdcefaf108502720cc4d209c4d0e5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.b87e522d2.0.tgz","fileCount":42,"integrity":"sha512-flg2bX83zpxuSM3GiOKqJcBGebzIIkDn5VILAcAguRhx6uYL4TLOVAirj8mpkfM3eWlPuzFwrh/F1PkMmp3sSw==","signatures":[{"sig":"MEQCIAPyiqNTVPVyElt5iMHk9b+arM5xePrbp7r/7+xLI+Z/AiAZjDqmaDLCpha52ek/sVhy1tAZV9WxpliAwZqM6TTlkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGgAJCRA9TVsSAnZWagAAX+sQAIB5bfk9DXrF1Hlfu29u\nj1r8OtsG37lwx0O/XXw7H5T5qqmRuG+kaiIUUaCK+g2oIm0uaBmXqPH9jB4+\nnSwpn9upyoHoa91ZPgjX9oA0IEkgcHlq4EE2dG/lNt7qFMWmcmHTDoQ6dIiD\nw70vdCecQakiQxQMTGR0dZoK4mXqgrPbVDpWottAIP9lDgidXTfgG+zmwVFr\njX8eG3pOMh/SBJDB0CBdAdhp9oVpO/lG3APP0EZoznQf7IdWM3eZ0jSYJlwV\n/LxgtI1qKhKMDoZHo35igVVgoFpRmJWvSyVfZKeUGGNbKKXCwKyrQnDAFAUb\n4U0EFRcZ8TU5gz/Tjk03V3pUn3WTKhPFOz9fvRm/pkbkQsg5Gd1usN88zQHO\nwsyw1qjj0TLC69ir+NXleOL+15xmFAAX/ImlP0zNByEn4N0Cq3Pfh8lRn/1O\nqxiSt4sSmVjOZv/ru0SQwImr5K1q+nkOLpB2o3cieWGWpjoOJ3yLWyVV9wB8\nEqK2q+AJ39xD8++y5p48DzdWEJnWhZntXXAbMiCpI2N4nAGmQZyXwD8/3jjM\nX515+tAKj32n5lOKd9eTcnD+37UjpL4PMQ/AZgeqRccC+PL2skBWQfjYj1SE\nqa8Y3bUdZ96cTITtkZx8YryobmqBLZDGxCZcFWS7Ox8dfgnO3tf6D6Ntgi3F\ngBnq\r\n=gBxC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c6b4bba75848a4cc1d6ee29d1b67848ff11a8ba6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b87e522d2.0","@material/base":"8.0.0-canary.b87e522d2.0","@material/shape":"8.0.0-canary.b87e522d2.0","@material/theme":"8.0.0-canary.b87e522d2.0","@material/animation":"8.0.0-canary.b87e522d2.0","@material/typography":"8.0.0-canary.b87e522d2.0","@material/feature-targeting":"8.0.0-canary.b87e522d2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.b87e522d2.0_1595539464775_0.6837094093753628","host":"s3://npm-registry-packages"}},"8.0.0-canary.5b3e150e5.0":{"name":"@material/tooltip","version":"8.0.0-canary.5b3e150e5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.5b3e150e5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f5a55ddc56408e98f015b72a862c127c84f0866b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.5b3e150e5.0.tgz","fileCount":42,"integrity":"sha512-5RjWaWFoalb1BIznPeAS3cUwuKVXvIVCvF61ZacxZyEvCvj2LQkzSgjxS5shaNqOW8sxH4Uln/y2UiI4rMEWAg==","signatures":[{"sig":"MEQCIFZieNnfbnFVixH7hBkLyhQt8XaXohxUxV2eZ19UmeNkAiAXomnDcKTQtNrIO8yxz+btKhAsbWwLrsPeLK3VG7an4g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGjhhCRA9TVsSAnZWagAALRYQAKClrM88wZaEfNis10qX\nbVqfvpDNTeoF5IjR0+DsPYChT8xMfFb6wWWbW4RbAQdaOR5wHoMYiwNgFe90\nAMJTmvWCfYPiNhPZyNKANz21Ydlb2rwJfLOV+aKcwhnCSFSrDL+aWrfhZeHV\nsm9bg8M942+f7UMuqa1i05nQHSHMFFn39ls3p2rZ8b2AKx3RO4Eon0ixZAz5\nn+vjXSvc4D0+4qgeCfjG8oNLrFUS4fAi4UYu6ioROxd6MKBaqm2wQbgiBNcb\ncRCI+7Tpe6Q2whsT2f8NJnVXu2U7TykQEMcva71SfveyZAQqllCMRWm54qwi\nB4eJQZehlcmW8M2QG7JC0YGYhm2Enjg2LkBM+E5dvNZacLu+j/341Q0gNzaP\nHwsLN1uI4V2+gm0M5EaO9qgeoxvBEsUBsz7Tt65Oe77prNT+VAJ5LkH/hGF6\nHSuRAfa/vho8x4m50XqnGaixPQiouGAuOwlG/htOL9FSTS+VHOHcsIAw+IPD\nnnL4W55a/3R+G6TrcFMYkpz3oJtmz+1mlmkjzAuBLLVtfCjafWj1DE4MJHZa\npD1J6O/IzFd56Myuer/5JpdH35FYj5ccAXSKnCs8HL+DpHwIehFWsunAejeA\nC4iraYGjLITdS2kC2lXgc42Zk55vBrtmamwhgb87p4CcCU2JrMnpGGcOoMiq\n2hvn\r\n=oFBd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bdcd04000450742ddf94918c2953ff0bbfdfe9cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5b3e150e5.0","@material/base":"8.0.0-canary.5b3e150e5.0","@material/shape":"8.0.0-canary.5b3e150e5.0","@material/theme":"8.0.0-canary.5b3e150e5.0","@material/animation":"8.0.0-canary.5b3e150e5.0","@material/typography":"8.0.0-canary.5b3e150e5.0","@material/feature-targeting":"8.0.0-canary.5b3e150e5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.5b3e150e5.0_1595553889417_0.5495051113773","host":"s3://npm-registry-packages"}},"8.0.0-canary.f0ae11786.0":{"name":"@material/tooltip","version":"8.0.0-canary.f0ae11786.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.f0ae11786.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9064750870001e935f10c2ac6145e480dc5d5eee","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.f0ae11786.0.tgz","fileCount":42,"integrity":"sha512-2JKq3oqz8zmpH1qWnEQt9vXniF4z+C3ocBqKNaKZPreqoGRDG454O516QBoHa/GhWnlMENNinodraN5lsm+4yg==","signatures":[{"sig":"MEUCIAZlfPlaociLIABdlAF/T+U7YhoE0SemX0pLojO1EnSPAiEAsKrAMu8Q7PXGz23Uu/oA5gKa94w1XjmWpx058pHEnf8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGjz6CRA9TVsSAnZWagAApTgP/j25H++OVnaQNVhR77Ad\nkyK9J4qPrdjFXe/koxoXV+s00G3zKUvH+xDMBbUGllHw57IRkd1Nq7QoPJwS\nZKmk0PzA5/tW3fKi9Cxc1QYGn39c4/oZBuJNVN0xymEMtVXa4TPlMKJ0YCWP\nVAxPIEywXzSOJz8FbJanBHH+VG/cKDDpPq9qQoTo/uGIMaYn+SsC8QVYra+p\nlD8PTJifK2FTEhpt0N8919wCAeu118Rz+E9S23jDYGxem46wqULf2L5Ke9ya\n4GWvqYyDZ7nGmR8KjYEsdRacWME3NMhU9mFVkSxyy9XFuOvG/5Sy8jSUKwsk\nTz5eSeT1ypEdfHwc9dvVGlyvWIbj62kEf4gWTtt+GtYKXSvkKYeC2mzeieHF\nTiKB6GjbThZ3IpKxSiBxkOO6P2OMHYOaY+RnHn5qQuOeaZf4UGwiOgJ/cKck\n+IvjKbEkt1xAbH/tMs62sZIB/8a6d64Fz2F30ZI4HyZSLkZTsNyjPs+k4dwG\nHljtjQ7pQvmReV9MzNPr11r0fUmC1VIyGOk8MI8VymkikwGY/+Gm+TTbGKJk\nYaF/ahyLaUkMoVmxYbaGEKPITpQuYqvPEUeQDUAzFua6nRUlMsOk72fje0u3\nvS6W6J/Q50c2JsNnjv3Mi1vRkgkani7lwjlTGXJ382krdtsI5aqu3XiZ8Qi/\nTRGc\r\n=RPjX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2f6df990a3e45b1985740da9e55bce17882e69d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f0ae11786.0","@material/base":"8.0.0-canary.f0ae11786.0","@material/shape":"8.0.0-canary.f0ae11786.0","@material/theme":"8.0.0-canary.f0ae11786.0","@material/animation":"8.0.0-canary.f0ae11786.0","@material/typography":"8.0.0-canary.f0ae11786.0","@material/feature-targeting":"8.0.0-canary.f0ae11786.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.f0ae11786.0_1595555066513_0.5173380236775262","host":"s3://npm-registry-packages"}},"8.0.0-canary.fb4ee66c0.0":{"name":"@material/tooltip","version":"8.0.0-canary.fb4ee66c0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fb4ee66c0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"96bb5cc47903725fc479f1607de9e5d09b6cfaed","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fb4ee66c0.0.tgz","fileCount":42,"integrity":"sha512-KMuv/Hsx+2z4JKwWsahl1DvVKivPlcANdbqlVt4k8rsYf9CgL3l+r+FQSVc94WHWuV7pj2MKacUumP8kBBWxKw==","signatures":[{"sig":"MEYCIQDbCtBgiFKOQcLe+Ut8bjyEj9w6j7ycd0DNrA/IStMo7wIhAJXlIQ+7q3zcE2Fwm7KZwOlE8GSDwcyhSPSef7uQm4C5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGkNUCRA9TVsSAnZWagAAh2MP/jWAF3TuCTVnbwSkF7jY\nQXjVa9rOce4ebpDOoZapMFcxHEQXNI9w3WYscvUzZt0NJJ14psyJHpnsTwjo\nNGwOahmE+cH8z9Vf3zgJn5YMgjM/LiNfbbzC7It1LyUg5GlBLefk3geiWYHE\njW/RAC3itkSzoAtclyIhDUoNAWdy3XOQpsBoip93g9vwykwHMI9l0jLl+wnM\n38xnI9TXD9f9aSdmCDPiYdcBrJoXSlOEoPwMbihjhI7KvFpp3SZJhN1UHa8s\nIqjpSY5wkD0NNkjsQvhDek495IP97Up5H4h6z5ETBk0db0ODsA1WOfUlWNH6\nsUYGsijY2cy2SNWlu9Dm7yzFX/39ntNTgtBITO05Stx+j+3UNCRKyYD58qgk\npSBlM1T9vIvI/pZGHv8uTpAIyCZ7SijS94PLv2GFDIo1Tb2awsLt/Hk1WTVC\nDJFzDDeG47nzGas/YBe7SmCJ7HgHKHRZGYHzLWUZr3BN+lDy/vPcareOu5fO\nLkx7SdT9rIcFxCiu/N03u4XoQBdDqi3GpvStHogF0fRT0MaKwwKxeKC7uaju\nmcfUQ0q9nwaLbAbKz7FJq0CZjGgu+Pbwuwk4V79WSBnZHhydvxdz3X5g7r9f\n9Dwr5zb6A36+5cnV0bn6sLbKwP6/eNy3J3RiCy7DVI7U/NvORCOldM1493Vd\nVbSm\r\n=BOCP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"38a9d8f8bf46aca600cb4ba84272480ece6c67bb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fb4ee66c0.0","@material/base":"8.0.0-canary.fb4ee66c0.0","@material/shape":"8.0.0-canary.fb4ee66c0.0","@material/theme":"8.0.0-canary.fb4ee66c0.0","@material/animation":"8.0.0-canary.fb4ee66c0.0","@material/typography":"8.0.0-canary.fb4ee66c0.0","@material/feature-targeting":"8.0.0-canary.fb4ee66c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fb4ee66c0.0_1595556692226_0.669447155539824","host":"s3://npm-registry-packages"}},"8.0.0-canary.5511e0aeb.0":{"name":"@material/tooltip","version":"8.0.0-canary.5511e0aeb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.5511e0aeb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95a4c8a42605c8c6b80fbf54ce6a512b43ce9a19","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.5511e0aeb.0.tgz","fileCount":42,"integrity":"sha512-8eGJiMvCCWNQuUDY/Jimwwxat+wwjM6+ragROMF8TMHymv2ZEojHl7CIM2/i71fYMfTJuTPSzv9nreY5rN7MIg==","signatures":[{"sig":"MEYCIQDHCfPlPQbFsaTHh1vSeermcYTNqtqLMYyJXNnVPAu+AQIhAKCr5dt5O/q5eNySSCejqLweGANl7KhOV1eaNOocVrV3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGxL/CRA9TVsSAnZWagAAEcYP/1YMX+8gSNt8V3hXSsX4\nyWB1+VmKaL98B/Sq6o7SJcwprmXC0W5pGgKpPc6DAK+5ep1Iq+EGZ/Ubfmlt\n1pgX1ywzr0cygUsmAKr8lfMfTP9OaBQaPW8YB0BmriO3TWxp8likHRd1VLHe\nsekTNQ6SQxyx3+JkUcDgrHyBUTBLuStE/1xdBHWMcennc2QX9DbItqr5+AGb\nRseRZwKkFKpSeszQy+i+Ja2KCVHH7smkpMl3A6BB/Qmsef8SSmTEs2Mi2UMe\nhpR4TrssrGqVyuCyGWdhMq/QY2YrmFxKIn4zbrQkC9M819T5jKBE84745COo\ni3OojsHzc2tz0QCnyaEiikxzwMxSXDygKSxB1YqPEEU4y7S1OAEk8mb7VcG3\noCCblDZ/G10mF+XAlQAgZ4BYKNrv8OE/KWscyeEkcVcdUdrVVWFTyH4rPJs/\n6WaJUbPAHXChXWYSjU652xN9zxpy9GwzVG2co82nEV/gfia6yVDAaEFO/f2m\nMxGizqlL2efGU17nix6XD1Qlz1gzgQ5dMbC5eT1USOs6INSDvs3Uh85TuhK4\nD/u7uNS5hHG4sogUdscD3V2a/7H2nXXvLgZoJNRg/sDqyXWur/UhEDrUsjcH\nQs9OTYGpfrgjyOBXQF/O57aJ/1WCbVzqhk0Gu6Pbci0p/zcNvjdhxL/uzd4n\nBeRF\r\n=pF8W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"dc830dbf81ef9cb796c66b2d35b70355ca46a37e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5511e0aeb.0","@material/base":"8.0.0-canary.5511e0aeb.0","@material/shape":"8.0.0-canary.5511e0aeb.0","@material/theme":"8.0.0-canary.5511e0aeb.0","@material/animation":"8.0.0-canary.5511e0aeb.0","@material/typography":"8.0.0-canary.5511e0aeb.0","@material/feature-targeting":"8.0.0-canary.5511e0aeb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.5511e0aeb.0_1595609854536_0.03880671325504714","host":"s3://npm-registry-packages"}},"8.0.0-canary.8388a9bf6.0":{"name":"@material/tooltip","version":"8.0.0-canary.8388a9bf6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.8388a9bf6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f0b6facb0825de5d44f8910eb40a121a5f8868e1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.8388a9bf6.0.tgz","fileCount":42,"integrity":"sha512-W7+rsRy71mrqkU1KgJjmN0nRvzx+k/i1a8W7pARReKCRjYbLKVpMvGAsvKGl7wCMmnjOI7XyTG04DPvNeMGTzA==","signatures":[{"sig":"MEUCIQColW8maD8uP8q0z4j2R7BGvLfB2I+l04dISmRisgzbhwIgdjovqWoO8UuiNcRZ1HKuC8ngNslGD4/HfaQ8b4SYbHs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG0ETCRA9TVsSAnZWagAA8fkP/RiG7NWM+viB6JpcRZwd\nDxbsFktBWDR2yei7hjN9PrvQe+0s7aI1MHeP6Uj8jMsi0EVGuH21mSXJbPZy\nK1LBOVslPueY8uRGhzA/hGm2/VQut8Kg3Ay/dbXWfEAVqxxdsdsaXc5bDN1C\nkpnC/550LNKOnfbREaTAQ87kRf1XxALHNR5KrbhyAxQiRroIsntZ+xM9luJn\nq5VkUXUgTjMcg2QfzXpuL4gfVdpzpJKKZdbsVMSlEdxsWQHGTUm9vVDqWJ5g\n4ps50j/UaT9sCE2/CdaoNYTadc5vOB9mPiz9nqTjmr8jIqal5Sh1tq9yTITq\nZ/ZjlSEUskHJbvV5W0c+I4dyX3s+wUeExDYDFa6qkv9r8ro05pNfqXZhKybj\ncXuQZtwJXwCM/RdlVyM+JmBbvCgzpURXlZl+KeicQkX8c7qTfRyJaAxCNijS\na5snlEtKH+T5fljrbYsvpC7cc/e0n4NZwN73yznsQ9OdDVOvTQOAmdn2Ggu6\nINOO00OVzPVnQe4kCeIJN+tR0BuWjQbg7OTYsnwhl3bwH+ftJJWO+NFh5vHI\ncLewu7CtrWmky5SNS6FefT25/dk6wWmxCLJ+9Ek/Hd4Lg7tR7blGO714b1fb\naTJVWFIEkOpL8FZquembRcKCksjbqE/8VMwLg9K2oAixEn+gyt8tbNWd5KNh\nfE3y\r\n=H2oz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f2188ad8c46b8f947761bceed0fcdfd08019e97f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.8388a9bf6.0","@material/base":"8.0.0-canary.8388a9bf6.0","@material/shape":"8.0.0-canary.8388a9bf6.0","@material/theme":"8.0.0-canary.8388a9bf6.0","@material/animation":"8.0.0-canary.8388a9bf6.0","@material/typography":"8.0.0-canary.8388a9bf6.0","@material/feature-targeting":"8.0.0-canary.8388a9bf6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.8388a9bf6.0_1595621651310_0.11161666257875424","host":"s3://npm-registry-packages"}},"8.0.0-canary.ac405eae1.0":{"name":"@material/tooltip","version":"8.0.0-canary.ac405eae1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.ac405eae1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"59417504ce6be12f0f5cdf451c13ddf85b0bcfcb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.ac405eae1.0.tgz","fileCount":42,"integrity":"sha512-5WMU9POVtX390M0rg5kgOkr/dV4Q+h9KScKeui4SX2JzdTSLeOmGBVnSXKw0siWIPxqRu0x76TEhZq2PXRkrag==","signatures":[{"sig":"MEUCIQCGsOYNgdJjEKC7DolsY4fsDt/uLyy8ftY/h7NOtiBCNQIgMMiQhuoqf+k1HduAX8HfmOjlnoWtrX25y5NMOmuqedY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHu2oCRA9TVsSAnZWagAAdZMP/juP5W/6rJggc1yFuUSk\nhh7sdWTdLnKaLHZfqFf4EYe/xirt1rlSbBmv9CWCVn3woHu89x9aXh7pIzHD\nXMZE4k+6hIRlonJBNfwSM6QCJIQxXO/Dk2K4HP2Wk+npZjxqtbxwbm3DiSAZ\nyY71RWWeit0zileba3Xcl/qPUF51hkQ7K/fHxaeXXb+Xd3mAg25spWQ6dfRx\nG0uTTxxgjKln+rM6aWh1HaztgBFUe4VDKrRZCZKMjPZW0hfOPxQaGrwHeDY5\n0FHvsRaOZRjmtCXVHOYJqYqPjaxgXVV8/Em465CuBQYV52fkFGVoOKdW9gE0\nGG6aBY7WXlYcqp4IpF8YAJo+XYB1rjDIGFb3VsrWNVPqtjYrpfpu7d4uu6cG\n5W2z+cbE0JdVpHllUWQbCo2aBwwyUNq2jwbjvfdR5aM423GuYvLSkuii5Zzn\nHkop+BuHvJ+miTOVEL7PMRxXAw0v45JtU6jPS5EYnWenirwgDpN3VCOdAhtp\nOpMvJKQO8vbNozX/m+LZN9I/Z109fzFMJMZa4QAaJk3tD8ps7DUDsomPpjwE\naemjwnF3gtVJf2nB6GB2I3JMmhIIrWt+IzQtGc1u4+EDLqcd70mH/2L2pVca\nLn6GGkIvIV5x9rBvL2jkblD4yVOUfFYGAHq9+o/Mv+9aJ++ViKlZML7fA9E2\nz1Vw\r\n=OAM+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c4f229736a36f17b97137adbdd4b59901eeac852","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ac405eae1.0","@material/base":"8.0.0-canary.ac405eae1.0","@material/shape":"8.0.0-canary.ac405eae1.0","@material/theme":"8.0.0-canary.ac405eae1.0","@material/animation":"8.0.0-canary.ac405eae1.0","@material/typography":"8.0.0-canary.ac405eae1.0","@material/feature-targeting":"8.0.0-canary.ac405eae1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.ac405eae1.0_1595862439837_0.6381870160827836","host":"s3://npm-registry-packages"}},"8.0.0-canary.75553837c.0":{"name":"@material/tooltip","version":"8.0.0-canary.75553837c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.75553837c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36d4e963f58f0755920e11ebbddd2bd2ddfdc834","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.75553837c.0.tgz","fileCount":42,"integrity":"sha512-FUr/2oKf9pEOeeREII0LGULSoYwqnT9ZGY+dWVORYgsNeOoG2qTjzhXjNirBw3OiPEBya3hmepTEb6F0Ts2mhw==","signatures":[{"sig":"MEYCIQD72cIZV5D3+das7BrVPkj+ggZUgYPw0chQnnUYtlQdGAIhAIi5vRgk7FRJCJRe8BOiV30e78jdjALtdzTl2wj2D5Iq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHu8KCRA9TVsSAnZWagAAL94P/0KyxZ0h4heTQjh6/hj2\nTs/T15mKL4x19cZqILimZW7qP2mx/o75fvZaePoQvCorg66Y7ySZJP2b51Mp\nunmA28OT5GwqMtGm/a7Cn1N5Ov+N1nA0nMU0SzQ5cvA/SLio+uTYVh6BCkKW\nmBAdYLMEkkTmo0rqXuU2D2G9H1ZujjOybsUNo2vpW0hvMp4zp2fV0NBripx0\nYeDvtCSKIl5gwXxmPOaiWImcsYYnCQ7hwrQTIbyToNyV+KauRt8xImuULemu\nhOKXNU/dWsLkXRIKdY5kdjcqQ891yg2YW/y6XyhkBGny64wkfN3EswM74UrF\n5Dypo0yyttwU9ZtTQTQDBp5uLhGTAAM89o6E5LS7kFr1UruYLSO7V7Y4Dp8G\nnhzLEzL/v5Vx2KAr3NKLK94I+1hjIcfMM2nYNrLWT4jVfFKcNJLAhNoinOFy\nHVtosKyWCc9TQbceX0TWF0QxLWIlgq0lMbCUTKIQoBI2yPv2GeANa6XQ5vlL\nVasB4SJuK3VhNpc21YUrYZeLGm84NGtsw2QftWOT6PysyCKKBtt6SUSloZTU\nCxUKYv1YCOfudYw+XhdcBahlitvo4Xk388kFOFg0RI+eY+u9cQQZ82elBy37\n+olG/moTY8jgvlnnopctLJR4r2W/kRBMIQB2HiUZTer6e4kcbR/bLTTzbcv/\n9mGg\r\n=qQj5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"18c0e52ebb63979ca614d6df13d96e2c1cc93216","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.75553837c.0","@material/base":"8.0.0-canary.75553837c.0","@material/shape":"8.0.0-canary.75553837c.0","@material/theme":"8.0.0-canary.75553837c.0","@material/animation":"8.0.0-canary.75553837c.0","@material/typography":"8.0.0-canary.75553837c.0","@material/feature-targeting":"8.0.0-canary.75553837c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.75553837c.0_1595862794266_0.0679716004822346","host":"s3://npm-registry-packages"}},"8.0.0-canary.b96fbfc7a.0":{"name":"@material/tooltip","version":"8.0.0-canary.b96fbfc7a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.b96fbfc7a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9bb031d8e5811ba87948d63536aff8ba6b51ea97","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.b96fbfc7a.0.tgz","fileCount":42,"integrity":"sha512-5TqkKBEiga1mi+FKMYKRYzqEk5V8APytwKQl+JxnZZoMrIICAjKdxET6saOTG0aeSHXXwjDWXGqozpxwheUUjg==","signatures":[{"sig":"MEYCIQDYSyhvsDoGemKPh+g/R3uGOQaUt68gwI4JERxUBY+llQIhAJc6ClKw1QHvw58rjkAEBTREITNhW+ZtbqWvbVMv4SlW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":355326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHvUMCRA9TVsSAnZWagAAkKUP/0EFguK927xF2Ebqqfj0\nsjgMDy/+7nd++QU3uTxAfdmh4jCNmPbQFQn/A/uo/U/+5LxdTcxX21FCGLFb\nI0ITRe9K7zAnRG3JLtfPooMkHzrVJnDxat0LjHq0lsDfeg7rJN/K9kATxRCG\nyLxAAlebID0BSseJAzCTHaZgOKqDLMjiYgTvyvZbam81bIjWyUeQuWUoxypR\nbVctEZsoiHf49MWb43jYzn7DW/ArxHocYHmBA6RzkFEEREniMRXP8r5CyCkH\nOpTF2rI3SUwCYyUkNiUC6ZKW6fmnFuvvmxCXmRt735L6BswRnsdXYsfIlRvP\nFnwW1mbzKohrovDWPgi5TW+3HUXdjSxSDzj7dhWigifZRqUjJWezNio/A5sB\nb8PEhpXcT71ACzAyzqY6YzbM6pGKuUtZ6YulgTM06mtI4E4FSgrzvuSrIU5l\nj0dBmQ3dGZNbgEdIA6wxkRCe31oaC6pvhxUowskBZUpa3dCY+rcbWxBBW5XG\nPqm47zNg2DUkVbFP5gdRfmKNB7VUwbxfZX9fl0ptiOgs1M70c6Wm6T9eoh/3\nW3HWIC3fRk5bWVvp5SL9VzU04I8+ym49lBCcCL8n+x2Gi2ZslnNoFwL28v6a\nXcIYnxURjwHpmhVAro8m25CIgE57lMo8o2yR5O+yvxj6lc6RqVcnvGpy4rL8\nxUe5\r\n=kVDN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0e9c13ddacae3f3bc09bd4f168d276110fb5677e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b96fbfc7a.0","@material/base":"8.0.0-canary.b96fbfc7a.0","@material/shape":"8.0.0-canary.b96fbfc7a.0","@material/theme":"8.0.0-canary.b96fbfc7a.0","@material/animation":"8.0.0-canary.b96fbfc7a.0","@material/typography":"8.0.0-canary.b96fbfc7a.0","@material/feature-targeting":"8.0.0-canary.b96fbfc7a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.b96fbfc7a.0_1595864331888_0.8869418432991316","host":"s3://npm-registry-packages"}},"8.0.0-canary.61f1a8d85.0":{"name":"@material/tooltip","version":"8.0.0-canary.61f1a8d85.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.61f1a8d85.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2ab70ee93e0067bb7d067e82b87a7d1c5b92826b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.61f1a8d85.0.tgz","fileCount":42,"integrity":"sha512-qF5R8zUDFcBLDtDiLCFWuTlKXj3Jy3Aa4V3hiqZxzmrLaNOEKzp7W6CqTr2MyzEbiLXI6hOKFTUW8jE0pYwfrQ==","signatures":[{"sig":"MEUCIQCH3J/Kuztsg+2e99CAbxOWyLDPe7QgViGWknFERF3qaAIgIUhSp29OA+KYIN005dJPYc54q8PiNCNBNTq2xAfmfDQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":364816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHvcvCRA9TVsSAnZWagAA+y8P/jnHZX5tDLNE2ofY5YyI\nDqCAdTiSLykuKPN3D2uI7uSmQEwnZVVdEO0v7RyPiu80H3fd8Nb4x0edbc8s\n1xN4V7sZLC+M3qR/k4030rPYV8wTewF1r0cMzHVKwUPcCydwCgNtPDs5VqaU\n8mSg+YDYt/TOrwk+4EmbpBz6A28P4vyztaDbZyuj9d/u813g7raUw4keluLT\n/XTav6VUQ1mcCd4nDh+xOOiMXMjL1zxPD/6cLpcemeiBFnyWs41Pd2tWc9ac\nlCIL7lCNzRgLzwJWYiqsBoyhrvDUjoK8tY+CJImX/kWW/0OIdJ9of6FjNCBP\nlkxedy2D7nuBSLEknW6t+uAzV0vUmAFthRojBus/GlYnGOrryl/b2nkDwd1w\nfK0grCTZYXP1lGWiGMDw02N9Xhv+NtW8AtDvNA2qNSTThDpeBq3T3wQRNXWk\nYEUQ90IZMqlpTNfADtfOfOSyI+wSFhGGz3vJIztJmcJrxXIdSl+HR7m2VSG2\nMifKqPNwQbJzm5oLut9oWr/8F2OSB8lufbF24TzzjIvZcJa59MqrNcqPzcFG\nNFvyHEC0ma6Jf5eK3ohGEcdE9nRH50ip7PfZBg20lUDLhKFbzwK/eBAfIwqv\nUXSbRVPUKZ2YPPQct5hwVglmkciW7YeXuaY2pcm6QQiwi6Ebxc6ZeCRU/RtS\nuc82\r\n=oS2I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"71b0bdc987ed1b1b5ad827abc78149cd4efadb89","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.61f1a8d85.0","@material/base":"8.0.0-canary.61f1a8d85.0","@material/shape":"8.0.0-canary.61f1a8d85.0","@material/theme":"8.0.0-canary.61f1a8d85.0","@material/animation":"8.0.0-canary.61f1a8d85.0","@material/typography":"8.0.0-canary.61f1a8d85.0","@material/feature-targeting":"8.0.0-canary.61f1a8d85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.61f1a8d85.0_1595864879103_0.0640720080794892","host":"s3://npm-registry-packages"}},"8.0.0-canary.81dc33377.0":{"name":"@material/tooltip","version":"8.0.0-canary.81dc33377.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.81dc33377.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"249e2c3eccdc47a86e57495306232f8375650cf9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.81dc33377.0.tgz","fileCount":42,"integrity":"sha512-5jiSk20CpSqYIEyauvORtsZRtxJkiG64nBoq/Vrx+8xrubkY7z8kMWx2TcaEXRV/Hj8KJvDC6MoJX19CEpMX3Q==","signatures":[{"sig":"MEYCIQDOWpSxfeXMNIPyTzyn+5pjzajnQ/jDK1md6sUqS9QtWQIhAKADX46FbTDmjJhQRlTD0OL05tQP9IXmXaVhhVBe5OEi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":364816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHvoDCRA9TVsSAnZWagAA0i8P/3MA6XJXe83mqoQIS/Rk\nQU7lR1QLEfmu/2QVs/R7gompSXxwyoRyQDQQ7gzg7kYrXJpXVE97xetwltOu\nQsvB36JrCAK2irGH+Y4mD7SKBfoi2ogPMo9d4nKQIUhNO0i8OgI4PxA6uoka\nVAQrmToReS1Wpoyq+uHoxaJuW36SWJOVgCh/56DnyJAQlMtgyZTkffBE67/R\nvA3v0Vlsf5YZcyYtTmc0R7EcLGvAkDW3/xfsc9Tq6P0btPg+lNq1LLwyS+lO\nPcRTD3DGb+K1CiGy1JNPOTUH8DyorSGVR1d+2VNp+7jFrRfQe1E8pcuXwnw6\ne/z1LSelnrN025r2w/tcA6BU81GyS47oytaEVWAgJDFcpsQZ+NdbjLTR+J4U\n+MooaytifUHns+TfioG2n9JZAz5b50WWzO3ega1zgF4GsTvgciIfgs/ak5cA\nuT1M8tUcWI+sF65+Y9wO9GXIw23uOXS9UIT0fjOWm79GYPVNW1sYtT2UhH15\nARvU4ftFRKlEz4LKmY/bHj4wze2SesB4jr9dBbptkTFcoGq4g0KiBf3LooHq\ngp3fGVuMFr0ZnITgUkUvlQx69A4wknTDp9w0i/CwE0BJVu3Sx8JSNfdabFv6\n7ux2a3K3NMaoKJDK1DOOa2VqGnmmXqk9vKx3k4sU5f5d9RbXLOc/j8kQ4T4B\ne3O+\r\n=EBM/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"14e4858d309a20ecb69620f07c8f427bda0821ad","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.81dc33377.0","@material/base":"8.0.0-canary.81dc33377.0","@material/shape":"8.0.0-canary.81dc33377.0","@material/theme":"8.0.0-canary.81dc33377.0","@material/animation":"8.0.0-canary.81dc33377.0","@material/typography":"8.0.0-canary.81dc33377.0","@material/feature-targeting":"8.0.0-canary.81dc33377.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.81dc33377.0_1595865602651_0.9858870130266693","host":"s3://npm-registry-packages"}},"8.0.0-canary.ffd9ede58.0":{"name":"@material/tooltip","version":"8.0.0-canary.ffd9ede58.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.ffd9ede58.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"120b0700866db4d7df41e57c833718adeda91e43","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.ffd9ede58.0.tgz","fileCount":42,"integrity":"sha512-m4mCKeOFJlAPQq4fPKwrfkxrVwOOk3YlmK0nzgzdVPfQbyJthWZTvYxKpOB6Xjwgfk7srGp2eIU0yCOLK3TqMA==","signatures":[{"sig":"MEUCIAnhAPUvtXjR85QVlMFF17lFtwXm0+x3W6OSjFxRTrdBAiEAxFrvjU+JXTHc6kked1x4YlljP59Rc8zk0sXcYuW3nRE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":364816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHwHWCRA9TVsSAnZWagAAlGwP/RryhOwlYBopuV8iWSQG\nLxdqF6UZAcZpufvk1DhkJAaS+3s3vz9UbwItBOEOt7NZEr2pb5MddvbGYXuf\n1JSQbyWbYzw3oglHSmBLNsLKMxg45IB2Ksr8zB6U405zMEJfmGxQl7Rb8/+7\nCSoSKkUZgXV11SS1jcIU1/l0ncFQNzVSLrGb8JllHAC+XmwppJcobHEvccLs\nmEeWJ3ujRU4bTgK349R/0EFSYvIEasR5x2yv3Kb184I1Db28RsD0yS1ewUGo\nehK+PTHInqA1g7qMW/ug/vJ/q2VgSyhUvzyQDBg7O3w9m9AUPp8rDdp+EeK2\n9yGBcpjYNGzRRTMs1pPth+U3jkBoeZPtQqbb3E7rJl2OOBnPCxGo6M+quzV2\nW/PrPoT02eiZZqzp4oJqJXBclNwuYHT34Y5a7Yv2/OsN+d/NAX7cWZcAyBZu\ntNJTXT1TpFEOBnMYqUNEG1wPlzyXqW0cTl00LB8ofrCIWj+5LKeUpAOpUFjp\nhPPFaBRuNp9PRDMvpK4Ntg3uOX/mnOuSomXY9A1hY3v0qcJT4O9SHGGblcG+\nhU1uzDBJjIboChpBk3m4op8Yv4ORtxgG1f6FzsJXp2yflHt7mfei9/mXGpKo\nopgnjmf60pmXsEt0C6lunXY9xzciEW1GJ6d6mdphJzjepCoNC7HL0zm+qsnK\ns7gN\r\n=Yf8N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8a029ef9963cd4799ffbf7dd03908a696d110f7f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ffd9ede58.0","@material/base":"8.0.0-canary.ffd9ede58.0","@material/shape":"8.0.0-canary.ffd9ede58.0","@material/theme":"8.0.0-canary.ffd9ede58.0","@material/animation":"8.0.0-canary.ffd9ede58.0","@material/typography":"8.0.0-canary.ffd9ede58.0","@material/feature-targeting":"8.0.0-canary.ffd9ede58.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.ffd9ede58.0_1595867606310_0.9119497644317849","host":"s3://npm-registry-packages"}},"8.0.0-canary.52dc55acf.0":{"name":"@material/tooltip","version":"8.0.0-canary.52dc55acf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.52dc55acf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dcec2512ea98b112a4a7f775e547fc11bfb7d212","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.52dc55acf.0.tgz","fileCount":42,"integrity":"sha512-9TL8u6TqHEms3guyiDsx49JEFa9BWEuihGurC4lB+Roc4pnaaqLPv0mNzeZVKWpBeM0ij98XAi9pU5cuiluccw==","signatures":[{"sig":"MEYCIQDnEE6ivc4y6XkwR7TGZfywfb5KFMk5wIt4nbK4YPefGgIhANrK8kGSh2lrZVdDRHIHOfZsY5MQVBDlZM4G3Ld3Gxia","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":364816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHwpDCRA9TVsSAnZWagAAGC0QAJeJs02C2rfyE2ceP0Le\nykYLLRkv6Law9BWJCGQhJyS736/g5HE494XUEcrkPDf+148NQxp/lfvL8hJN\n9/CiopLQuG0HgJFLtO4DOVqzjnfW/3UpQc8SCqJ/lZkuet0JdgJwp8DkW1om\nU34Xhxiq6PGUhlosR5POftj1OxdvunkC2vrZU811hF1/MfFSL7gSmWpsqgJr\nhsXSIjPbSy/j5oG2JmtjLFv6AQ3no/m7h5cOsYKwFx5KtsX01+hubhmIMgaE\nLQ4yM8zsGnKKmJO2GiU5T+OvmmLVv0S8cmZ8fgpkDdYBI1SBlOntt0khc0aD\nMcPiZEDmDsnl/pNI+xuzgc+MaP1559GuKQVCWAJLHqrC7fXtYxfB1AALlZ5g\nAOdmQiRz6AYuvolgfgTNFTxwGCU5lLI9Q0njbUHMCVyiZjjF/dgrrtKs8YVn\n/rrk6I3cTNm/GX6L15I2CV9xiHCz7d/tIruYhhv1+/ZhnYZ+cSmhhu++rZwF\nVwIuifNqAAtSuwJHCNeyIlWZ6LLS2d8bcDVbknxIpPKaoGQwtRledE7NRxCD\nKuSiVLQ/+VmrBXHJMM2OpMPs+DqnwVbT+oERcarfaW0sjfrcMf+QdN1UW+/I\nHx5l7g6viXJzYgcrzkMTKXN171PwofRm60+hfsEAOayd5Fqj4F3Gt983v/2A\n4AoO\r\n=yAMO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b5253c9af3b0721aeb0cd096ac48b4c113801757","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.52dc55acf.0","@material/base":"8.0.0-canary.52dc55acf.0","@material/shape":"8.0.0-canary.52dc55acf.0","@material/theme":"8.0.0-canary.52dc55acf.0","@material/animation":"8.0.0-canary.52dc55acf.0","@material/typography":"8.0.0-canary.52dc55acf.0","@material/feature-targeting":"8.0.0-canary.52dc55acf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.52dc55acf.0_1595869762659_0.2332976307248671","host":"s3://npm-registry-packages"}},"8.0.0-canary.d4274ff05.0":{"name":"@material/tooltip","version":"8.0.0-canary.d4274ff05.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.d4274ff05.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b18c678550bfaa191e98c7598435ea122fe8355d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.d4274ff05.0.tgz","fileCount":42,"integrity":"sha512-QnyvzSoUQ2kpwGGDAi37YT4jhnVZExkuAN1Zf6B+OgdckBSp8MW2HuPs3+TY4KopjUS2ny5liefEIiRQOPsoOw==","signatures":[{"sig":"MEUCIH2vdRIQoYe2BWPInI67NlZ54iTpoz+WvzXvNFcSEQuDAiEAh4/uHoKVdUVwcABXy5v5ubx4wN21HVe6+g1tTGlzcfM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":364816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHzA1CRA9TVsSAnZWagAAU8YP/RK+7l4OCZO2IOI+98dU\nbb6sd89FPxiz8aXPhDe+NLWF5ge1EkbeqAv0aU9tncqiSbXr4+J6s1ER0+uU\nVQC0bq1Xl8l/MDUfkuyQQu+2VkIofjPPOYTL8VCBvMeHGo9kHIbqFVLtlBb2\nRNnOuAkAQfN41xdEAz9qwQRHoAuQtf6bMr6DEkN3TjBugHzjmruayhOxQI/1\nnn8Z8UZcZs/J2p/5spMgVnk6/DLhz/A5uSDLGcEQvNghcyBXlxgEMAsZ+bpD\nzSUJ8qZa6CucLZ0VchC85h2SyKiG0bNi6DFfPtcpn8lUfqjELWZKFz7ntXEU\nCEJxwiWVUibg50YsRweJAxT4HDFxippKuBiIscoewRDnYs/J5ayPebPmBz8K\nJo8hF9+amGXqAMvFxlpMuXDr1HatTGhIiJWt81DZ7QA81jwiqBTVb35jy8dh\nWrmzAZe0aN3xqDCO5d+iXLjoERUAYVgHuBuaNeXurcZY5IgLCbipsTQF0dQ3\n93CwYjxWPtS0fiw1iTgfQZboeU+dnbazVslqtflEbHjp/YLYrh1YA8AQvGCB\n1khKnV4QmO8SyMwzgehT3jImLtlmDmUxfeDD9CqPCrvyb/kZMAPkxTiXAZJL\nXhe2/fZacWwiFu1XN5oO0PEA5yLql9uudu6XkqQoZ8CBMOi+XiC8+SuejT2x\nvHRk\r\n=RuMw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b4607e708cfd7069d540b1fd6042775c4599855e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d4274ff05.0","@material/base":"8.0.0-canary.d4274ff05.0","@material/shape":"8.0.0-canary.d4274ff05.0","@material/theme":"8.0.0-canary.d4274ff05.0","@material/animation":"8.0.0-canary.d4274ff05.0","@material/typography":"8.0.0-canary.d4274ff05.0","@material/feature-targeting":"8.0.0-canary.d4274ff05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.d4274ff05.0_1595879477174_0.2732608493515227","host":"s3://npm-registry-packages"}},"8.0.0-canary.b82d0696d.0":{"name":"@material/tooltip","version":"8.0.0-canary.b82d0696d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.b82d0696d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c6c13c0dce93fafcc904f7a24aa14fa5d530153d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.b82d0696d.0.tgz","fileCount":42,"integrity":"sha512-KZtf9FohNFCtoc1vmeTKffCISjgPO+WBFZCO9i88MQDdWHJDW1A6UK4nktWa006T0cqOPbHtHxvnfw5pz5kkWA==","signatures":[{"sig":"MEQCIELV1xY7+Ag+WDqNHTTywDA7KKozohvk1xYjNh/vjCYxAiACkzabUoty66gk7Ujd8kCLMYAtu7N0cHk/qDT3h9j7GQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":364816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHzIBCRA9TVsSAnZWagAAYGsP/jOM5X5p4YYwgVpfmORl\nVKg01u0KDlCXn2RaR2D1rfPm/vtlOmEdkrbqrhEyljr50e5aVrVAhXYdTfVl\nVK4bZfEM/DCMmdW8NjI2SereFoUYcNt9/kIo1PMLNyT0sXI42z0DnxLgOZEA\ni2ywLxInYSL6KoHk4kB48sRqMeyAxCa2k2OEn8OvdMqgAFwEoFBFJqCckhfB\nsvxtGclJ2bXZ0uelvCUKgdBQvBC1i2tahUtG6SFLC7/iFCVrpBQw0i8YS0K0\nb8kABxaXGRCRgxHaWvDq4QYZZ+25bmcyGRmDjG1wO6uQwyQmK4tbeXu1hOXy\nmmIz4JsxT+qReldN8Mw6iNZh5xrJ6uHfe0/ajYXQApro2OcVCEUatnM7d3zQ\n6Ajm0pZ9GoXSMfdzMLOjzDKb+eE1HsCDc3HgIrsM9m/aB/C1gDT4cfnEZ80D\nc8dSJD5LaZWWFd9WzhSHx3jdn+HxhkhjXqfsDN2SqeiUwl8NWHxkalTGV++O\nSIdbIbyzdO8Nnxa6NN8MA0gRePiodmCP/dhOkyEGnc7Z5ug5Ru6JzdEPWdlb\n+hUvq2hhtHnC8qojKu1twLMrqBlPGlW5w/5t6oSI0gpFOu8xdAwgmUGLx4kJ\nFlgdB7XTw1bmYo5SiB6omDKY/WoYexJSN5EaCGvIN6cXmLdmIKtVrMIdOUbg\nPrPb\r\n=KRNE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"914e71226c9aee0625b5bd1fff56b887e3c924d7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b82d0696d.0","@material/base":"8.0.0-canary.b82d0696d.0","@material/shape":"8.0.0-canary.b82d0696d.0","@material/theme":"8.0.0-canary.b82d0696d.0","@material/animation":"8.0.0-canary.b82d0696d.0","@material/typography":"8.0.0-canary.b82d0696d.0","@material/feature-targeting":"8.0.0-canary.b82d0696d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.b82d0696d.0_1595879936752_0.6591872383598114","host":"s3://npm-registry-packages"}},"8.0.0-canary.c2852000d.0":{"name":"@material/tooltip","version":"8.0.0-canary.c2852000d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.c2852000d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d9a385c392de5a688c7e081813627606598ce784","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.c2852000d.0.tgz","fileCount":42,"integrity":"sha512-6Ammyh9bnndy/sLCFa/WDvlkKg1ZmzMorsQpfe94xUpH/MjYaS8scSP0F2+p/Sjnd+Lfo+VHjr06smrcCfQUfg==","signatures":[{"sig":"MEYCIQCBI57sZlV1MROQ3tG8ndFcf9gP9wwG7zKqSagGCQCBqgIhAOpnTI07NM8mt6mECF+YR5XkKG6X2k93uJv0PSLHGGEa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":365203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH0AgCRA9TVsSAnZWagAAxPkQAItrA0RrsvXTPdUH2gYH\nnxJIZT2o4m4qrMXFudPyFf20733u6qxAimAPUx1WiO8KiWMj+MiERcA5EtLn\nVp14B7JG98ww6lR/kndEbPnEyy9KYQul13IoRBQS0uLVzbDpSZdyATUzqCmj\nqiPUzgG4wT6XMlu3UXD6yVWkutfZh49eJHrKZGYoApAH4SSb0CvdfIMcqcPr\noJU/+XbpbSYS/sdrPyM7PR4yQ9jopkJinVgMPhY/zL6nU1LBBC+UN6qRFBWs\nH/NRzS/gPEUP9V+hRBH3qG1d+P6+sK+ClT7yW7pJxTXQqHujAiotMdZSFXH3\nkNCHfqjBjI7qUujfRP6RFKRiPgjrcuxZtlxTFuZZ1hV14GUxQ/r14Jws3wum\nVuaHB0xodyJw5H5PNVf9II+LffM/WhvyOpHnkuKTKn7jQkT5ftEr1fj4tJmB\nBiebx9BIbWLRz5mbOJXGl9FTHRznkx7geDhYcL4WOzRQPi3IPZLufVGyGMiI\nignoSTX4DW/CvGf2C1eK7FGOFekVfoGPJJIrWMjUT5UeaxkkAMfNXEfnXCqx\ntsmswi7dD51lJmQDHVIHUjmXCfrdx5BaJlp4/DQbWmFkchBL1ZfLQ2Q1mRJu\nBUFlK2Li8LWSXGB/T2gUv+k3DlZ1G+1lWgUZ5RjYcGf695LeqO0EZ2rhpfQl\nktwS\r\n=lApO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"53080ff99f83ab326fefffad16cd09e449e79f27","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c2852000d.0","@material/base":"8.0.0-canary.c2852000d.0","@material/shape":"8.0.0-canary.c2852000d.0","@material/theme":"8.0.0-canary.c2852000d.0","@material/animation":"8.0.0-canary.c2852000d.0","@material/typography":"8.0.0-canary.c2852000d.0","@material/feature-targeting":"8.0.0-canary.c2852000d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.c2852000d.0_1595883552187_0.27040517847727186","host":"s3://npm-registry-packages"}},"8.0.0-canary.f86f83f54.0":{"name":"@material/tooltip","version":"8.0.0-canary.f86f83f54.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.f86f83f54.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7478da20f8c6c680c7c0dfac86944e14a10fd03c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.f86f83f54.0.tgz","fileCount":42,"integrity":"sha512-nyP2QFxNu5XsTVyFWXndzpQ1E9E1UzYTX3gjPXGYdsYOFRFP4rjl20NACIet4DqGItNA/EiPuMtMINcM3Ks4Rg==","signatures":[{"sig":"MEUCIDxxMx0W2OjSK6Ul4GwlfK92I146w190QJrsbw0WD4+xAiEAitHidIFLJW51kCi1gIaGucGEc1cICyG6iyEdIqAVi3o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":366257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH00sCRA9TVsSAnZWagAApswQAKJTsOj9BZY7jYnkdHbi\ny4Hr4cBq5/f859XoVq+4g1gQCa5hKCgcLUVH1QQYOnYyb9wmjWv494QNE4wW\nF03ROHLhF+Yclh5ANvi/kKlxfJupUHYcCPgYGbCi4Fv4d7fkvHMEvcaIm5Y4\n4qAXYv8M/Z9cCq8o9YWNfV8MIbLD5/iRJbkRn7lwY/lOrG9D3P0HclTIFN0m\nLCt1cH5CvqglJSFrG+pw4wIJhYcNnZzIPq9yUNamQP3y9n4fasFcVhegA4qO\nUX5MTf01isZOkRCPgbAX2DJeK/0G/AcbA/BPTYNBs45eCIJjWUHqKZWRqotD\nY3weFe3jdTxM5XrS/6PWLF90llrtKo/+jUb6as46MrVlboeuk9gBZ4h4lOuf\ndobObOhz3+nPM3Cz92rQy55tXrwQng/UFJmYX+O9i5c+2ZONj+1gdG7F3/Un\nldChV7jKXqdyRy5eRBE9L1wV0k2h0ERGCAdxaqIqpHmtecmkTEs7Q9PPut4V\nrC4BLHUbd9ceBDWF2XCcaAqurd3EXbITcrpSzvFlhc80ItEJCVv+UKCQcIv9\nHz3kd5hPvqdTxX7HnzYeYwHo6tnRbCAYy8BgPB+puiT/3V6Zq4kePdSclawF\n4d+ajImP7MHn77/dxBf8Dn60hIvBRFxwzJEsuTCWUauwa2AVPvhlApRlC1VS\nrHBc\r\n=qxYR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3c8abc334934dd33ace7aec681868717a4e26d0b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f86f83f54.0","@material/base":"8.0.0-canary.f86f83f54.0","@material/shape":"8.0.0-canary.f86f83f54.0","@material/theme":"8.0.0-canary.f86f83f54.0","@material/animation":"8.0.0-canary.f86f83f54.0","@material/typography":"8.0.0-canary.f86f83f54.0","@material/feature-targeting":"8.0.0-canary.f86f83f54.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.f86f83f54.0_1595886891821_0.3147027150870825","host":"s3://npm-registry-packages"}},"8.0.0-canary.41eb1684c.0":{"name":"@material/tooltip","version":"8.0.0-canary.41eb1684c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.41eb1684c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"098f52179c12a70184b13db110e5566c5005c266","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.41eb1684c.0.tgz","fileCount":42,"integrity":"sha512-l5/sLRp6rTt89ZTwEWFQAFe214+b4R+JO4IIswDapHVnTjqFVp9FygbTl0pqtF0YbJpQNH3+PhnIypYyT4Q+fw==","signatures":[{"sig":"MEUCIQCDTUJrmNyDyo0cFhiOokZ1lPcNOKc3b3g4w3dZQa1LRQIgL4/qGCfqhOOR8Iag+tn72ACXyZzJaPWxLZTwl/OVScI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":366257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIGWXCRA9TVsSAnZWagAASjcP/3jROC0YwJGD6vab+Ye+\nZ1Lssi7CGJapAtFyeSdRJvBr7q9JqFpQMVgjW2opNLL2X5L8NaNfLHjX17Nn\n68Hf/Lc6RznnHDkYLam955uVQ0mPT7EwTto5RfjxOEfDP21167SQvgsfwW+J\neSRI4VeF7n1xt7+IhXAT9kOdsiaJWnvt+qVmLFTCbMl105TyiNtA6nh7/bAI\nO2ryWJ4i45wtzkUEPYPZ6jZfhltVEDEWiu6lYO6A8Q3/NGb2PHLZz2UknxEu\nnKL+QKnu7kmYbKpH6UvRZOmKqI+p5fK2p9ePYrSwVvWhBiPWR3yLxluYniTr\nl4d2vEVb2y3Jt4EqG3esgrp0dEHGU/ju/bjx7e73unD15RuxutR++K3aTmUP\nxNDXNVOYtZbYpoTb3wgiRx6OuFbUKi3k5KEeogLKlYA8eoaIt+14mMG5zOYS\n3TlyYcqsuAC3wH8nvF0z0e+zK6bmLSTH08TAMOm4bE/OQwRRC2Mdffo/Sgmq\nQzgMunJ94CWSYfcHJlrHuilfKHIepjdlkwU/dZlkoHndAgKG6boXr7fKOG1W\nEoNsv6TeYMguKiQNWgVpTWRaFlNA9+S+jci/cHTiEKBxIhM1alndNP9B0083\n06DrOd9ZNFOKfa0f1Cqui+9yFDHarMj34EWpfzL+QAONigM7MSrZx3zWI+ZP\nTnpY\r\n=a4L1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ca556c545f0bd908ba57eb0e24e99d142cc05b1b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.41eb1684c.0","@material/base":"8.0.0-canary.41eb1684c.0","@material/shape":"8.0.0-canary.41eb1684c.0","@material/theme":"8.0.0-canary.41eb1684c.0","@material/animation":"8.0.0-canary.41eb1684c.0","@material/typography":"8.0.0-canary.41eb1684c.0","@material/feature-targeting":"8.0.0-canary.41eb1684c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.41eb1684c.0_1595958678940_0.4625859061559676","host":"s3://npm-registry-packages"}},"8.0.0-canary.9e2f6c450.0":{"name":"@material/tooltip","version":"8.0.0-canary.9e2f6c450.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.9e2f6c450.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5400c0c016de24121eb4eb60e03d9d57a70721a0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.9e2f6c450.0.tgz","fileCount":42,"integrity":"sha512-aB4XbfP3qry5rPBxgMrGuS9ygOobvt0XLnjT+k99alwexphkTfgy11prflx5Y6HwnGlOs7xrivvdElaMsGn7kw==","signatures":[{"sig":"MEUCIQDy1FPj5jIYFlvSkMWFAWgB2Rfyk5LDKnutOnCnCPpergIgIlot1I2CCYlwNOHivoywGXNCPs6SlmmKPFAeqkTNgyw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":366257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIKlECRA9TVsSAnZWagAA1VsP/AvvWxTwf7u6WFV0JDjM\ndqVBIChdGdwMuRvBgeeLiwZ0vSF0Dxpj1A/LB9uXVcr3NKizWpL0cC/D2m1G\nEC80x2X3GEWRxGkT9NBHMsPfjU9F2BcLVcIY5rsft5YcGc9Efe4HBKfbCO2H\nCg+S7tw6nuPHGAGyZ4HmIxXHrH2876tMOEHhOM/FQt5vxfuLcztO93re9r21\nuxEllTcEZ9fSQgvcAytZY8cjrv+Zce5qUhFzJ0s315YGrQcIP+eW9TnfARWQ\nhUygxV9twIK1z0yo8LHkwO3I+vG2/WR3U9jrwbEshnQQTeimG03C4+dLkrVP\nQwS9Ti8lOHswWJXCimqI9VzGGz9pKHodnjwWUi6zmBndU5CcLleeesCLwCS+\nD37cQKgtmYqPX4d9x4/M8+S43d6WCwYWNotOHjQkIhRtwkxAFQ+5t3fXZko0\nRPLfPRNu4cbds05ee+wDVEDCrl4/xYejo/loCH3wk3Z1jTZeeijR/6qQFGza\nUmI+U1UJtPgXbO6BTmNkiSV4Vl3U49GgzsFOPgKecTAVNx+6OevA9tCxeAOg\nWa8goor9XZpIW03Tq/okco59nyXpKgvU0WBhtnV6IVLRpSOq0eXgkSeYKcgG\n5Y1kRZ8DHUcxQ1BHZBDG+uc+1dDBRtnvSDjGfXN2HXKik6qLXFj5YXMW5NxN\nCma6\r\n=JrB7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"20a3870f861650ab884eeffe1d7657aa376a8ee0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9e2f6c450.0","@material/base":"8.0.0-canary.9e2f6c450.0","@material/shape":"8.0.0-canary.9e2f6c450.0","@material/theme":"8.0.0-canary.9e2f6c450.0","@material/animation":"8.0.0-canary.9e2f6c450.0","@material/typography":"8.0.0-canary.9e2f6c450.0","@material/feature-targeting":"8.0.0-canary.9e2f6c450.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.9e2f6c450.0_1595976004426_0.06240797402382636","host":"s3://npm-registry-packages"}},"8.0.0-canary.e6950b55a.0":{"name":"@material/tooltip","version":"8.0.0-canary.e6950b55a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e6950b55a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0a95fcfa1d5fa37e32e9665904dec2203942d0c5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e6950b55a.0.tgz","fileCount":42,"integrity":"sha512-ZUGRc8EBxCizSApC5gIiR7qHjDWv0Nyb5GPvNYwkJJ8eUUsFry0rOVeas4bP4n/8OKpfSOFAjEv4Eai1CMRGAA==","signatures":[{"sig":"MEYCIQDTmMXLeDLXZuWneOLM1H+h17Ms0fKLRzteBwRzkBjlhAIhAO5S8l7SGWzYTJ6Mb0DoOmORUrX7VenzsxFW56UD3P/0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":366257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIKxvCRA9TVsSAnZWagAA+WMP/i78PTT2vM4t6BNSV6Z4\nBy4FKqWY6nCtrIJ4/xAJ5UJ7NRgSI1smzN64rFcKs4IQ6hDlqHhARaju6zpo\nZ27fFeGhHv6At7bKYd4HfIKYRaTG0mbpub230FFtWq722pw3Q8QRYKDJ3YGh\nONjcaidUAtgsqlk7pqwLQ5CZ/CLJ4hXP8P07dgyRzAdQHYDao+s8EnnzNBab\n/Wbn4qKBs5kcZCi1Gswrp92N19h9B8Eq392Bufy63dGknL/TAKcQZf8w2tlm\nSpzn8Ia1VmoxCd6CA1HNo0TnnsXxNN5dor+P3oJut5mc9Dt4uj1LJQQstWnx\nJL+fvdXS7KdEKo4SWgXH1Pg/3lSY1CqSObitSMjfRLD5VqIn9L7+CNBoQoXy\nVbWRtG1wbt31DJqAHTSAzEfCSXDvK63z4aNeRwciqUG8CMy5VoLO5fqfzWdH\n2Ee8BAB0O2wC4bpeyzGovBWNC8k79IeKiSWaLw0TuDD4LNB8TCfxurMog6np\nlP4GMImNQ1jCM5wRSuGybuyiB3SrOh38/5vb/1Sp9ucBpztaUyqrAYRPXVZh\nURAdzg0fX1CWFvOokf1FOqzI97C0aUiKQCrC5W1iNJ96adiT6XEkvd2nCj7c\nOKayAc9e99qfsrceVPsqf7+fF0Fwjj9sYIS+wZeVvOngNrqzWKvlkvperSXt\ncsNB\r\n=/r1e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c71461d7d95f313de3fe5609fac67c2302432c36","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e6950b55a.0","@material/base":"8.0.0-canary.e6950b55a.0","@material/shape":"8.0.0-canary.e6950b55a.0","@material/theme":"8.0.0-canary.e6950b55a.0","@material/animation":"8.0.0-canary.e6950b55a.0","@material/typography":"8.0.0-canary.e6950b55a.0","@material/feature-targeting":"8.0.0-canary.e6950b55a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e6950b55a.0_1595976815491_0.9519269064630413","host":"s3://npm-registry-packages"}},"8.0.0-canary.5e51ee38e.0":{"name":"@material/tooltip","version":"8.0.0-canary.5e51ee38e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.5e51ee38e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"90b5588be76d598073f72b17a751cd49b28a3873","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.5e51ee38e.0.tgz","fileCount":42,"integrity":"sha512-uUKCP5YePjbNyTgiK9m5H1mgKfHxed35Biat1kQlYd9M0vDLlbnd18mpac1LStqJxVx6NTbWE8MuuZyStmfQ/w==","signatures":[{"sig":"MEUCIQDaKnmUwHIRahM8czM0IvBZ0m3Ojrzu7b6JhYlu4YyE9AIgBGUhBXRBEkKjZ0ZXuSAX/Um7WsFOfvxwww8/IazByTo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":366257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfILHgCRA9TVsSAnZWagAAU30QAJRrWp3SKgndUFWGqDqQ\nHIMMnZ7jHudBbHtMAnM76RiGRNo4/QhlMFOWV69i0iqKbsZz4OTtpRkK8zXD\n6m8+O6lhZxi77iyEvAw9q3tsNY5I6S5Cpc1zcA4DF4e5xu9oIebcaRezbA32\n7SYCevtxzs6XdgtOVgndnsVlKkMVcVwfg32A8qMhWDUDZF8Ptc6TN5DyftWJ\nBs7MWYsLIilRukXTDWIhQo6Mg21RVt0ckEdlIERaP6wt52WqnJdxd251YWO2\nWYiohJa/jm8IbpkrOje47DxroubxDH9tg4ZCPX4s5As/xZ+jEGHQR5AwMEjx\nc6ja2nhuXA0X87FCJ/VFFyQoG1e4njF/o7ciuKpANOmMtCrMexS6wWfAafBG\n3uzphZ+3LjwMiaYyfuR9ulpyX6+OxbiGx52TbTQFWyL2nntkZ9HITrQFQUUU\naKRlMTrkzM+xkM8LR1aMNpf8Hxcs7CIryqEnO0nnUTlM57Es+90/4+AWHpdR\nafS6a7veSTxff9fhvgZRQcEpQgChGj5lw7LV2WvGVPReCG1v3Pb79+3qAsgP\nvTUf7O34ZWLZa4i2lMSPuQi9LB8PzWLXK2OKKkuInd24C4pFxZmig/KIFmTA\nb7LYBDQo040FyXd+7dc+4a3V9yx5nALmKxm1tvh0ygnZAZuAmuBgQ7tb3jJs\nhMpI\r\n=iEhK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a7ac25d06cd849dbb8b1620235e913c46f5d7849","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5e51ee38e.0","@material/base":"8.0.0-canary.5e51ee38e.0","@material/shape":"8.0.0-canary.5e51ee38e.0","@material/theme":"8.0.0-canary.5e51ee38e.0","@material/animation":"8.0.0-canary.5e51ee38e.0","@material/typography":"8.0.0-canary.5e51ee38e.0","@material/feature-targeting":"8.0.0-canary.5e51ee38e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.5e51ee38e.0_1595978207687_0.9885344632128887","host":"s3://npm-registry-packages"}},"8.0.0-canary.a3898ffcf.0":{"name":"@material/tooltip","version":"8.0.0-canary.a3898ffcf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.a3898ffcf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c538b662528cbd341506d70bc5909923198e6f42","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.a3898ffcf.0.tgz","fileCount":42,"integrity":"sha512-haqj/GToxWfrJhk9E26oA8waR9443tF3izoQm6CzarV1LEoFBEDY1q+d59QSUvm3nlq0DFt6W4TzpxCEY1pC5A==","signatures":[{"sig":"MEUCIESZKvfdMyP8Gaxk3aEFMNiYODZ+5HieKoiqJKpSCK9/AiEAg1n2UU0hFc/A0+qQH8bUksA15IORakqnA41za++w7hQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":366257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIMS5CRA9TVsSAnZWagAAukYP/1HpjmenTrFEGd0/6Yb/\nHhxRRxvKzX0cazga7EgokxIWZK4aKIVtnri8il78UKr3iKGzUlWt43cxFudr\nGTOtYphakKW/VOoCUjCTaKQgs0rnbnLEikvS5Pi2WJ3Cci3cEXv/G4WZ78ML\n7kqImiKFOGo5/E8Iyc3Ajx3lMCxbv4sRyka5zKl/5bnFKS3Pmrhs5zh3l9iN\ny5M9NluEfdmlW59br43h0kiLTkE2pItkEC2eYtC3nNawhMZxb2eRxcPhoZ32\nnfUsU7oA8aBT4MKDpg9lnc0TKvHIT1YLSZDwbqScn/BihzxVM68Iq7n9jphO\nL3zZtHhh3vSXUPGt88TYVBQgenvMCBumyaH4KJibEnCaRR2g5nYnPk8zRrWU\nwkh+Q8xqSsjJZOSjOO6rsQSzAo4/e5/JdvJo5mU2wOokAD67jaZZYwrlu1DE\nYWf7Pd7QH6zJKnSjdgU0XXw8iBcD42qcQOVMcuToBTR5he662qSvQZA2mPPO\naoQutqZpWvmO8/1yJb8PITLfHjzSVSqDSuCGW16cfw7DIIfWHjTaJlpV69r+\nJFix7wYLVSRKyeAUDzZ44vG4Xuk/w5pPJQPkKh3bMiZwXD9xDsCqScOpUs5M\nZL8fLBkdtGEb90N52mcKR7HG77PQGfM/yibTXQpBx9gIPAUqdN7gzZCHnGhI\nZ5wk\r\n=7JP3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4382580dcbfc3da31d5107a92231aa87122f3f30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a3898ffcf.0","@material/base":"8.0.0-canary.a3898ffcf.0","@material/shape":"8.0.0-canary.a3898ffcf.0","@material/theme":"8.0.0-canary.a3898ffcf.0","@material/animation":"8.0.0-canary.a3898ffcf.0","@material/typography":"8.0.0-canary.a3898ffcf.0","@material/feature-targeting":"8.0.0-canary.a3898ffcf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.a3898ffcf.0_1595983032717_0.5343581381880116","host":"s3://npm-registry-packages"}},"8.0.0-canary.bc5cc6c96.0":{"name":"@material/tooltip","version":"8.0.0-canary.bc5cc6c96.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.bc5cc6c96.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"27f9aeb9675044ef7247c53a2f5a0877467b8219","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.bc5cc6c96.0.tgz","fileCount":42,"integrity":"sha512-BqSh128Tb/Sm84Vns3Or1NirdRCVs2C50UDlzTkIAze8r9hmAXsKEq69Of0IXsvAp2sc5PiqRYgMyQB3E7cb2w==","signatures":[{"sig":"MEYCIQCs6q+ddkNp6OgGhI7xeotphRryttCu7OwTtVExAMOnIwIhANrE881+uNsQGQcmu9TExh2gJBGepUw6UrHP4otivD81","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":366257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIMe4CRA9TVsSAnZWagAAHtAP/RjJEvhgfNc5Lx0jh7/G\nRUrA2rygOb4hWmm7c83B45MUfH06nkiCEPnRCq774S9YYVYS2zyD1PbDL8Zw\n0LAJogRTmgSZuUKFGIyRkNL3uDaqSPeidsn9DVO/TCCcEv5wrWlRbi619GBN\nwLxK27ts8ZdDT00aPEWUmsTbFGVTyf+GyoTdwT4aqBg7YgPYlwFmuyHM2CzI\nhRaDXFYm+DTJTyP1Zb//zYbf2j0DmmvVUFMd+tg9Mp78Iu+RmWCQ1SJWREmD\nrwZGZ1v7oqXib2kzxbPopG0eXf4n9h27EgIPM9U2vonUJYWqGJnNjfQNqcnI\noTshGUVWhx9LwGrYiq/n+hA8VP+y/nX9Qtr9jwB7d8VF0YZLVm0fcTHB/6a/\n++v1gisg64GBwVfTOpFDEu2dzlXWy/58UAgKhwGfC2KHl1WTNidEgfQlcydd\n6khEORBprhlCoxrCtx+i7FwEo2Y0qbTedaN3GIdMPDyuhpZHuLJ6vlPD8kNe\nlcRPXxe3BzRxPsZyn/3lHy0Q93J1tZq3hBZnRrzcLjBzMENABHcMOZnnltkY\nkW+DC+IUJwxQmCOdYhztdy84co0Dy+BBpVf/ktVEz/W8x0E5osg/zuD9m3l8\nUXt48c9J2cMPEyRgsqG2hgUOBpMVxDURdGSzzv//mgUTpQiv55zTAVWtEMdR\nOEZQ\r\n=6j3p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ef5b32f85df29f3c19f5f6960f0f2e58025012da","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bc5cc6c96.0","@material/base":"8.0.0-canary.bc5cc6c96.0","@material/shape":"8.0.0-canary.bc5cc6c96.0","@material/theme":"8.0.0-canary.bc5cc6c96.0","@material/animation":"8.0.0-canary.bc5cc6c96.0","@material/typography":"8.0.0-canary.bc5cc6c96.0","@material/feature-targeting":"8.0.0-canary.bc5cc6c96.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.bc5cc6c96.0_1595983799750_0.965426896315736","host":"s3://npm-registry-packages"}},"8.0.0-canary.9bdeaf928.0":{"name":"@material/tooltip","version":"8.0.0-canary.9bdeaf928.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.9bdeaf928.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3f76f94663f8e615cb6e9429a35e87e57566a44f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.9bdeaf928.0.tgz","fileCount":42,"integrity":"sha512-yyrL9lsE4eROW8y+SWxEgaSXrXQVAP4wXRpT9FS2Gr64vQVkzG5/+62C4ks9K58b9iKqQXvdoM6Hz3eS1aGGVA==","signatures":[{"sig":"MEUCIBSUrFYRkZCBWN8jTLuoT7A/qCYLS0wQsjHoMVj/Z1z9AiEA5txNyU6JljfwsDscn19o3c6veIYmmfbuSfEB1dC+CKQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIM8kCRA9TVsSAnZWagAA1lcP/0BUxHyH7PdzZQKBZUtl\nRAf+X/9PoYb6V97bdIVSZ9NVhip6l5iAbFOv6VJEKsqHnuMI1ucew25jN0q1\n03sFGoaknBTZ+bP7nohqi+Q5brdUUslOcA5q2kvvsRj1EVxkuLdo/PAttXTv\nPHlolHge9Tg9DwslWFQYNNe9l6hVw5e6Ak4usPVbHL8u8eVwel0DByDMCzSl\ng0vemDtukGyFV4fUDboDyvkWhHc+VOwoKqwRvyt9552Fb0NIOIn75GTmkTuV\n4p1moP3+U5RA+iw4TG8uB4NyZn0ATsv7+SWxg++LWK0IlNlfSsNSaN4s75ZK\n0E8JI9vL4ZbVAUjYKC3VOoX535tcPZP7uePDMZlHZSoJ94xg0zF9pe5q/DnR\nM/LoeBNccA3RdGMTTHY7n8GjvDaJimyZubjwsUZYTz9GQcbpPepdDDrErW0z\nKkldKZ61NY2rcOi4AHvJl6geX4xt2e9QW7J//RfUnaGDYq9da4h7nFlRpy5o\nUORwgp9vhp6EQjC+9mMsS/BRCi3K96trVI0+mp4eDYGCq0iFRiBoqucWsXwk\npxuwPunRV43wZAkgac/VRNjL10djRD/2OAq178AMgN1EVMM/1c8iNZo0t0mH\nbzCub0gya+3ZEm0fqvdMMQXTx30wvsVfLctuCKeJjhqmvzsF0/49a6bwKY6T\n6ZfW\r\n=stNy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0fd3de7a6a462365d56e724dcf32c2c1890f553c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9bdeaf928.0","@material/base":"8.0.0-canary.9bdeaf928.0","@material/shape":"8.0.0-canary.9bdeaf928.0","@material/theme":"8.0.0-canary.9bdeaf928.0","@material/animation":"8.0.0-canary.9bdeaf928.0","@material/typography":"8.0.0-canary.9bdeaf928.0","@material/feature-targeting":"8.0.0-canary.9bdeaf928.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.9bdeaf928.0_1595985699541_0.07678306648845079","host":"s3://npm-registry-packages"}},"8.0.0-canary.fde2c1f9d.0":{"name":"@material/tooltip","version":"8.0.0-canary.fde2c1f9d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fde2c1f9d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fcb6a7dcdcfb670feb94abbe4bdfc6d74ff3e8a2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fde2c1f9d.0.tgz","fileCount":42,"integrity":"sha512-wQirNV29kH6CzeiShqU/9mQODExcFswpRGJiJYQ38zmhfcnq/vCP659Z0jzNQYli4nqotVjH1fN62zgD1qXxSg==","signatures":[{"sig":"MEUCIQCtP1rYS1IlaOeyEe10rhsY5/7Dx2TlLSPx5STDypUMGAIgApKskPC1GV1eubiNcS+pgJVd897+n6Nbs+QkmoHxFY0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfINJ1CRA9TVsSAnZWagAAdZQP/3H/8CJmK+PmFDwuVQap\nxT/IpjtbRsIgr5WLFvXuQusUcOdz0cHDUpUSHY53Czw7xp4IntE0FskhVzv0\nKNsbk5dUNS1XglLBF73GE+2ilXKhgyxu32fuZgR6X6dxuRUltkKNE+j5ZDxg\nOaQzXLNH4MpIJNkS0p0b3mEm0K4I140cz43+yoIUQY5irqnY2hmwn+r1431W\n6xv3U/W260yCh7344auqrF3h2EoTpND1CKOSG0AtSNlshZm+OvxFCEs5Cg3e\n/x+zXDNv0eeK2H8yXszh1llUkc3w0bvnbFsQD8mS/186qaxv4ZA5UB8B9tAL\nVzWoi4EDXsuWj6yPNUTJq3836E+B4/jU9jJziilMpXgJWM8VvEPBdRJg1JWf\nrDpR8Q3djx4oTr2cyyoyuwJJqmmHqxrSA193i3C8Ju70wTHr4OlgRB6Aiba8\neM/yTWlG6Jlyyd0j8hbxPlmr/r/k/WA5Q12V1hO3myZi5TugNM48M5+kyRbd\nnCttuVI0F++Yuo73p51ZFmcH9nGNXWmWTYFFABJFGOND0TbABjRTuq5/GFoF\nljVrqwU0IJY3yuouNInltbBy4tVxVFoYR1a8gCzhje8JIDsT0y/Ea+uUpwlX\nlOik66bKq8R0qb1QWzccYaKr8pohFtSEQR+we9kYUP97Zw9p73fJNkJSlMKs\n40oj\r\n=s5eO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f2de51610533bd781edd8339c8555a3c03546e3a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fde2c1f9d.0","@material/base":"8.0.0-canary.fde2c1f9d.0","@material/shape":"8.0.0-canary.fde2c1f9d.0","@material/theme":"8.0.0-canary.fde2c1f9d.0","@material/animation":"8.0.0-canary.fde2c1f9d.0","@material/typography":"8.0.0-canary.fde2c1f9d.0","@material/feature-targeting":"8.0.0-canary.fde2c1f9d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fde2c1f9d.0_1595986549052_0.8606385456363626","host":"s3://npm-registry-packages"}},"8.0.0-canary.6b3876d5d.0":{"name":"@material/tooltip","version":"8.0.0-canary.6b3876d5d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.6b3876d5d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f1f857a2e98f805ceb7c7f0fb5ce3c51f30acedf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.6b3876d5d.0.tgz","fileCount":42,"integrity":"sha512-FPCzpI+taTJr95vrnj8do6qvw+qNROm9NKaKei3uIn99Hb8CbX2p105R6LwQS1oR6dKDaE+nW1u0GMrgBYLMBA==","signatures":[{"sig":"MEYCIQCEIUyTPrvxd1Ph5jIRTc5h10L+PxG3UUI8BEoOSv+AFgIhANwTs32DVQlPLqFxsWri4Oye3OVvNzd9Y12JahZBgLRL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfINNeCRA9TVsSAnZWagAAcukP/jokwtucwlw2NN3q+edL\n46180dPqUZm0xWmY1ztiUWl8Hlw0qmehp3XmPxiX6HeJpiC22ncfuHlmXxpZ\n/nhJw9coCzqE+X0zDBWknrCo/OO+vuECR8uR+u1nE/Z9H472t5l0EESEPXtb\naIRBRVlwLj2UsBhuLX2i6zme4mDvuREK3TLE2qQXjGb54BBzzi7mSjvEPIZ+\nHHDyOLra1/SRIDiLS1SgbjqGgDMPIkO9y7SKZiB5nlvwlPk3gvpbaklcUHVs\nu6LKX/yg8ayn8/edeVpkMpLgiwh8Ko+XBtDbHmEVXUARtb79W2FcziIlSal4\nrrquoH2qySdTP2Sb1+TAuf0j5KVRnpiNmZYpmTn/0L6hZW3XE4YXWwNd0xxC\nqltkoVGS5SeWgN1RBWMIfXwxJMGEUUV3iw10rQi72fqzIrDmPf5xS7viIh4O\nN20kV2ECGu84CwMSBclBxarK3sVYm+YS1s0321SeuRiWFTwFi/b11NAyThOh\nNYx0r7K/OTXYmLXDJBTJ3+GZfZnKyDrEUrB7UrI2Uk1UNLm7duL1V5q/1Cmn\nkE96fgrLFJK9HyS9rFENZee6fV4vM38r4LbtaCdUJfzZEAwNyuhYhegVCCrG\n2LpscMbFRzBPnMSdH4D1hGXOv5zOJT2OYwbvKmtK6+VgR8MBWmXwRqN8V2Ln\n+TzX\r\n=6oVV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3559342f661baeb39f2e70f1172040aba07dbc1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6b3876d5d.0","@material/base":"8.0.0-canary.6b3876d5d.0","@material/shape":"8.0.0-canary.6b3876d5d.0","@material/theme":"8.0.0-canary.6b3876d5d.0","@material/animation":"8.0.0-canary.6b3876d5d.0","@material/typography":"8.0.0-canary.6b3876d5d.0","@material/feature-targeting":"8.0.0-canary.6b3876d5d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.6b3876d5d.0_1595986782139_0.05069737929195717","host":"s3://npm-registry-packages"}},"8.0.0-canary.30ce17873.0":{"name":"@material/tooltip","version":"8.0.0-canary.30ce17873.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.30ce17873.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a19bf9f9ff0469dd2ad229e3196ab60d4f943f3d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.30ce17873.0.tgz","fileCount":42,"integrity":"sha512-y6ZIJOL3BT4DCrH/UkKUIAYPKsB4jpdvUBzjrAoY9FcLCfF3XmpPLu2IeNtjh11fsO8KlX3Psp9K+Li1Mf2iWQ==","signatures":[{"sig":"MEQCIDw06oQnaO90uOfjnY1xamRor2imJTIABQ/6/T5PqcjSAiA4TJfRa2zB0EWMDxRzj70EbJcXSpU+VbnGsufPiMwXXw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIa7ECRA9TVsSAnZWagAA7HEP/R3UHVb7wb+KaMMAFrQa\nt3U7UPuA1k7K7y2Nmu3dqhTkibyCm7ct4BUB1gusC5LLUjgNvRsmnaQIjYcP\nvakSzuGXavADl5jBPj5ilvtUSPkItKek6wc+Dd5dPPdUYgqvoZUtBICFtrxB\n5vtw12wV12rS6DEgTGceE89XGl9JR03juYHU+3LbS0sDgdABsN9UXNJ93jiQ\nLPTlkb4XMBFPveA570cQqKzU5dXoxg0JRCUwRcUZgyfVn2ibBVheeLJEilxk\nVqpYzFIQozPhZC9R4+A9p5JkhLWg2oVI2wcdFU3XohA0iuXPRfuVq2NVUBgo\nhfjDq8dvTO5QCOVuSbQiWlQqcQdlBkl2tkk/pzWMkup8E5B1DRMOS3DC08Fv\nLN4uF/I6p9FO9WY4IVgT+fihlqwixHrrDEZPH4THOQjoMe1rGu2wsJ0S+Loc\nKrrP+u9KQul1FeSWrn71hXJPKc+NJDPPwY3eAhZoZm1h4bwnnzDbM2Vf8X6A\nssxG8Sh3bS5su5wVlPu5XO/SWGkJLnADXHrdge0i/qklmoKN3/0BG5woHos8\n5eaCHIL9kHsoELs2ck6TKpO2TlpwBUFXL5EtNtPyCKhglGgIhgpLdK59aXOs\nexNzsgzjzMnBmLXm8voiAsHVgnPoY84ajJni49RqVD8cRS2IcoYwKh/XRP8T\nYbo3\r\n=KgBK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"88fa0309b6185f09fffdbd61d0c3e16f53c2530d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.30ce17873.0","@material/base":"8.0.0-canary.30ce17873.0","@material/shape":"8.0.0-canary.30ce17873.0","@material/theme":"8.0.0-canary.30ce17873.0","@material/animation":"8.0.0-canary.30ce17873.0","@material/typography":"8.0.0-canary.30ce17873.0","@material/feature-targeting":"8.0.0-canary.30ce17873.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.30ce17873.0_1596042948561_0.9496711109537777","host":"s3://npm-registry-packages"}},"8.0.0-canary.f6bb43bf0.0":{"name":"@material/tooltip","version":"8.0.0-canary.f6bb43bf0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.f6bb43bf0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"57f95675e833a2d83a5491d34b180785e14e2f26","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.f6bb43bf0.0.tgz","fileCount":42,"integrity":"sha512-Tb4LQtPKdaGMY0Dr0tx3dt6xD9vs8Im1ClthKtgLHOQJFSv/ute48hWRb6ZlIvHcyk/516b5EbcmRKwyEVFQ9g==","signatures":[{"sig":"MEQCIBRDNHGEPo/dAUDpY20r9UDXAGH1iP7BBG3WOIWEUf4LAiAacZEJOs71AbKbhnO9T/4k2TnsXSIJG///1I/Rkno2nA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIb9OCRA9TVsSAnZWagAAvT0P/AxPWz1iou23uBJdRwc8\nreknAQzgi/x624KgKZm/42bEeo+meIO+/UCQUgp6V6Az4Yy7/Fu2iKjRKO2o\ntHgW4+gghefhK6nds2wAXcLEICNssABBltAxPyMwqma2ALczjcSIKI8vcxpo\neZm5C5eCevfGcRKboewuW2NkMJAulwVNZyY2UjX5lfg+au5212hUfOZnKaYS\ny+zzBbBEA7laLtX3485sWCvid2Axw00GXmC20gKO15p11z6UcBgLJYSikO57\n7BImNeZeKtEmSJMf92qGdJNxGOXt6fPGWG7XjV2JXgeEGS2si+rx82S1XKJE\nJtBEf6ZIFoge6Y0xy4KpApD0XGisywwRTIDa3HpOUSqv+Qmzy0yqUl4Wlh6e\nsAwrGjJQpGqhiD4N7ogcHX2DNNQYvN9hWchT3keGE2V4RzLO2aBXDRncbU7i\npYHzf7KFlHefq+UWg73ygluQZoENwTPmn162Z73WOGzcBtDaBDZ0yn3YGs29\ndhfv0/Yg0oQlDNXIM9K80ZQuP9w/VLMS23MBEJfR8ym8Pb5fyGt4PsACGy7L\nwcOiZS7cRbUmOAxpsxYxhCDVY79YLCSQ/3jM5ANituz7JbaBPSpR+d4XYeLP\nbKgdgR7kf74A1oNe5pnZl6I9tr3EQIdsYxl0380ZR0OPqkvWv15PqPdNjSo9\nC28a\r\n=gGZr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d511f86ad9ca4460730b732c04ab497fd558d515","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f6bb43bf0.0","@material/base":"8.0.0-canary.f6bb43bf0.0","@material/shape":"8.0.0-canary.f6bb43bf0.0","@material/theme":"8.0.0-canary.f6bb43bf0.0","@material/animation":"8.0.0-canary.f6bb43bf0.0","@material/typography":"8.0.0-canary.f6bb43bf0.0","@material/feature-targeting":"8.0.0-canary.f6bb43bf0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.f6bb43bf0.0_1596047182027_0.060586224431457","host":"s3://npm-registry-packages"}},"8.0.0-canary.6af75f6ab.0":{"name":"@material/tooltip","version":"8.0.0-canary.6af75f6ab.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.6af75f6ab.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"789f77894277ae4e95d959bc3f03118bed32c499","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.6af75f6ab.0.tgz","fileCount":42,"integrity":"sha512-R6WfFLHZEBLwx03NQ9ZrUYsvGHTIERqYhhjbx4CJPrcHXnxT1bpQmVQWBSXcogncy+8Bk6gDeqdzAQUkM3JCww==","signatures":[{"sig":"MEQCIEKMRmbO+HyT3mGNgA19r/a87YXLdJBOt99jFtFt4ZoRAiA/VS4tXr7nv88+P1wGLNXKde14RA0je6my2AyFrR0MpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIg4MCRA9TVsSAnZWagAA2V0P/AqHIIjom5gNZyXZqzAu\nzUU41DPXW9/25srVqfQLX0vXfvMpHpUBjREswJ79etTmTGcvL9ZswIIFD/9Q\nrS54xnbIeM6zztZQRl0DdUHJ4PqVzE/imWV/dzsIAPmgCDFNYUf2CTKkdlB/\naX0zR1h0X+LgipJMoR5MBf2ssK8791txI99gKx3EX8bFD8nn5FcdbSp7W8la\nhlBT4QzUZxdSFko7pAJj2kKUxWPCmVWtIxZZs0DuSKo4vd/tJgiN8YIbIdRO\nsYRO7C9JjOZyXvvXNa+hA2qk34znYN2MYZ/ux4l5OqEKLe8MvchwQeZtKBOr\n8HOqQrPvxJNXWkicVGPqIQdRZLZcRP1pFhNTgmv+t2TMxVjTHxFTvM9EE/z6\nBWQ8xWo0FSLGvvWJY2pKlgRiAnrBweQd5xI4OXD2PpQ7Nn1QdBtUJ3A4RYm/\nJy0GsCB4goSUBEeZkbR5YWO+byVZC5IlUOx6FVenWoMGCjs23d8THn/g+q5U\n6qZbx1+RDwmFv6i8yObNynB1Y2f0qvfm+kg0Hsv3TbPd0LYkHgU5GQc57eG1\n7svqdsOulcg0/TfT8yNEv8+RD3qK9ddH4qdzhyaXHb404xCPiqCIgZY/hT+u\nRpi4LmY8qhld2IGlUyQFlxMMiOZCFPoLtvoQI/P3v1ptgPs6Yfd/zyb+dgOO\nMu5m\r\n=RrJf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"44ee60f895715b8f7c0a7da67637babfd33452cf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6af75f6ab.0","@material/base":"8.0.0-canary.6af75f6ab.0","@material/shape":"8.0.0-canary.6af75f6ab.0","@material/theme":"8.0.0-canary.6af75f6ab.0","@material/animation":"8.0.0-canary.6af75f6ab.0","@material/typography":"8.0.0-canary.6af75f6ab.0","@material/feature-targeting":"8.0.0-canary.6af75f6ab.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.6af75f6ab.0_1596067339512_0.8238600234045397","host":"s3://npm-registry-packages"}},"8.0.0-canary.42d7a65aa.0":{"name":"@material/tooltip","version":"8.0.0-canary.42d7a65aa.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.42d7a65aa.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5319d735eb72a46c945c265e01d61712c8dd89a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.42d7a65aa.0.tgz","fileCount":42,"integrity":"sha512-rhg1EGSenNHQLCleqvXs1kbeS04dtp1JRHY+8PCz+D1EBlkCh9J/NSTR3H+MY+4lcaD5Bu5zipyUFNqtTeVp9Q==","signatures":[{"sig":"MEUCIQD6P4BEcdZnsu4fSZ/gVAfAh/qwMxORK74VzjFHWL62HAIgUS6P23B4c9d2hY+wbOGPViFbJtEs8ogJjO2+xe07/QQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIhAvCRA9TVsSAnZWagAAAiQQAJtpMSZDpIgTADn5NfDT\nvB1uIyx+hCWwi7lhcq3HumMJH5i96bt20fZ0js6H+SFaffNCRxOyhKxLsu2j\nhe5fODsvuuu40VCb/3LFZLGsS6cLjn2F/O42mhGyJZx4+ppWDBKm+y89l/Rw\nHlWBuyd0da0Qylh/rBsEcnXT1KgPIDN/IWae3+GLXiR+mTuyGnxMPWh7mWZW\nsb1/Uz8W2lDdeqaijvzXHjbfehaCi3Go66uwPxJQV+yvY2V5r4nkLpnDUEy5\ncHv5bcsZmnRL7yWTUkQZ6aRr/FV1Lqs/0jJ5YyE2bZd1LHo0KHJRoMfIs7uD\nNXdMM2T5WW/+z4t85+dYglW9MunlAD+wt87oPzu0obspNFhK0j+uaWSKnc8o\nDSZjg7tF53aKnVglckoWQu88FCdHCcHh0k80Z5SyqqW1AFnfD3GMB6ZWjMRp\niXCYWi2pfBumMWFPx3NKe2ayQppTEDk3AMjCk5BPgfIpo/KDn1tcQkjvHUhD\n/31WNqPzlqmsCIVZAIRMSfsN1DfQanIdB0Wj8YKr29zykw2pgZUjy67p6wHR\nkitxoQNGceHRT4HOHPdBcQ0gfXyIqbMmEVQUV87YYXfesn7YFkOeBZ8KFHL2\nFcyPU4fUH6sBN5PR+CO9+0qJX5wVJ1HfF7219eRKdqqV8l6NKEtW3L8BF9Xs\nx1YM\r\n=t+6V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b6645573c0460e7bc8187d1a21ef306b674e1017","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.42d7a65aa.0","@material/base":"8.0.0-canary.42d7a65aa.0","@material/shape":"8.0.0-canary.42d7a65aa.0","@material/theme":"8.0.0-canary.42d7a65aa.0","@material/animation":"8.0.0-canary.42d7a65aa.0","@material/typography":"8.0.0-canary.42d7a65aa.0","@material/feature-targeting":"8.0.0-canary.42d7a65aa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.42d7a65aa.0_1596067887037_0.5692071033047474","host":"s3://npm-registry-packages"}},"8.0.0-canary.85abdabb7.0":{"name":"@material/tooltip","version":"8.0.0-canary.85abdabb7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.85abdabb7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"54fac3c684eeb7b79e84e05180865ff920e4db80","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.85abdabb7.0.tgz","fileCount":42,"integrity":"sha512-Vc2VfD27GrPyOGkJSYbx9TIJLbbFNQmbb6BtZxNuYcEQTsscswNIFE5KwR4h2/lyXUbVfTma/gzx7/0Tit3+og==","signatures":[{"sig":"MEYCIQDLNfFMEfnOBwL9mYRHciusAMRh8rUGQax+fLsgnXv2OgIhAM8R6i5Df4mPFEHUGmBoQpbpO+ksiVG3w+d23z8gkNOp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIhFFCRA9TVsSAnZWagAAQhcP/RYFgXTxKMH1twkM2Ta1\nEz79swFm4qBhZ3pQp3i4Rb8byMJDTWwAzHSrPBXuj8I5Ae+TuP4qYfajhICe\nyuTMdGadCdgFNoEU0eMv5UszswQUGLebtNNruRt68aCpe2ZWD7yBRaQ3gK5U\npr5iKKHRAKHxjCd2J/M4U66NFU293eDVOWr5Rd50kgkxeKbRPNsqCjGdQGUn\nXN7+0vCAHj5Q8XxjwkX2f7hr5nWDeux4usZhE7E8tVIs70Yjjrw2L1kFVPOO\nxOH1MRXKRbp/8RHLNPJ46wS1NWqKmbjzwVUhsHbGQO0D/J2sZ3/4iSUgQoPT\nUGhaNGVH5dw4EORjlnDCjLdW6zPOWMTxb12+VVN36SW+dntBq4AmDOTCubWB\nNOcSnhyoztWyL/ol38Vl+LJstfL1GExxx7kihWrm44elyTSTLfhH7lWOip7o\n+QNpf3bjxBH1ncC+AG/XYT9IXFY998o3WUdhPU3qR1PB5eO5X6n6sNIZACgZ\nlJr8n6ntZes3Ao9/tNyjE1P92JTf7Vgx0lDz1nzgDvSZXOQrNWATzTCO5Xlx\nKFzP4JkB1l75enundfytG1wc0yvK2XSUVPTW7oi32bu3Vqn8kYJPU7DnVaE/\nJsLUqDXvCLkD48ysX2uJ+3RvFOPhLcYjCaTNmocIIIdR/On2cU4LMobQ5Tcc\ndKmh\r\n=hGEG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4686052ff6039efa085c0d360393374ff4b2143c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.85abdabb7.0","@material/base":"8.0.0-canary.85abdabb7.0","@material/shape":"8.0.0-canary.85abdabb7.0","@material/theme":"8.0.0-canary.85abdabb7.0","@material/animation":"8.0.0-canary.85abdabb7.0","@material/typography":"8.0.0-canary.85abdabb7.0","@material/feature-targeting":"8.0.0-canary.85abdabb7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.85abdabb7.0_1596068165319_0.5694672624642354","host":"s3://npm-registry-packages"}},"8.0.0-canary.49fb20ca3.0":{"name":"@material/tooltip","version":"8.0.0-canary.49fb20ca3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.49fb20ca3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9e349bd58d05e70ebc5a8d5313edc31a742ef915","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.49fb20ca3.0.tgz","fileCount":42,"integrity":"sha512-ktnW9hBO5aWRGTiflgyVM9Zv4933C/jgOQY0PLO31WHbrzWTnG5IzuWINH08HQhQ3+HflvAUc+fLIj3Y+RkYiA==","signatures":[{"sig":"MEQCIGGefk3qufwXpSkYzoISV1sSZwRhINHHkQiHDvMgG3oyAiB/4hEeOTtG5ZK7V0+3eUjKDUEpEHc+yWFNUel6Byke+w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIiI4CRA9TVsSAnZWagAA2X8QAIncgtFc7+Njnkniv3ha\n6MP85Ol1EFEk9ZsKVrNHbIZlXhSD5NYwHMK4oCAdKDePUa6xPpb3axyFhtHt\n2fdDdN3yJym3JtObUHWNmXM4iM+T4GVyDhtm3dqb5PnDGKRDQSRgsOEJz2Y5\nWZfvL5r/tL0pLu56S4+llKTH99B3vrVxqFESVUnfWw+gCYHNClVuL0xb2CYu\nLY1OablZKo9e6Eq6KtPROri/Jz95JHlp1oIe4ibmUrNjyetHzS54Mn13HmaH\nxzmHvGFIPthOsBVS7FNmdXvkO02uzgA3qrIMufSCXv+HP4n3mXz9WvEhevnp\nw6XNrirPkG1btU9aqzblWrRH9vkUoYDSMbsYOvOvkcxIUTiDuqoM6zxq6GzU\nt+1CwCUgRK8ieSDc6Yjudv2jR/ggOlrSbWofYIudbFvrUpFjBX15bNEpa7U7\nAjokG76ZQxQC2HfvZIw/8WgViZkErA5rkTLMJunm5vsVtqxtpFmGtrbyzFsX\nK3LtLiScSmb70eKy8NTKzOnpaTkL1Vq5sufSITWsvmhuPDJmtk7JPSVFGKBc\ndFZ5thn/wODy1l46yVVNOI+03j5qu2joxt+1eNozmTnf7KzdFYkJmqjGFbb7\nRGtwlyTvPtAvt+LR//ABZU0nAosVlu6ppuOEe2DAQKtF9DauODX9MqMa9SMW\npgXv\r\n=j612\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9c66ae7fdf6570d9cf334102b5004c5a04b628fa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.21.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.49fb20ca3.0","@material/base":"8.0.0-canary.49fb20ca3.0","@material/shape":"8.0.0-canary.49fb20ca3.0","@material/theme":"8.0.0-canary.49fb20ca3.0","@material/animation":"8.0.0-canary.49fb20ca3.0","@material/typography":"8.0.0-canary.49fb20ca3.0","@material/feature-targeting":"8.0.0-canary.49fb20ca3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.49fb20ca3.0_1596072504090_0.4398853923823811","host":"s3://npm-registry-packages"}},"8.0.0-canary.962d4abbb.0":{"name":"@material/tooltip","version":"8.0.0-canary.962d4abbb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.962d4abbb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2081a4b0e28d94b6a77d6d913e5f98b9c43e9224","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.962d4abbb.0.tgz","fileCount":42,"integrity":"sha512-MX5rOIIOfveKy+sfQ84Jls39WL9XIbJ5xCj+KHjVtFdBOqMZy+AT65ocTpLLIeDC0vB67XFoQ7roiDJkzG1z2g==","signatures":[{"sig":"MEUCIQC3XruzcSVh8mqFjlIpzjxSiQfkYjHJl2uOxdspOFJUVQIgedFRKQyZ7OVyhSzRjPZWj3l4GUapTy7gCNwz4ocQ50I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIvEbCRA9TVsSAnZWagAALScP/26RRsGGYVCTEL0OKQfx\nJ8HCGhB+j+nLSDAku0DPAKLVLmvoMVv8owh+lRZ2wNwY7Maec62IasDrh3vX\nBeMgwLGNDYqo5AsLzESCBmoRbq4FYH6l0EfPust7F+3JaQoT+HNyo6VtG/pG\ndvpaoLl0mDNuMY1dxmoe2J7DSg52q9TkmYBiJHIgcRhx1Ljb/rfvsgYF+lNW\nUQvHbw14teNCXS31ib9nqor5rdDkyzpbCXPZwfdaZpk6T9OcygHNcROOCcqm\nSiauHyF7xn+OCWtmq2ihZlYup/eIhfZPIH/V/Xfdb+iDjHTsNK3HrMyz+qEf\nTTMrmGLRkOfvfmfNTknG8xlhwOl8cj3oT5WtGmF1GgL8mC3gwcuVfKuP0+MN\n3kJ9hrh3EEKjabxSeeDZZAVGc87Tu40f6zwTL1KIJFrXnWRpk9X/226h0rHr\nj91dLI/bNTa+PgL7DmYPyLZ1mUk/5gWTTB4rhvTuJFHJzjbyzkTBJbHhJu3w\nNpHKFG8qLvVH95hrlrCqK5E8WjV9YSvJmNDQ+byZlo8eJpt7uqzHy68GfhIx\nA4y1q2iovez4SRNqrf7VFvjwsRKIb1vngK1gL6aWxfBGMbT3FobR3XrNhvln\nbMaWQLAslCU9QfezT9CLfIR+/Lb1t/0PCtHU0flSH1Q/oIkGA1tpJ4gm2DoY\nkS68\r\n=hXJG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d373d2867180ff5f61fc4d7afb88a8825cb5cc9b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.962d4abbb.0","@material/base":"8.0.0-canary.962d4abbb.0","@material/shape":"8.0.0-canary.962d4abbb.0","@material/theme":"8.0.0-canary.962d4abbb.0","@material/animation":"8.0.0-canary.962d4abbb.0","@material/typography":"8.0.0-canary.962d4abbb.0","@material/feature-targeting":"8.0.0-canary.962d4abbb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.962d4abbb.0_1596125467029_0.03128896992593133","host":"s3://npm-registry-packages"}},"8.0.0-canary.2fcee40cb.0":{"name":"@material/tooltip","version":"8.0.0-canary.2fcee40cb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.2fcee40cb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2274a66bd3d0ca45b4c1df9ecc31c1fb71f2643","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.2fcee40cb.0.tgz","fileCount":42,"integrity":"sha512-76nOiVnnOctueFSQMEb+lnIwCq5WXJX+brPAUhR6XWfYh1xn7Z0syIemGePj3Y/LWaL9MI/epq657Mm+5lx00Q==","signatures":[{"sig":"MEUCIQD9RlvqyHPdw32QmwigYO2fR/wL8x6ChrGxQaqT9ovD4wIgOZQERowhq1SRSGXVbZU4JTwRhOYax+G3DFMKEPs+GKA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIwHICRA9TVsSAnZWagAAr5UP/0cg6bAnzNdD0gS7nO9Z\nE2CHg+avJu505s23uAeOf/HPeKyPpHjkU7iCWeqjTmtEeJk9U1YwRuYY5Ho6\n1JvCwBZGQuC0nJf7zS75I85xSkdpzeQYzTKPOCI3yGub73jUoFVfhgUwPoqH\niYYdtOV88ASzuXOPvVUW9c4zukPuA+ekwoK7zBBNw/03smxKkWVm/CLiEw9k\neuYdiqtdtfVm+zqzBqust32AKkxMm1GeJErhZ3YpnkPzUDPX1b27w40mYPKP\ny2MSWVnkKPBU4A6v6DmmbbGkWgxgB605k0VD+nbvwv6vBMYTBgJADEpYK7ZK\naImixLEfUGmIDqXT9Kyv3Id2L/iRYsaJsVOpKTVQ9cNJmWtpwn5HEMbVVAQI\nP24t0B6j3tYXOp9jg/B7KVIhdBsPq0E+v4t02Qs5DrE8YWpdc29Oa0sf7Q3U\nSLCKp4biMt8w1DLP5L5f4v4UElsRCTrlu2YC/iz16c4UHr8JE4wwG18Untvc\nNJCvK516he0rMJUuTBAX29n4AjGwP+cWcv7q91SvMSa37iwAFoJfFucZmpNG\njBtkJQptIofA41zObgJ7joq8+3m0ZmxUm5ZUfmMV/7B1RUFmzJ/MC4SpAsyn\nvyaSoVqchqMpm/e4M/jSMloQK2AfoYGh9Eyap91Jo0bVOlsB1eIPdBa9GeZ3\nt9qD\r\n=ESQd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f769a8a60e9cefb9e0e6306a96914e8e4b4c0c90","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2fcee40cb.0","@material/base":"8.0.0-canary.2fcee40cb.0","@material/shape":"8.0.0-canary.2fcee40cb.0","@material/theme":"8.0.0-canary.2fcee40cb.0","@material/animation":"8.0.0-canary.2fcee40cb.0","@material/typography":"8.0.0-canary.2fcee40cb.0","@material/feature-targeting":"8.0.0-canary.2fcee40cb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.2fcee40cb.0_1596129735759_0.6665246457139857","host":"s3://npm-registry-packages"}},"8.0.0-canary.bd5987f5a.0":{"name":"@material/tooltip","version":"8.0.0-canary.bd5987f5a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.bd5987f5a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f2edd6bee9196ce0fed56f1435fa16e62138274c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.bd5987f5a.0.tgz","fileCount":42,"integrity":"sha512-HJ/oRaQOjZpa6nXXE1tAA+LbFzUuu9ZOlNpb+4Y/ekHvMBAhSDmQ4TtsSYFnPeBHxTCR4H2HPqddZDwQ2Wqtug==","signatures":[{"sig":"MEQCIGGpSPwp3MF+SNPAajSXzEMfICXewumJj8/2lwUTBUJmAiA7Vn3wIyZlzu5o9vf74GgM2SoR1fRY91JFBGMV4RM+0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIweUCRA9TVsSAnZWagAAMoAP/3048IENRAipx/KIuqvw\n0M+fXOSow8wXdskIbhcZy7xasQCQHa8BxKl7LLcfY5V0tCFqLU4zfl9JZr9s\ngCRWDplDd/rLL8EYsltpf/Y+hlYggJsfZYTzGuVD2pCeWO75DUM/z35+VbI/\nEybhEo8R1+l0GoOf7hHgPqHEh9arpes8Zv+RZiol3vE+mT9jyyDdoPHvH57i\nnDhuIlNlwawDsW6uB541VmbPFA1vmF0cei8PkxbiMhe/C7laMoeWN7MLevfg\nqPMxBa+HW5YTnYX/KfW5P0pP+iJCqxC1zj6wqzBaHVG0b2AoAlJRGVfqFRcm\n1P7uQ7i0GDkPsuSYbx6qzbfkCML+JtLYFJAdkkZpsE1JW0FuKbZ4akN4VLJY\nJAoQXDsDcq7m5gjnFb4S6hWb0UxtPqdD2qQU+M43OHhb8rZYkf1kS7gAg3DL\nDy05toB9/ab12XVTdAjs0Yx2GAo+PLEjWhqQAEHrBL+CHiCvzpfOjtISeoY0\nWKa5NsAqM7xoSDKNYHuwIh+pndU+IzMpfTzovq2P8LaMeG/vOh9NUjsnIoym\nIgE2vYKjCRqO8ry5Do16M3UqzTrLOrmvMkT611DrQPTubksYI/nKDwPEK3bX\n/pQQPsxLiTkzt1dlJFsK46ZSBTre+LOL9qUw55KQwF3S2PNBSsJCq0XkvVbt\ne3yK\r\n=2p5V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7825c698a6686a8ea967272c1f150363b3845900","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bd5987f5a.0","@material/base":"8.0.0-canary.bd5987f5a.0","@material/shape":"8.0.0-canary.bd5987f5a.0","@material/theme":"8.0.0-canary.bd5987f5a.0","@material/animation":"8.0.0-canary.bd5987f5a.0","@material/typography":"8.0.0-canary.bd5987f5a.0","@material/feature-targeting":"8.0.0-canary.bd5987f5a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.bd5987f5a.0_1596131219678_0.501316830457951","host":"s3://npm-registry-packages"}},"8.0.0-canary.005e86a9b.0":{"name":"@material/tooltip","version":"8.0.0-canary.005e86a9b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.005e86a9b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36b04d89c9aed85ad38fb4a5d511616b76280619","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.005e86a9b.0.tgz","fileCount":42,"integrity":"sha512-fpuGJWa2lPGhIowIhb0RW6AaLBtKq1yIO/1TpJj7kOhMYgZReKledvCKmL2nD+62lHLGbqfci+tpaueXx3TH+g==","signatures":[{"sig":"MEUCIQCmeiQesJ4MyUyBEnnqcDqCAqK+4urakLh28v53P7n6nwIgF977OSbuwFLKkbAcSD4xPtoYaKuZ+/jq3njy5jbJtDU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIwrYCRA9TVsSAnZWagAAJlYP/jPEIutUU8HouAiFMK9s\nfS22zXJnDhUGgqciwhmx/vR6c3wyt9ZrYP0QtAhoeCbCklqtTqLo1HDF5o6L\nUsiLre+yq++C+T2vFcU7NfDITtUNrQBvskTdHCFv7u0ODnD9Er90aLCKr3dN\n+K+1fjDOJmZ/gxrASDzs9vuQxogr2q3R6bpVNzul5rgh5vvOeEYwS3DEBrDG\nZlYro9tmEv/Qo6FWbdvmZiqZ9hHn+Br2sso3WHLWF64S5VzyKtixqvJ/mQHp\n4WIsMsEICVOefY+L3YUIIm26Rtj/iI9VIo6pb/qUhujv+b5w9sxrUNTcC+zy\nOsH1o1HQNEyWKWYZDyeFn97bAn+bjb7rStCtRT6aBXXNXVnmvQG8cSGBz27R\naCJYuuNDmjtq5m7SkbyzvHD2j2fgIfa/dM3NrQrgsLKYchI7PHpWxV6fTnwE\nP4H7n1/a4hEnDBKdzYg6cYQIKwkx5ONh/SYQA4Gqz/CDJVejHQyunYvj/0C7\nbbaHRhtr0jNt/DghMw0dn+UwQIiyxoBfYcmGvc5woEzyI3RKmMyftg+pR3am\nvN72l/8M+HB+iRlcwUSFWNlbbHlwyBHnGViCbEDI0VviXKovSni22waD/U2y\nRc2QqCktlHefimowdUp3zfhkoUowcgVNj4f82gyS5vHqVszCPLNeQD969EgV\niCZm\r\n=p4ok\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1c429f861ddbb35ec8588ea55cb1845296ab0218","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.005e86a9b.0","@material/base":"8.0.0-canary.005e86a9b.0","@material/shape":"8.0.0-canary.005e86a9b.0","@material/theme":"8.0.0-canary.005e86a9b.0","@material/animation":"8.0.0-canary.005e86a9b.0","@material/typography":"8.0.0-canary.005e86a9b.0","@material/feature-targeting":"8.0.0-canary.005e86a9b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.005e86a9b.0_1596132056131_0.7039783387632488","host":"s3://npm-registry-packages"}},"8.0.0-canary.e309c7c68.0":{"name":"@material/tooltip","version":"8.0.0-canary.e309c7c68.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e309c7c68.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db4488643b26765868503c293f85ebd16cfe7a53","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e309c7c68.0.tgz","fileCount":42,"integrity":"sha512-yRLEsZg7yxrWRi/FdFqfsR2lHQwWuy+tW5fVc1bTyfUPS54RYZs4WL/bJkYCY+SP/uvYVPL5cVU3CWKFkEi2gQ==","signatures":[{"sig":"MEUCIFbwnZqrmmQGJ5yYOvaQSpfOrQpzZzks09YOZDGKg+nfAiEA7rrDKMN1H335g99M6KwyN41a0+QCdjRRcAizzisXQoA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIwzeCRA9TVsSAnZWagAAQt4P/iIm0erXOfHqwTlqHyuQ\nFZtWN8FHS7zo99lrXzFvyygAE7kVnse02PBz5e7FHI1/skZfdkt/HBhxfCP9\nra5pJD4CPhGl2dv7kc9MlVf/FCzOHIaQ0NvCXJfCG88711uNpptQzL0Hg23E\n75EgX6hbVKcb4SkM6JkHjYSya6qVE+nIlZzhVlVgHLHYXwj0RH+VL8ZkO4wf\nJ9qOOIjTJNLLfjWeBB7fftPLdzR73Jk5e1gBlA7BKlpEDeCs1yf1cx1AQhmu\nWxxo4IGZFJTt93ZBzic+vGNLZ/ygxDKsgqL1HuLYRiA4JypWeiV7TpQK7J7x\nSJ3vehHNBU467c98Z8zUNVMeHOaocL04YwBuvcdYc4DUS7EgpdZ9CujLZEgM\n2AM2jHNj39gFHWo8LI3MwlYFR5ImrpbD1lnflg9Bu54nTrBa1QOv8R4ztsGY\nO3uP/9/4DMpZQFVHcLfzD3pQ40Dy81GK36d/jBbsJLroWUr2dlrsRbYLm0uA\n7tvLzYj4eNZRbvkrhFBdoSj9jzdlVj6h60bIOr8vantTT25pEkR3ZySRrtBx\n1/Gr7Jjhs+xhis1dyIRNQrLE6a4mXAPQaYH4Cq256sHZh1L8N6tNazvvuktu\ncyrp4zZaQ6oARJzaENEcnezw/oUov+DtGBtadnCBP/E46Ec4Wa5JXZ6C4VDD\n442/\r\n=hmkr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3ea460933f859061781daca3ae127802388c28bb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e309c7c68.0","@material/base":"8.0.0-canary.e309c7c68.0","@material/shape":"8.0.0-canary.e309c7c68.0","@material/theme":"8.0.0-canary.e309c7c68.0","@material/animation":"8.0.0-canary.e309c7c68.0","@material/typography":"8.0.0-canary.e309c7c68.0","@material/feature-targeting":"8.0.0-canary.e309c7c68.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e309c7c68.0_1596132574480_0.5623438249035178","host":"s3://npm-registry-packages"}},"8.0.0-canary.935a51cc0.0":{"name":"@material/tooltip","version":"8.0.0-canary.935a51cc0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.935a51cc0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0106ce6325b18a7ee642cba5241603e15e6e32fc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.935a51cc0.0.tgz","fileCount":42,"integrity":"sha512-bo7iNeJWAYQUg/OBO2T5tVG/pgFz3WrJLvCD4Si6O61EMG+qM9W6RVJipcAAPKVnX8eEDTtZXa1RdxWya8/nbQ==","signatures":[{"sig":"MEUCIQDuyDpI7wi/Ilyoluut2WI/UocH+ze378nyozOcHgtHYgIgcjC64gZ8dF01pCZyBgojSuROpf9oQPtt1aOLUvOJ9Jo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIw+XCRA9TVsSAnZWagAAdXgQAJel+4om9UPYsMNaHoaf\nz2Di56zUyTpsVLlYGv0jujGCoky3kc7k4BPh/GS17U+3XXTPky3g7EiS/xzG\ns2Q6bc4aF6S2WJdKfflTab1zB8VO/WemwnsNxCkBtmNDe9whez4Za3y4ixkP\nSvMXKM+Yk5kpKfPcgRrszHbCgHa7wvufXlH0/hmfKP/ehFY2HAcpRkqH5hfV\nDoGparBx0Ve3X1gVtT/K7cPRBNNH9NhBr24GqP6sukaUFME4gBfsvxzVFPyA\nypI0coSMZRt4GmotKbN5ugU2bvIr9oVgu2Yyg4S05x7v7Qwq6w8eInSWvYpi\nWTm6OvUcx3sgM2tmQv8RZzUIhrqxq2+rukLZQQhcfCt9TcLdGOI3NX63NAkI\nCMOuSDRTdxfFrWw+3nowM9pB//MQqsyfEcZl2igzZKIUrO6dIhUNLFU9QzwS\nn8IWM144jvKUWVz39n/uafmYKtQgUE/G46LI1G6jmDGteL9c3c3JxMKr2yR5\n8HIsOedmc2kV7t/YMcgFocgqGtjc5sidzc/KmT4dfNBCPnJArUnc+4p8eCLS\njDlE/gZiEnsFIP4nYD3mhRHLynLvsTvmlR7WtsDwANDUWGmeGscLSjSITYcm\nNFbguN8p7/7nncrtUBGkiFeKJQknxnfMHmK0qgY1MJPldpNsBh+okstVvX3z\ndmvv\r\n=Mgw6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"79622070723d97d5c4052839435f92189e8fb6e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.935a51cc0.0","@material/base":"8.0.0-canary.935a51cc0.0","@material/shape":"8.0.0-canary.935a51cc0.0","@material/theme":"8.0.0-canary.935a51cc0.0","@material/animation":"8.0.0-canary.935a51cc0.0","@material/typography":"8.0.0-canary.935a51cc0.0","@material/feature-targeting":"8.0.0-canary.935a51cc0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.935a51cc0.0_1596133271367_0.8175907461791239","host":"s3://npm-registry-packages"}},"8.0.0-canary.74839da7b.0":{"name":"@material/tooltip","version":"8.0.0-canary.74839da7b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.74839da7b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3f13b7a3742c2ed833f999826d5c1e4f065fb778","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.74839da7b.0.tgz","fileCount":42,"integrity":"sha512-Y2G1AMG3v9ejxhZSEXIWGkTVsH2xQfoXQvGGLtWcDe5UFneT0zdohMO3GfsBh4OPxKNsDg9PMAgxFzUmtQZ2gA==","signatures":[{"sig":"MEQCIDpBokHnalr69ru4tp4w4Sz7DJcNOLX15N6QB4qTm+2ZAiAojLzSYIThBZZrMvExEQ4yFaOpir/miQB6XqcOBn5xfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIxIzCRA9TVsSAnZWagAA3lcP/0I2qC1L3Lyf0u14L0As\n44icfJjZNScsvY+mWQHvQW3b3/hvABixh/kXQKsSSGeSO6vRnkSdonHK+aAP\nADzav4eAqGIUpE121EvbFb504b30ppdHvZNNtcFWQLCUAsEBeTz6sIfEwHtN\nvDSyI09uY/Ur0PWHUm+slBfNWy6eYDQohJHdhnlZqsG61hZQ8MD3nw6A6ycl\nSidy5RW22b5M1KSiltxLF3sMdDwDcS/qHvBPYiQims52sVp74CLJiDxsCowT\nXm7WHsxOaUAp5mVJikNn8V+FOh7OjMEFxBf7ULT87K7Oc9NcIs0UGR+G+k7e\nkmuz4oJx1Bcg4QfhwZWi0u7lfFbp10lM0INRK0424WaoE2m7ZRg3hiE2aL6e\ne8lsRRd0Fe/Q2tDN1P2wMww9ZPiSX8ImN4ZBVpddZIfv0flwayar30hbh8e0\nMzEHwtQyXBdTmAZTSXRyQwkkor2HbdVzk5uFjCTOH8ccsIUSoYj3dYPWb7h5\nE2q9h7uo3/HpcpnIka8T/4tQsCLnQvq1aIZNFvHQfNxgCUyemTXE20xFvy2E\nNXWSDTMoBDAg1++g1JLKw5sbqJiqpQ2bNwtKXo0Eer0pzoNqVYt6bolL+ou3\nXNF9vYOhlwaSDXIPxl1EmYRBQ6JhwkM37BFazBWdQGHktR6P5F2iy0F9IDFI\ng14X\r\n=jXgl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styes\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ad186768bb65467a86f70e827e74fee089e25811","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.74839da7b.0","@material/base":"8.0.0-canary.74839da7b.0","@material/shape":"8.0.0-canary.74839da7b.0","@material/theme":"8.0.0-canary.74839da7b.0","@material/animation":"8.0.0-canary.74839da7b.0","@material/typography":"8.0.0-canary.74839da7b.0","@material/feature-targeting":"8.0.0-canary.74839da7b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.74839da7b.0_1596133939285_0.6783460877671317","host":"s3://npm-registry-packages"}},"8.0.0-canary.f041a48c9.0":{"name":"@material/tooltip","version":"8.0.0-canary.f041a48c9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.f041a48c9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"359e324ba22fe1323dceb2fab2ee7e2fdf135139","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.f041a48c9.0.tgz","fileCount":42,"integrity":"sha512-GCRb84oj9ydV8X+7jvoH2Eq6mqgA5mMLGeZiVGGDTlDwVzk6SHfrTttC0t53njRTndOsTmw31PethRiN6mZHug==","signatures":[{"sig":"MEUCIQDENfLo3gYfnasOaR11ogwUkGXEtJ1m43doB0DHiJdCQgIgFBJMKGgKGpJ2LSrYt0H4iGBLot15P1iRIiUKzZqZHj8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfI1EUCRA9TVsSAnZWagAALYwQAJXdl/IQ9nBwXzTH/exX\nocbB5lzxA7Md5eSIzxo7PVp2nUxmq9fAr91aOGbsu2HPrTkQJyM4qbDbA/9F\nbJ4hXz6TIFxiYH1tjlBVR/SLzNoy9bO/aImeoDFK+EebDMp1i2Wp84uHm/Jz\nwW8lIv+1Spjvap2Vk0JI8Su0ZX8qAayLLfRJ0Tw4rA9Sgvn7VLzU3AR+2cHf\nEZpnJ8DLOUyUPnbSgnkp2djEVVJXdG8V57T2ozDgYFygJ8gkDB8C4LhJtOSc\n8qt0hOTK22bw+unAuQNIIRzGcpI92awxIOIoEZlk9LxtI+lSOKlEua9w9gJf\n1+CA4cr/AXFT6pgRRxhFi87CZ6t74IrJelxrqZ88tMTBEwuN2AxE8kZHUzBt\nQWuMQdQks2r029avGvCDPX3D9SoPzohQoO95jv0msAJQqP/Ct+TkWsmL/y2p\nL7crJqHu724VOQZH5KyTsjgaLJ4/X8s4jbnbEOmzYj4tm/gHg5qprC/kiqmu\n1WphoMYt8t4hS4nn3VlvCWEHcGbLRums6wzYnVUNYhWwwJaYcxeZQnKg3lId\noSZCFSFVBXTeRgRHnBMrg/LJ97tIj5jIU2lgWUd3ol4TKqOqUKIE2Y5+mr4s\nBcKDANviLriCb3caXtZNYLJ/Ywg8iTdfZ6IRHpEkYrB4fx9GT0BOnxCDHk+E\nFB/9\r\n=FNdh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e37611a41628785b7c1266cd53abdd9da0208c00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f041a48c9.0","@material/base":"8.0.0-canary.f041a48c9.0","@material/shape":"8.0.0-canary.f041a48c9.0","@material/theme":"8.0.0-canary.f041a48c9.0","@material/animation":"8.0.0-canary.f041a48c9.0","@material/typography":"8.0.0-canary.f041a48c9.0","@material/feature-targeting":"8.0.0-canary.f041a48c9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.f041a48c9.0_1596150035882_0.9242224031000115","host":"s3://npm-registry-packages"}},"8.0.0-canary.fbb1381e1.0":{"name":"@material/tooltip","version":"8.0.0-canary.fbb1381e1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fbb1381e1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4bdbe15a70deb5b04ac1bb4b59a1c906750fb58e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fbb1381e1.0.tgz","fileCount":42,"integrity":"sha512-OK3jz1w8JzIGJZu+BE3qxTad5x8CoqLL3HAR/HcdHix5NwzuPZ+SQD2cgR7e7FA+E/xrY8Et7W9j7VBDC1pTTA==","signatures":[{"sig":"MEYCIQD5vIeV8+18EZgeb4PbezLwaXfuB0TfMGQFfFbmFkyNdwIhAIvVK6WgyBmIsbHu9PNTYi3BLEJSq86CS4ezX53iwNml","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJD3xCRA9TVsSAnZWagAApaoQAISHjVXbhyY+q6D8ITJ8\nLUIi6QexKkHLC92N04BsGDSTGHbuMlkbBbZA/WwhPAPeo2HE9D4PMYWbR+BN\nTZq4XqglphAj/EExNNIgjbvhh2euHF3Kt+BaZMw0r/d+mXcfBXZyh2i5kXaH\nURKTja8ufUPm0Az2wPPwra1TEBT6NrspThRS0Ff8DRlXWC+Icr6RK7GoueCr\nzLzSW/u8L5/Upi3dnySV5bEyPnJJAAKFdzVTyr3OzMY/V+RGo+1DmkAUOAXx\ngqvyVbfdGcMF1tRbkTTbHlp+sd+i0T4f6g43SBrRY9irVe4e3950t7nXF5KG\nmmNE1lTiiiU5t0rNfOSPX88vw549saBvMBoqN75uvEK7x6trcQ2o5yhjMvKs\nZdmIILY8GArobOmchii4cd1K9GRgVossNZ6Yk8Ke2Zml4Ki/Ynp2OB6jlrSe\nHuA6lbZ5qDt8IlLfSiH+0zouoWB3XbVi9nJ2G4dca71jC5DgY487cbyQ+EpL\n12IYac7IIh9//RM3ZleMltd2w754+3kF2ugWMknYVPdHGQtLl37V/LcR2zkl\nUvboE78fOqzJl2bkxLYLOoXBay+CMp7UcQoK+zeU+eIktQe2WHfPeClpAoGE\n+K56IgDgXW4DESdM581MLnA7PDErD/fRmpUWbsbgW64BwLVGia/Bstt853ex\nFoWd\r\n=oKRt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7c42a890f9b5f1bce3c7986f37f806066e6e30bc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fbb1381e1.0","@material/base":"8.0.0-canary.fbb1381e1.0","@material/shape":"8.0.0-canary.fbb1381e1.0","@material/theme":"8.0.0-canary.fbb1381e1.0","@material/animation":"8.0.0-canary.fbb1381e1.0","@material/typography":"8.0.0-canary.fbb1381e1.0","@material/feature-targeting":"8.0.0-canary.fbb1381e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fbb1381e1.0_1596210673478_0.8356642440276072","host":"s3://npm-registry-packages"}},"8.0.0-canary.7f61d5785.0":{"name":"@material/tooltip","version":"8.0.0-canary.7f61d5785.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.7f61d5785.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b3d58faca436a81e1ee3d4291adfbdcc6a5a78c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.7f61d5785.0.tgz","fileCount":42,"integrity":"sha512-nrITlDNi7YpGOuD3QqqsjWkAapjeAng0ps1qApmqNWhoBcNNVM1JziWDWKiszkB1N9Dtma1/RlYKYRysogMy9A==","signatures":[{"sig":"MEUCIA1sBQe+saP0M98muGUuybi193aRtgj8XWJHnCHDXDn5AiEAzhUZh64WU704dtxgR9/fsptD/ZigM9VcukZa/p25Lnw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfJFOjCRA9TVsSAnZWagAAoZcQAKB4nXrguyesRcrysEWR\nngm0nln0L8c0xNge3AYP6zGAamTBfv7EcC0BRwZzWcaGHs+gwkY/PwybWwL8\nRVbPR4rTXALOi1v6z9nACVSRdsecBVPLN1/nVhs4zptIEOfPelN3xOn4oPuX\nMh9mOC/zTi5yecLd5o9jBRh+Oogy+fRXvBzo6OYUybadKXOmwpLcNdk/7Jzh\n5XRJSvCqQ7uOK78qHWBhWgwUQVkBXmq/xcHbnhdfdG45B9FdiOmzyWq47gK2\ng65v+HlvDSxJBPw18KetCCcjYcq3ESF6+68uWPPfwM1q51p+lF4cUltScisg\nXIFEkjjDeOdAnHxAmuy/Wj8LBxOoyLWeSEyeThbXVm0Xa1mN91NdTtSWRUyy\n25NUvYVmJhsp+5fVaQpLW1ZXr3v9GrS7m18QrFSeGhFHqWSoofuPrDd7Rhm7\nTkdjp4cv+WUQ+gDLzkvLOKWnqx4ZBrA4piP+KDffOILzSpUFz2E9uiv99FCq\n0YI+lMjZ/F+ia/Tn3i2vaaFvl1OzhXMOL0hW1ViqZW9Ol5bfGaQIHGzzGT47\nztMcAdkpsv8F57HU9s+9UdrUHHduN40i5NkQiQXzk74SkwR8Tz5LqXPvwW3D\nab3P4myWcbPjlTZJdIFviyvWz4oLqgKvgwQ5WuXpP7s8TTRztpJPBcHv34/h\nBgEL\r\n=5+G9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"beb77eaf7ccf3f03c6d830f96485010ea9e3d47d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.7f61d5785.0","@material/base":"8.0.0-canary.7f61d5785.0","@material/shape":"8.0.0-canary.7f61d5785.0","@material/theme":"8.0.0-canary.7f61d5785.0","@material/animation":"8.0.0-canary.7f61d5785.0","@material/typography":"8.0.0-canary.7f61d5785.0","@material/feature-targeting":"8.0.0-canary.7f61d5785.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.7f61d5785.0_1596216227080_0.6745440702636292","host":"s3://npm-registry-packages"}},"8.0.0-canary.e1bc84d10.0":{"name":"@material/tooltip","version":"8.0.0-canary.e1bc84d10.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e1bc84d10.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef2468edbdaa37a8bdc6a930ff819c01cdd396e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e1bc84d10.0.tgz","fileCount":42,"integrity":"sha512-7yxCoLTbej/ZpA21pPwg+87nP4RXpb4kPaZQpLBn6kIZeL/9hVr3Qd8w1K09czNOr0jWRQeG+R9nGZ1EXYU41A==","signatures":[{"sig":"MEUCIAJx99b7P0qJd8O0VeJO4vCspSGrD+zawH1dromNNanqAiEAjn0yvHfMvcjpfoNTCNbt3KHp/PtgavhPPC+rVcT4uvg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKE6tCRA9TVsSAnZWagAAEkoP/A2xvtrdePLiVFegGiXZ\n/d87kCyJRtSLXAosanONarqGD78WqRFDDM3pHxe2vgGsgh2H/iThM2BjHngG\nkpv35hRUy2B0F78B+nif112jvt5CuI+T5PGGPQzvIzDdP+4R/w7Ptaa2h0Gq\n48Rz+WGO95OZsbd8gCPLwtgelYtMBjgOozcY+3y1LYGqYyu0f8tfX424cyDV\nHV/AAp6lW6ZoD4n4UOEIdiHfRncZw1ltou7IuFV2xfIJlTTmaiXr4mJ7Deq1\nGX9Pu8sAwzAGVnaC/CmgOljy596kS7Z8neC1DNFxBs5DaFG0T/8lsl9fMQqT\nWe8Ng9rgKitYU4cLN3Rdae1O/KA7kFSRaRl1/m8ElvsqgMnMLGxqA518/ZOG\n30F7rKMCltiw1fFNDR9icf3LZLn5+t8LWmZaYUprXT4SRIwLXxcAUK75xxzh\ngSBPA0J92UorrHbH/1GwDof319aaM7yb56D7tarOQTvFf8dLg1AEV/Cj6xYb\nA3LJ2kFHurNucSaxU5aWq6P8ZnVH6W36LIwHg6fEt4osIbtmSdY0V78G7KPk\n8Ran5aAE7IEiHNOPyTZTVpL/3mvRjSJatNjj+PCga2cSQoQS5KNdXaSGgS6z\nr9U9FIMNecyT5NFa51ecGlZOchmVLQ2/ZaSB67giQ9azLKGTZZqV1J1oN1CB\noPwP\r\n=oVwf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4752dcadba6adfeb006ee3689e295db016f4bea3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e1bc84d10.0","@material/base":"8.0.0-canary.e1bc84d10.0","@material/shape":"8.0.0-canary.e1bc84d10.0","@material/theme":"8.0.0-canary.e1bc84d10.0","@material/animation":"8.0.0-canary.e1bc84d10.0","@material/typography":"8.0.0-canary.e1bc84d10.0","@material/feature-targeting":"8.0.0-canary.e1bc84d10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e1bc84d10.0_1596477101306_0.9991105966625022","host":"s3://npm-registry-packages"}},"8.0.0-canary.096a7a066.0":{"name":"@material/tooltip","version":"8.0.0-canary.096a7a066.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.096a7a066.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef6efc253cba4a3e3abbb9813ab64d49b4a31905","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.096a7a066.0.tgz","fileCount":42,"integrity":"sha512-oYP7mNm4WiodqvjoZHIC57iECf2nGz2V/B6Ol8+l7euPLRh8o90CBxpFjco6SRnpmpbPFyIFrh+h7S3uNrKl2Q==","signatures":[{"sig":"MEQCIAOs4yKIUHXQzTHqAXpsE8um6b9yvsLVVI1Kh+LTM87JAiA28mKo5fQuGTkmQUUb1rdKVg/Z/XSaqRSxulqdOPmz3g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKE9kCRA9TVsSAnZWagAAMxUQAJjB0By5Td0ic2wHDJ0m\nePIjZG7ztuqNZdIwQU9PQOREBgcYgLLhqbtuIR7DDQHkDmhPKdKSR8Hh/7gh\n7QlACsIuqbMYEMg7emodntDc5IlO6ZHp13DXiD4XvFtCu9sdCGsRCISC2biE\n54gcT+YOt/MXJpaT1el7tltiWkfAShggbeg9GusaLkY6VGAP5j61oRbynSLi\nT8AcfVa4iEXaPuS6UB9k8Xges0oJw22PEy+RxNd8oPAjipE3f0xsqs8qVZ8h\n5mBIWg5Ped1Py+h1ZZmH/1HQwcfbF82JfXEOmdy4ufKqlzfbyMnsqM3Ir/XA\nHijG4/Blzi+6LuFh5eM8NK6wRiDjE0m8via4d/YSkDci6HaYCuaNQRZewceh\nBv4iZS8JfpHHcYMbycQOzuCq22GxssPhebwrD5mTj9QHg57tryiMxcsE5+NT\nIcyA5q05LeGc02OBXdWqWAG7T9WNqN7ODJsC05uIhTXtjF1Ro+xZcLd3le0l\nCVZcL42GPxikVjacTdy6rOsja5vxdqgqT2rMIOU+oPQFLy39oNGTj0+dMC66\ndkj4WlD4p4hismWvXPNKDCjidE8MhQO/4c16tjewgJkmW3+/Hr1L6PBQh/ir\na77A8eBqxW63sJ02CtiTy6F6I3S7aScpxTyRXFLyg/o01thz3S2G8FtlHhug\ntAKU\r\n=agCd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c1f4491c464cef40f62d03f687af7b443805fb7e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.096a7a066.0","@material/base":"8.0.0-canary.096a7a066.0","@material/shape":"8.0.0-canary.096a7a066.0","@material/theme":"8.0.0-canary.096a7a066.0","@material/animation":"8.0.0-canary.096a7a066.0","@material/typography":"8.0.0-canary.096a7a066.0","@material/feature-targeting":"8.0.0-canary.096a7a066.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.096a7a066.0_1596477283439_0.5599973396158073","host":"s3://npm-registry-packages"}},"8.0.0-canary.aa3a3e5a4.0":{"name":"@material/tooltip","version":"8.0.0-canary.aa3a3e5a4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.aa3a3e5a4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82f3b89219093758e4a979a88ad2000bd330cb23","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.aa3a3e5a4.0.tgz","fileCount":42,"integrity":"sha512-74h6DSY+Wt5KqmCoqiRKImOB0Y3sQjfGwAP+f7fEtrIL8FHoqNkijS09Oafq+W5qqLdcObBE3f93RNMw/Px47w==","signatures":[{"sig":"MEUCIQDdRbDI4Ekxt+65gWM54B2e7nV+SlYit8SMlH0A15hkCAIgN0vr4jjgeLSagRi+Ag1lnIDkdrNf/F5fT2Puj2lQncY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKE+NCRA9TVsSAnZWagAAW/0QAJqh5pNIhEMBD5YM2oE8\nERRe/rSTA79RCqUBhZ4363ru3PzPiPbMKkDCbwzsKUjN6pfA90I0yiBF2egJ\nLE8+PdFmon5T+BHY3etLFC9PD+et7ABRmRpKWmw4hGRFWrl18tpP9bPOGth1\nunQ5Y7iV0cGj5bzExf+sV4Qcv+netbdALrKaZKyRa3UJAlaJ+soWMPxhy/UG\n/IQx7pP/EU0EP4/N9DQlvkEENPUu/lFH6mLVFjGp98G1W5uMYuGuJo+gNfXM\njw7VXFLbIEOe9rCbm3GXltHAQdfVOEIKh/j7fE4gUnMkVECHcBkmwXXDqGBk\n88qgAJbWtDxovOlNrosHX5h1ZkWQ8gx/y66EW2EBUE1d/RrBsV4ZiHm3+nQO\nGqtJkgOLjQQSj93pEJps4M62aW+u827+P+9krNWMn3882FjBEm6C5UOVNBPV\nNLChoAz5ZVllK/Fe6ANoqeDyzvbWMUK50igHVyTWPg9lG/Ka6BYEE1B+bmZj\nvnkN+LEYxc7RJl/sFzroE3g6Um2+58pi5kvJall1uNaJEFhFR3uxfRsqJ1jH\n14RKnABtW3C/3a0B0etP9SA3idU78TSh5lHBacWHB0LNqbqDhjXsQBpfUAFd\nkMX/fWn94JawqRb89PZe7uGqRcdP+bHRa3++b3BFk3VJ/7cXVw4RNEiww/LA\nAjuu\r\n=i3Vh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8e25515e9c171e19310cbb58630a760408b78c80","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.aa3a3e5a4.0","@material/base":"8.0.0-canary.aa3a3e5a4.0","@material/shape":"8.0.0-canary.aa3a3e5a4.0","@material/theme":"8.0.0-canary.aa3a3e5a4.0","@material/animation":"8.0.0-canary.aa3a3e5a4.0","@material/typography":"8.0.0-canary.aa3a3e5a4.0","@material/feature-targeting":"8.0.0-canary.aa3a3e5a4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.aa3a3e5a4.0_1596477324903_0.49904105782270247","host":"s3://npm-registry-packages"}},"8.0.0-canary.5903d39af.0":{"name":"@material/tooltip","version":"8.0.0-canary.5903d39af.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.5903d39af.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f0b88bf408375e55be8160007d157c7844069432","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.5903d39af.0.tgz","fileCount":42,"integrity":"sha512-KUodKE/BJUbm5uI9HOTvB4LJtccBzMetXKNMP/ObInNdsjwNKmHTgYG7XD7sPYAWlz6vOAOSPgdveCFun/9BYw==","signatures":[{"sig":"MEQCIDuof0TutbJirt9IIT6RDpbEfrWcRslmjJXdlAfs3CopAiBT8oszadrv23Fn+r64N/7RDLRFU9wfrLg9tthaaqqP0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKE+aCRA9TVsSAnZWagAAh1QP/AnI1y5wUc6AG/ZXcCvz\n+QyQYRlEWs18WekchTYiNUAbBXx+43JJSjyCOCON57cHVfsG79e5cjVFtp0d\nkDdO0JqKawDme9wFmIAl9V8NP6GSZm2Gtoj0sfQfh8wstg1EpntEOesHhEy7\nYEKfYoxGWhzEq9riOOwjpMVSuNbhoFFupcpL3rWwOxXatta8A/AMzN0stQmi\nsU5pZqhsqpGnCQsiEtRQxxb2pwxmTR3Slq46/EwUBq8t7jWq94+k9sPR479s\nDtoQRjsoK8skBFEZtskFbuttQuh7MPUNdTkyxG/1YV+2hop6HAyUjOnm+kBS\nG2Dprt5zRmMMbAKltBu59q6MniW5dbzCv3pCNZcvqku86VJNmtD7B+C3z+Gp\nFnKK+YkkQm0pT+I3qf7Vpq+06WeZuEjZLDCFWTZyzt08G9CnZuYJykVnnZ9X\n9MlUPwq7x95OJMB/bp4w7Muj3QAR10lY19RXqPhFcI771yroQ3bylB6MeKJM\nPeH4PC6ZdECNrXr+Pu/4BydQ2TCH4MOLAtuYEVs5N3EbTZg4KzEvJVK5OzrD\nHPP5FzzbseOXX055Pl7DujIeGmboFkyRHFGufBmlKEaFfToqRW5pmXTrdYpe\nvFgElidIOR9Hc49S5qSYcOKT3R1+Lj0UoNXad/72RLwpxGD+cVgYG7zXFsqZ\n7A1R\r\n=kzQu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8a4f2eea8ac8483e7e0a1c93b141ea9dfaebaf4f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5903d39af.0","@material/base":"8.0.0-canary.5903d39af.0","@material/shape":"8.0.0-canary.5903d39af.0","@material/theme":"8.0.0-canary.5903d39af.0","@material/animation":"8.0.0-canary.5903d39af.0","@material/typography":"8.0.0-canary.5903d39af.0","@material/feature-targeting":"8.0.0-canary.5903d39af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.5903d39af.0_1596477338562_0.6645475072917828","host":"s3://npm-registry-packages"}},"8.0.0-canary.72258f898.0":{"name":"@material/tooltip","version":"8.0.0-canary.72258f898.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.72258f898.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c8d172dc2fe90019ceb2a62d8c4bfc4169b88817","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.72258f898.0.tgz","fileCount":42,"integrity":"sha512-KowQIq5vCbq+MrlazLTYpzawS7atzqbInvGTWqwEp60j7pj06ZrrhME4MoPa0CswLsBU44A6OS4DaQn2xB7+BQ==","signatures":[{"sig":"MEUCICIlExlDMjVQk3BwwkCe4MKx5a7C23dCYh4ULKoEWHekAiEAwaRPma7AQYIMKNToWNS+KxE/GrW+SImGq739QI9TBlc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKLdUCRA9TVsSAnZWagAAWhIQAJAXF/ZmRUV8YVa8ndUu\nC/xFvnJauXFyHclsDRYR4eKaBnqwzog7z/m/sf5Urqf588UGIO4a49YFxz38\na+gShUFsEQwUKWMdNKug80g05/nft4Wa/MzLO+nmdsHILevpWMfqRHzD/SSm\ngzuQt4/54sLqerhyzPP8c4s4uSCjq6EHXz6PWr35Aju0Ov24Vv6mWL2vBqly\n8tfkVVNlkuDTAUDs1zBaVP3U8mbGppyHHezbGQxBhCSVTcWb9oqLHIQbIuft\nUReypXHLsfWk/ZfpHPD//HQHdkJ6hZPIxtxpn9b0HzGqMfl78b3agkouqWe1\nBrEBConYiRd30G610/nfUeI1UnVkm/orKUsG9MdrGHIRHHUEG70WHvZQps3F\n6PSpS4N13g5JzhE8Ru/LrgeFhBEwiGiBzXHIqg6sx22EyHfCynr+MpJ8gvBN\nw3acLPT1toKdzvNRgcFoxSLx+5MZH9bIGccPEQ1MxwxDYbJc057Em9DbELs1\n/Kg3tsyNwvwYQbya2SaCWtHt6wQTpU6WS1Av3k8YuHokRtd5eoaC0Nkre0OH\nzREflQRSrIwjA3zjcsrycj9KTt/OsNdlZ8TgBtQnswnRpLVNJ0602zQXhsEO\nhWZRz35i61ZuDyS4U8GmyPH9NhjqL1S4r8HbUzFyjDxWJaazH5ogJb1gIdEI\ng3UO\r\n=VvhO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ff2c64799ee2d684ba36b9cebd15fbe0d0ed17df","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.72258f898.0","@material/base":"8.0.0-canary.72258f898.0","@material/shape":"8.0.0-canary.72258f898.0","@material/theme":"8.0.0-canary.72258f898.0","@material/animation":"8.0.0-canary.72258f898.0","@material/typography":"8.0.0-canary.72258f898.0","@material/feature-targeting":"8.0.0-canary.72258f898.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.72258f898.0_1596503891929_0.08333127081690495","host":"s3://npm-registry-packages"}},"8.0.0-canary.1b44b43c8.0":{"name":"@material/tooltip","version":"8.0.0-canary.1b44b43c8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.1b44b43c8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b5b6c69b0a496a21dfc984448c4a34277c1c1d7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.1b44b43c8.0.tgz","fileCount":42,"integrity":"sha512-IE0X8VL2nqwbBV8QJrAEDxE0rS36Hl3lcW6eyyfn6JeiU2F1gxxZXbqQO73nurkMwsK4tTmsRME/i0Volyvgrw==","signatures":[{"sig":"MEUCIQCVaNvo76uuNiRnHDvL3vBwaLBEljp3JETIvEg01Ua/bAIgZGf2esjaeGbK590Bdd/isF0HPbH12MBnfhuEhhVJeDM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKZGMCRA9TVsSAnZWagAAZIsQAKBfq3zq95/RoUw5EWaz\nZ5V65XCVwnIQp8eGrH41lRcgatS1dE5Mq/VV3m+xc89q2Q7H4qN7OZnH2evn\nx/b7Od6ec0vSKVo9UKjklMy0PgYJ56KnKpfT7fIRmTh3OcW3jePRAYcpJPDL\nqWolm2G0qs7NYisGqzvYtxIxUU647it1XcfgAGvAJGqkmoCIRO3N6k+qQMWj\ncnofjrf1AjCMmF4Te1uI7v0i1FaTyYhK5ZaDRTElG/5Ucz7O+7PT4X+skeOg\nAnMAuqsYjlSkhhf5vnhcsULIX34azcmPM/5c+N0QGx56NLZFjuZjR68rF1km\nWhZvlPM+u2T9d83gbcDr/hfDPalyRJvsCNy6JkGg1uf8TVEWYjDjnfmBskA8\nxNOV2Upv4t+p81PgBsnvQTa+DnII3F3i6842eXjskVx723YRjcZMspbOk5jZ\nx1TJXtniznwaaVV0PhPexF3gT3FlvVMbuQkI8n/oG3SxseG0ZHlzMdzbnHhj\nL46PZALi7QwXf7UUlhbjk/xn7wOXvxnpcLs0fXHpYMiZFoTnbO2sytibvTXg\nishTemEMyt22FtDwxaQowAgE4pOqkN4FbMoGJZpb9K4D1njP0RBdI9qAffvc\nRsjDHUkfITtbtVW86LVeT87Psj41Dr3h/a1AjDAz1UT7JbcDE4az0kpeKmVO\nWO3R\r\n=08SY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"69ee70c646249b45b57e59e958f1ca6d8332dec7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.1b44b43c8.0","@material/base":"8.0.0-canary.1b44b43c8.0","@material/shape":"8.0.0-canary.1b44b43c8.0","@material/theme":"8.0.0-canary.1b44b43c8.0","@material/animation":"8.0.0-canary.1b44b43c8.0","@material/typography":"8.0.0-canary.1b44b43c8.0","@material/feature-targeting":"8.0.0-canary.1b44b43c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.1b44b43c8.0_1596559755648_0.32315601797611593","host":"s3://npm-registry-packages"}},"8.0.0-canary.e9d2e2f96.0":{"name":"@material/tooltip","version":"8.0.0-canary.e9d2e2f96.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e9d2e2f96.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eed59ecd77ba0d31ccc00a468021e642ab86eb90","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e9d2e2f96.0.tgz","fileCount":42,"integrity":"sha512-+AsUBWUyu2DXoSQNBhG1JN3qffDBIOHpEijFHftcqhWuiqjRCCWWI3haQrhHlGUtSJBdepeg+0W8b0u4i+R3LA==","signatures":[{"sig":"MEYCIQDvOUDISg8uOWCLwsivp3ZmP21bd4Df/cVTLMUnK/mN+QIhAJrWL8t6DX6Ipk1e7hCVw/XY+b4d/SAFbPPNtmcGpbix","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKcQdCRA9TVsSAnZWagAAdgoP/Rbk8lMCsIUSzV/oNxrD\nLN8+tebmdl4j1bgTGn6FkH4YOWHu9qMl5vUyRgeksqzYCtxkNQYlIUtHaFku\n54iJYsrD0KbbghKHQixM/FCIHv2eoIfqBNR1/tPik4qZYtgzZtamANpdwVD2\n91pDCbRzixW7+yPTyijSd9WzQYUvz2XzfR2qf6GHdvsjJ5GXaX1NQq/gErHc\n/YQeHzcRLoHzc/kePb5O5epKjVTzxULKAYEsTpieKtWuQ4EgTh6l2grenRAu\nulRvo1z86pYfpIU2XBB5BhVO2cnW4f2L0HXf16ONf7g29R0tPnTwu0nem/8P\nQMjVJrS+Q2qXjit5SJs+C86WQLTu3VXuSz3otMS3sSdet1vBHLk5Lo2loce0\n+bxViZWjaPerHdL0jEAZVfB6qe/BklW1zyLOcRbG+GFDnYSfCXDr0s+Fjj4i\n1Ky/M/SzZQaKaaYivBJwzJLdCBKbcKQzcDOr6YjfpODTaOLdTG1UAFdeEDfD\nC7ooXKopGtckBobGMiaTNpe9gVEQhFYDy8qx1v6AL3xxy18ZX48LC/FsVd9x\ndkGxdrawHt2P6e6HTO5W4rUoT0GyhIeBQfVZmtzCgMNq1oVwFP9U6hWWj8YW\nmCjFaj/Pnk1do3PACfInTISrWib1L2NTPCHm9Vh+C8Sncdf2oWd6zsroqSnr\n7LWQ\r\n=G5uO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f6bf51788bc1f39067fcceced79dcc12b2c59caa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e9d2e2f96.0","@material/base":"8.0.0-canary.e9d2e2f96.0","@material/shape":"8.0.0-canary.e9d2e2f96.0","@material/theme":"8.0.0-canary.e9d2e2f96.0","@material/animation":"8.0.0-canary.e9d2e2f96.0","@material/typography":"8.0.0-canary.e9d2e2f96.0","@material/feature-targeting":"8.0.0-canary.e9d2e2f96.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e9d2e2f96.0_1596572700554_0.865475947331265","host":"s3://npm-registry-packages"}},"8.0.0-canary.b9dff0a19.0":{"name":"@material/tooltip","version":"8.0.0-canary.b9dff0a19.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.b9dff0a19.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"63d7a17d501f97180a05c9e962cc6aa482468adf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.b9dff0a19.0.tgz","fileCount":42,"integrity":"sha512-qDp8/M9hscBGnLjbNLKqu0uTGet8a7j9lgSWFf2UE42XEI2GMzmJFN1+9sRFs4r4YR93wCtSVjPKpSNE9CAoSw==","signatures":[{"sig":"MEUCICib3UnzgIkc3KPnVLlSZ165R1xkHTtFBsASchWwtZyVAiEAkOjpbiri9nWbqyuAy+guBn5M6fxDCnaJ9Ad4nfUsbmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKixWCRA9TVsSAnZWagAAP00P/3BEc0Wrht3kucDMPicr\nBLuElJZrlQ664Z52lKPQBsaqR9STSHELR+PIBwwSJ6OPn54Okr9DaYdXmf7h\nnxjuK/zXMRSG+i9vonewxxGhBkqb+AW73iGaaBg1BkoxQGLsM1E5flfNqFw5\ntmvNhbJ0QOKLJULy/53knqUx8JgTWM8iS1Gw4QviAXvzB440YRUpsh0ppiZq\nrBHiiahvP6l+lKFUP0sU7WtVBO/va4wFHpFgKB0CDLMGv/o+WUxR8lIszPhT\nZ06W1Iu8bhBORinAskPCww/n5Dcv0SiH5wzc2FVLgaq+gfYNwswDIn6bGD8G\nGlaypzuU0lUThAjoMCDG2V5PD/TsYQgcFIk7vL8AcX6c2pebEH98LQ7ei2gE\nWW+7sNCkY1ZW7QqCXM7ReORAGUCHfJ63bw3Ox2OEtZ91Xo6e+gkeuQ1hQVYT\nuCd+mFUcJrBGLNhoNDThaSXJaPBJ//rNgh770RySc31RtljEC8JSLDMkMvVC\niMM20YPFhEl/BsMr1+V4KVk/5yuR6n0Qgv5yUYGI52r5ItTZ3NCQEZuKlbbm\npUZhoto/dULcOy/V8yFI74IyLdTTCtuVloZndgR9nDaNslCWZkdU/fpmKkn5\nEGkd6QmOXa/BVaDOan66ubMiWKelE2rs5lcmSv0BqzGAkQG6V407hPpRu7G2\nysam\r\n=rvQe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"dec2f9fa4c83e98bee860646fc2a65b134a7900d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b9dff0a19.0","@material/base":"8.0.0-canary.b9dff0a19.0","@material/shape":"8.0.0-canary.b9dff0a19.0","@material/theme":"8.0.0-canary.b9dff0a19.0","@material/animation":"8.0.0-canary.b9dff0a19.0","@material/typography":"8.0.0-canary.b9dff0a19.0","@material/feature-targeting":"8.0.0-canary.b9dff0a19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.b9dff0a19.0_1596599382160_0.3915085972276533","host":"s3://npm-registry-packages"}},"8.0.0-canary.2bd09a706.0":{"name":"@material/tooltip","version":"8.0.0-canary.2bd09a706.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.2bd09a706.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a00b91c88755f9ed4dff36312b15ac57e5131bbe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.2bd09a706.0.tgz","fileCount":42,"integrity":"sha512-+NlJbOK3RVesvOMHEI8iuSsDtXZZL9NDPaLdJbpZkdp//zHfp4bvEXdTRFFAMDbwkoSI9owPr1faBXB1pYIIoQ==","signatures":[{"sig":"MEQCICMZW7OmNOWcWUpwdWKykHCybK+FjXN7hwojAGH6I8TRAiAbc/7/mj950+IdjSSJ9z7VKXMxdFaw/fjd0D8Xaipc2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKi2NCRA9TVsSAnZWagAARcwP/2ZVYQlE0oJU1XAuP3Fs\n6TzUXGXssqPqjQ1frpZF26ZIJviR1pksRRxEXl2t/v+mF/gc9xCnbecUVB4r\n0GkuR1acAA2x4EQMbFC2Nn36czm35llA/AcBw1Okf4rbmxTawxV+L5A98oh0\nxVs81j4wF+9rJsmFld8Uv/3Tj7PueHFVNWm7WB0ndNaNQgxL5lYYi8oo0i2m\n8CdknNijRVJHIlk/GggKcpUnD56UokqF6ltwGqADPMbsLpZv50nUBOWF4nh0\nmV3k/aIZ5e9M3Qge/6uZSIdCvlWWZZHLLEGO2L0Tq/3tegyrGBymz1Zl+VGd\nSBq/pNVa8w35Q2/Ei2h+PXo9MfTXjxlNzsm7mthyNC8CzHirNZ5xgcNzznlo\nXE/jcn2CfenLhnaZbkaCejJyvi+HyGTeoufnzU8auincPHGNbcsFooTKt50j\n8rpTCe7rlM7WtcNXbzqtqczm9iIm4NkrIbTIg/sIjj7krIJIXetRKGIP5cdQ\nvmOZatj7FaEtk9TfP1T/A7LcP6NdQQQWY3V4eNVP32LYI6ApXXDepqCwOg1Q\nwfkxDi4o4Z7H5UAiy3P6fD3cnfKgIkD6XZwdMWIQqyF0tWHeHdTLAwd8sTUY\nB0SpbzT4T+YvfOrZV2Rwa+rFgPZs4MEmDsMNn5FPuhNKjFM1K3WwFyd7WduK\ngHaG\r\n=zpcm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c8b061f3fa8ffaf5214e79fe44f6c575216a1808","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2bd09a706.0","@material/base":"8.0.0-canary.2bd09a706.0","@material/shape":"8.0.0-canary.2bd09a706.0","@material/theme":"8.0.0-canary.2bd09a706.0","@material/animation":"8.0.0-canary.2bd09a706.0","@material/typography":"8.0.0-canary.2bd09a706.0","@material/feature-targeting":"8.0.0-canary.2bd09a706.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.2bd09a706.0_1596599692911_0.8349172358140131","host":"s3://npm-registry-packages"}},"8.0.0-canary.e0560522f.0":{"name":"@material/tooltip","version":"8.0.0-canary.e0560522f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e0560522f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cd6d9fd3aef43cf57faa3d01ee042595a35879c0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e0560522f.0.tgz","fileCount":42,"integrity":"sha512-Y9XRlnXWu7BJ1YhjQ54NHQvs7nw30sZO3lpRocOe0JJbbHmMP18PfbG+zsP0m8jkoVPGjJkuM3/nIFkq1cSujg==","signatures":[{"sig":"MEUCIFPule3FVRu6xiTeNBHBSWyyl3RlE9I8yyw1nMQ/8juYAiEAjZcfxxqmn54bJilcOrdmhJRRYT67anyrYleAZ1hQsHk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKupyCRA9TVsSAnZWagAAdwYP/R6OM+AlnVDhtWIDtvcy\nJnpxxFtgj1BzSZ+poMpfjM7SxjRZOSEcu8bI0kLhuQwTPDSnmfw79byxPE0e\niI4Wkle6X/B4VjUG6f+ZHh1v4Q7tPRarwwATTuzDU74phA3vFvCPOP78ZvVx\nI1D378BBW343lmX98PqDpK9VYUKcr11LTMHzSjI12LSVaMwSNB2QGgfqBnpk\nMtAJRVqjtXM/+dsvdqDq98eMvcZmPM1Lwyua5DPEP/MJRRKQzgTf5A9Aza8n\n5oPbwnabBbFi1m9gl8C7O6txjwCOq7pOHt/zMD05qVgl2khQ9/CggcGRzNEs\nOJHongyshFFmqIAHzq+yBMYPv8DTXLEA1SYlV3r8e71h5azwu7huw5EXz9ia\nHkZ/LBoCWNh9O+Jetw2YYlqOqJohfIhXioEZ2YnFO72b7WKo3bpkSjM5oebf\nb3kWCCXlgTB7IqS8lBxYDrSEiaQRMM6mP0jHlzcFKLHW43LDN5Yw4C7020Hi\n4rZ4+CSigAZEz/OcgT2sPKPPkPJYl5eE9T1pR8unzO0htvXs7nKpgPT1OCIJ\nLOetWlXCT7A7Mh1VgMsSt/p+nQaTMX45j1+MA3fBrdK8AM5KtyBy8iGEeXJh\nxXIZ1B19IatFNJwbC/S9tHUF1iw5L9rr10QHAYvWeU5ZSGzJdqtExp2xR/5q\nIV8e\r\n=/t4m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f4f71f168da3435c5dd1bb74e7ae0c54fcc45746","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e0560522f.0","@material/base":"8.0.0-canary.e0560522f.0","@material/shape":"8.0.0-canary.e0560522f.0","@material/theme":"8.0.0-canary.e0560522f.0","@material/animation":"8.0.0-canary.e0560522f.0","@material/typography":"8.0.0-canary.e0560522f.0","@material/feature-targeting":"8.0.0-canary.e0560522f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e0560522f.0_1596648050422_0.2270366548575442","host":"s3://npm-registry-packages"}},"8.0.0-canary.08ca4d0ec.0":{"name":"@material/tooltip","version":"8.0.0-canary.08ca4d0ec.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.08ca4d0ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"13d1b9fbd2a1deb77fe7bb8c68f707a159da5ca0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.08ca4d0ec.0.tgz","fileCount":42,"integrity":"sha512-yWaWwsrP7T8v28MmxnuFNieL42qF24BLYUE4QrbDNtVowzskNUzm0+fVs8k0FWr9rX/ig6XxyW3+2zX/m4Lcpw==","signatures":[{"sig":"MEUCIQCF+de6wc/AlhDFXG7pDDFvvGqtumKNLQQRI2kEJ6e3RAIgdFZ9zRP9HE2E/M8PEabyqM7YIFzsgoEZWAlgyRfLoQM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKu76CRA9TVsSAnZWagAA3EoQAJ0R/7fHvSZHCgYJXiTj\nxhy8l+20UhtRG1mEmG56ZFF9lc7ivNWqAHMmMEHLzN+yMgpxOogcPx9djDQc\ntQrZyOCGABpGRjmi4msogoVkyGcsvo9gO0pjE/E/4v82cqztOyESdF5Avy0g\nqzbOmBNt1HenVtTdYoYgExo3U4uAx6jXMU+UNvRETUCh0Kfgzkrh7HCLt72l\njHf7XwBoShmGwY9GtqXR465IOVPRvFg6B1EgG0dXQHSAP6rfEaNvZi3FfokE\njWjPHpHFPt5zS98opb4PY1AirWT1rXanqy16+F1I4U1Y8mIgvjPlTUrRGMkL\n7runO1ceQ8BAsfRI+AJTGjL0dZbCdm62JtCMW/D5/eh3XeTiMbhUWb5PgkmY\n8mJq81AoJEpetQP3CW8xXT6mr3EQ/fMk1ri+xNeeXJYNX190APEdqIX/5TAZ\nPBpB57aIbB4HZZR3oIH9CT/w1rYrUpKVfxIkF+aNw4FyHofMCY5BkP8k31od\nzcffD08/ZoVAyfwhO/ccAKz2/dW7rgvtXINm5jkXKhZc6409hWRCe4vA79T5\n7r3D3yLgGookHsQXjikhSry/B1gtnpb0LKiifZVXyvwgq38qhX6fLW0rTGMk\nUaCujsiFlCR5opfb+9uy33H7Kq3CjZn0a+CeP5xeBzSLO73C0SjwoUX06QD8\nzUxv\r\n=Jurt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e525a44ae67401224e06885b43f10017ae70f9af","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.08ca4d0ec.0","@material/base":"8.0.0-canary.08ca4d0ec.0","@material/shape":"8.0.0-canary.08ca4d0ec.0","@material/theme":"8.0.0-canary.08ca4d0ec.0","@material/animation":"8.0.0-canary.08ca4d0ec.0","@material/typography":"8.0.0-canary.08ca4d0ec.0","@material/feature-targeting":"8.0.0-canary.08ca4d0ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.08ca4d0ec.0_1596649209896_0.9208849945105995","host":"s3://npm-registry-packages"}},"8.0.0-canary.08090126b.0":{"name":"@material/tooltip","version":"8.0.0-canary.08090126b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.08090126b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"502795f30de0056df43be18b7cace8fed3d76fc7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.08090126b.0.tgz","fileCount":42,"integrity":"sha512-boBYAU3afmHp5Gz1b5ADiqfSGbhvEq/dJw73aJMeI4GbmLy8PnsCSMETCNGbIAsI6+6HixNbY+gC4M7CeCL3Uw==","signatures":[{"sig":"MEUCIFhK+f61/uvA+ja1MSRJ6NIIDDMOxJSDOtE+0HOBWONNAiEAnsLdKvPLWkW3EAJFqZ32O8tDCytEwp0uduz/gN0FnsQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLFsGCRA9TVsSAnZWagAAsiEP/3oGyLwp/SgYT/b4Ezc/\nLRux+Qc3Mx3w0fgaM+pr14ANDOQmK6XEqWiV/eF4MKRqEPh7+WUgHlVV7lqL\nqEKyZxS95HiG9ZB4vDevifHuIjhbZ3Bw1hS2HwNO7xEOAviz8pBhlH+0XN2Z\nbBVt6CrnO84jEVYe1KGdX0bPu9Yxc2191oIgGKjZvqsh93FHFqEBpUOH2CjF\ne+k8pE7/83i3mJp/nq5bNz7SlVeBSvNEM7kQAf/sWmCB1GTgUaKB/tCpEAbn\nao32MDtNU9panOJI+PJ8iHIylzwi9qKWF79A+xN1HrdWCPxUmKSnLrJeRZlh\nuVI8bzOkVbUdveL/vRkb1Z368mCq4XfQxEw0e34zix97a0jvC2ao/bYS3mpf\nuOSpmq0JS5x7OybUlvJw31eilwYM3xN+G+660eSqrqAj1MstEbzVFVqv5jzN\n+ONEtq23pLkDqNJOR1+5KrsobDJDunZPBAjey7FqiqPVhNo8qY+y3jAUTOKR\nnmNGTreS7pKlZTylS1TuCYnpVNjsjTMo8bWUsTl9vvi+SJSoKPEYXmt8wWr/\nyjpbS4/jX/W1q9Grdbq1av5AgREvrp/uCkrWZ96A5KzLlss+UScypdBCA6hU\n9+AsAOYTxnSv2VX5aO9p0CIP6jQ18KC7IS1JDPW0BPpJUENRUqZ88bKZA30K\nRs2e\r\n=lu//\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"92703c0a9dad96887725176e28a4ac83640a3b34","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.08090126b.0","@material/base":"8.0.0-canary.08090126b.0","@material/shape":"8.0.0-canary.08090126b.0","@material/theme":"8.0.0-canary.08090126b.0","@material/animation":"8.0.0-canary.08090126b.0","@material/typography":"8.0.0-canary.08090126b.0","@material/feature-targeting":"8.0.0-canary.08090126b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.08090126b.0_1596742405822_0.21694927153863008","host":"s3://npm-registry-packages"}},"8.0.0-canary.e8bf5b2ac.0":{"name":"@material/tooltip","version":"8.0.0-canary.e8bf5b2ac.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e8bf5b2ac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b5c45fc2790ec4e5f54050ad795e7aa22bf934cd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e8bf5b2ac.0.tgz","fileCount":42,"integrity":"sha512-OGcDsh/guz71YGhCIovs6UhUl3/Rg/q7vBRASRJ1/AIh8BKw2saH+aGPVl/VnyuBxN9xGrWXSqzykc+0jcVeJg==","signatures":[{"sig":"MEQCIGOlwA2l6zm2L4nNOh0Iz0DT9GO4eHQ+ICpdcTAXDr3RAiBH8zbPXSlZ9/nwMf53YJumBWGviHp+gtSpSrlDIO3dpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLHs/CRA9TVsSAnZWagAANRwP/R01BQ+n4vcAps1tpIkA\ni9ZfipKdflw75jALQKfBCoQWO5Y6O2yy3/Y/4gEn9sfkVBCKxn8BQN3hmrE0\nrSszFFEsdvvGZTooNoYxjknRzGvtIG/Y09aYC6lFQO13Hacx/5bEEbIqh9Fq\nplC/AvD8NBIJmH7mJLZmJNU58pkL+gq1d3gmaZBmjzTk7a1vlbqrZ1YbStrc\nUWION6wQBhG0HqzhVvu8XFg1FWxEjfG/eN/sucTFdiF4dFnIE/v2c6itfreC\nEf2ZSql43itY3V0mIZsodd3sREihA3JNCqsKXMD6WsxoI1aYsU2H53j/JXnP\n1KOUybMhIMWivDbcZutqCiIsZS1tNQ45xYANTErTiygz+m+6YNB2aoSMn8XS\nOMx9RMZt2urO8C3SmXH9/op/Am117Ik4Kyu6MbxquDpAybazaGw45yh/+gYt\nxfvebJhK4qqVXC3OJy2jTXhWOZfNtilWtYEZ1OwfOMNaSd4z53j5lPkO+DmR\nf3HqAk2aoetl5tGk2mjz3cHg3xQO4m1pxBBf/OoAKjVxvhrljqViN5IigewZ\naieZDzt+odYP2kR6vx2JM2g0OvvymWdrHEUYBnUUMXsfP4kRZCRQmAqZPiTx\n4PTLSVUO1nISqB9TXwqF5bJEXE1o0fqSXDtGv9iwI2PShZWKCeX8RAQIEBDg\nSdGM\r\n=4ekl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d5fe47cd91dcff7cada8ca9b587eb8a924a211d3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e8bf5b2ac.0","@material/base":"8.0.0-canary.e8bf5b2ac.0","@material/shape":"8.0.0-canary.e8bf5b2ac.0","@material/theme":"8.0.0-canary.e8bf5b2ac.0","@material/animation":"8.0.0-canary.e8bf5b2ac.0","@material/typography":"8.0.0-canary.e8bf5b2ac.0","@material/feature-targeting":"8.0.0-canary.e8bf5b2ac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e8bf5b2ac.0_1596750655217_0.34806595156059594","host":"s3://npm-registry-packages"}},"8.0.0-canary.e3b746208.0":{"name":"@material/tooltip","version":"8.0.0-canary.e3b746208.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e3b746208.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ba9d06ec09204e6d4cbcba1333e5481ecb5df61","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e3b746208.0.tgz","fileCount":42,"integrity":"sha512-vHjqo7+XRyE96ZZQjSxo+W3ZLZW4nwQqJ3k+KTbtubHxBLTN4wNJKlV2A1Vf0djfUCUIAuqiWwSCH2MHQ3juvQ==","signatures":[{"sig":"MEUCIAvdYFagT2rO039/NCSEZbDUX3UguDGj4P7MWzKUM8ktAiEAkQ8Xr/lSMKI6qXz8OFFXAmPJuZc0BZDtj9dZVUnpg5g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":376728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLIPXCRA9TVsSAnZWagAA3YIQAJcYJu/bSg08V/WDJVVe\nIYfqOzHOXv2+p84DHPQMD9w+t3GeRwhSxWh09WMV3fu+uQ/tuX+WFows5Kca\nhS4ckhMhQ0E0mYsAty6nRDijZTobxs6y4ikTQ5KMvn+TIMDiV5Vyc2ELm6dR\nEo0jT40qEfymlqW2rOoR0LpIyQX+hBKdkvSTutl35BhmT+EU139UOEtN+H+2\nyVaGrDvvPONTnD136QQzSt2MaOYJVdrofyLMJP+0ao1+3ZsMNMv8yI4fme3Q\nyeK+U0o+Lf5ooXZMYeSn1DJxCD5uagoDNM66J98Fibh9BaJmuQwU6O7vqKec\nMJJjTCsoAvjLBexhhOyER1vWmEt9837RkZ9HfO/HSZmq6fCLQiV+E/ktfQmX\nf/xQkBzPZlTcO3hB65A8oIuQdOBZJVlQcdmdkrAQJo4ymYy73ujTDMfBC4Yc\nIuz+g1QD2yx+egkgucwaWnHYyTEGJ4TlS4hAN9qW13CLFZ8JaWTCyiYTywbc\n9Zrn5Y6YHsxDirvOv0SNFbTmSvRC2VDH1g8noda0QVdWuSzx0hGekJgjUwaR\nJfIhinUcMYoBaDcCsVUPy1AMcfhBgSI+NYUXbDdT/fvb7zY2vrQdt0i58YIu\nXGKxgjcUZkPW+MaFzmv4M6bEmabq6ur+x8y0T/1nKRyGEtcwriuWgefXHaQN\nOa3F\r\n=vrCU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"565f03445fdfa2cc653bce8f5c730176a406e5d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e3b746208.0","@material/base":"8.0.0-canary.e3b746208.0","@material/shape":"8.0.0-canary.e3b746208.0","@material/theme":"8.0.0-canary.e3b746208.0","@material/animation":"8.0.0-canary.e3b746208.0","@material/typography":"8.0.0-canary.e3b746208.0","@material/feature-targeting":"8.0.0-canary.e3b746208.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e3b746208.0_1596752854951_0.6079146508677122","host":"s3://npm-registry-packages"}},"8.0.0-canary.96a640534.0":{"name":"@material/tooltip","version":"8.0.0-canary.96a640534.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.96a640534.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9791dd6bea62c84091f72d22389c776a29718438","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.96a640534.0.tgz","fileCount":42,"integrity":"sha512-7mgdxH2mNpl5S7R6oLIZXa552uFL5nDr/JuL5IQ11jAKAy+8fs7HKM83D1P8YoJbm4ffEguDFE7W6JNT8KaJkA==","signatures":[{"sig":"MEQCIFYErliaJhdAAZ353dHG0V1DkGrPqLKcnAx5YlKXHvlNAiBx6a6nqmsybr5oEGYAVnKPBItLvrHGYPY65/mvNJcSWA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":358819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLIdLCRA9TVsSAnZWagAAySAP/02MUe7ScPLdD+WVpVib\nAyIhBOKx3RzHW5YRRQXrgviKQzxpYvtMzcFez/dS3Em8WI0/JAsdsFolz2RX\n+cN/azS9X7iUKomopT0AqF6rjRbsj1Nw1QUqVVAsnSs+vcc/mFhEbaR79tUu\nKLPBDv9EvGyDRdhLYFxsALRqeBDopi9rFruz8NqG4kLD3D2GwliDO0AqYkZM\ngBCTfP/sUcuxdufwvMEAbVG6L8H1U48SNzIMulovE/Nm4EVI7z2+r+2cuhw6\nEjmzEY7krzRoKpQIqTesO4lIdXFOBKi+bmS4rEJGtmeTbczN2XRC5hruTpPl\n4aMAKoG723pcWhjZL8hLhNRiNxBZ6gpzERV6F7UZZHVSKBfpARGsiJo1bIMU\nS7NyclE4NRwAzYxheUuXEJboVpH6y48T7C7yjTkIcyNjf5s4Hk7AAa493zxT\nBlS1WkZw2aS3qqF6TP8XuCsoCT+tHraw/suuzHTND5ZzMCjapKwJqV4t7buj\n03P2J0BVuVbPtmVYQeWWHfPoj9dNsdTDBG+Xc6KC7Z1KA/gN+0Lz6MtICKXw\nVD5giz/MdVcWcDGfbvlIYeZKMt4LDaswb/8L7rLaq7A/0XM5ZSAQfltlRY0k\nxZmeZFOpl+nZaTnfbjGE7MMaBA8G4BbsFIEiPL5d9Vw56O2ZOlqVXkETzK+u\nrMrE\r\n=oAvM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3363a6ead1437d646dec8eb21cb2d5c5323e8986","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.96a640534.0","@material/base":"8.0.0-canary.96a640534.0","@material/shape":"8.0.0-canary.96a640534.0","@material/theme":"8.0.0-canary.96a640534.0","@material/animation":"8.0.0-canary.96a640534.0","@material/typography":"8.0.0-canary.96a640534.0","@material/feature-targeting":"8.0.0-canary.96a640534.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.96a640534.0_1596753739155_0.27212498751698955","host":"s3://npm-registry-packages"}},"8.0.0-canary.9f9aac825.0":{"name":"@material/tooltip","version":"8.0.0-canary.9f9aac825.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.9f9aac825.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"80a7966c27cd10d87a03c0cf46ee8aa6d75c63f2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.9f9aac825.0.tgz","fileCount":42,"integrity":"sha512-2mefgjyAaZhX2nAEqNaFeE7IVJGg6BzF9ZKwMcarXMxPxdJmuPE87+IKZb16BHH0dnOdpbhEb7lQctEwInJzIg==","signatures":[{"sig":"MEUCIF2RKzNeORrkWy/f8scKwFdg0O+g2uviY+LhgasSw0TNAiEA+xHdNQ3jGj3TcuA5sd8nY2VxKkZgXQLZsfrSszwukns=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":358819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLb76CRA9TVsSAnZWagAAs10P/idF7uA8e9froBDQlQ2m\n/mVbgu0+hwdkbZaX3FODngUKVVZ3L4WaR+dvUeV66fjgPn8PrKpiaUDpXIAN\nzrPoeeRoHriMNczk43Oea+Jg9+dOJYbDYY/7j1fa3o3IBYYhhM9IZzz8p5lr\nvqa3Zg2uhDBzUYuna7RiTw2NSQD+yRpxBN7OS8FCew6di4/vTImOwvLK6l0q\ncWBzxREdsfPcMRZFAN9AQBF+vEHf8iMcYeWYSDubMgfLxJt+dXYPDHYjxJWv\ntj4C21yhLFn505/+/Rhj2vx5SXTKTLRPqpt9ewqe5Sr90tZTdRDOyGFKUvWj\nJiI2Q+cLPhYL7VZcrEY9TgDBU0/3gdYWRPOKSPVJ3Z72m4nWDM1qYu0QTSs6\ndQxpeD0NrrANGlnnpEwM/mrVPmBXVjlXhFT0a3y9iOEsle/KujiYDjObndhz\n1aMHyn0nU1Sha6BEyewa7To+VmdwTaVRixWpzZ0FpX+/GwPYehrBynNK3tMw\n+UOgjv6g2QWiFACd8Eh2vuZ7/i2XN8X9Ut697mlZmKPrHMOz9/hyz8KylPsq\nqNzqVsVRiyFgjOLn97C+rOc229orIDDm0Er6oA6J4DAoQBI02fbUB/nenK+x\nggf9ssFISt/FtwBubJwvQD6xhtK3fu0Wg0DQagJtN8kFVokCXzG5sdwxwTbK\nLwJo\r\n=aQ2x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b417a722353dd60a63448761d24a06d325b83f7c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.9f9aac825.0","@material/base":"8.0.0-canary.9f9aac825.0","@material/shape":"8.0.0-canary.9f9aac825.0","@material/theme":"8.0.0-canary.9f9aac825.0","@material/animation":"8.0.0-canary.9f9aac825.0","@material/typography":"8.0.0-canary.9f9aac825.0","@material/feature-targeting":"8.0.0-canary.9f9aac825.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.9f9aac825.0_1596833530276_0.6194327226460652","host":"s3://npm-registry-packages"}},"8.0.0-canary.fc65fd00b.0":{"name":"@material/tooltip","version":"8.0.0-canary.fc65fd00b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fc65fd00b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6b460170451b0886dbc4123bed0240b535a5780a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fc65fd00b.0.tgz","fileCount":42,"integrity":"sha512-rW1XEb/ilH+wxMtOGXzxaFiaMF7TSiBij/FifaaBY+XsdqHOrOZE0pccMDUTj5ZGbZbnQ6U5KsBhEq48wpehvQ==","signatures":[{"sig":"MEUCIHFFLtmS0m9Q8deCCols7xFUU3cTD3DB7meRmqDQ10JqAiEAqwm0u2KxbqrzqrDn8qVxvWAESt1QIPQ3RsPoRPG1J3A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":358819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMWYKCRA9TVsSAnZWagAA9HMP/1ziigA7h7qSgfLtpvio\njNK1qCN3kJrZr/dE5vMMgEkqo5Ra7YqQzd8hNjTtumd/3/AGSowFVQmRsvAx\n9HmhcQONc9FNkYVy9QfxkEuOR3J0z8opwVX6fmtTKZ6WjZf7tFF9AWhFqZre\nq8nCmQD+4FEYyqCrb7odsaChWIYdd/kfII1ovfsbcGzoMNiLw6bt/bP+1h3/\nFteHDPfniuAkfDXcAFPDnl7yCA4hPHASfUvhqYjFEXsClNykaaesRPQ6Zp6F\n5Bzv1umkN/y8RjgxF6OSI5qD/FLMJyYDxwWYWabivVag4EFQ/KysudW8Mwr1\n+R5g248NWoWYc59aeDIm2DflLZghjqh26oFXjb52t3b1P1znsYOOEK3Fdiqd\nFp/dEWb+ZpL2gZ9rk2/TRGoEdU+X7PoFm2HHAaOqhTDxVqSK+0Gftovyscto\nkgtmvZwMzilOlQY53hZEA5Vx7TWTtVZBScbmTgkF64ZzLe9rawmMDhBHY2VM\nlm4WRzHAcg40xVnUMe5kuhvy1oE61Ns8vx/2eXN7jIDk37Mo6Be45jVXJWqG\nCHGqOOp2ypRFq7TvAx4mOOK/Cc+yW8h0JNsdFWoB7eMXu87hGOzgI8qlt5pG\nu6dGNzEYTLQ0ab96EomDVDV68+nlh13qgi6W35u6YTN7Gi0zb3SRwWKoumRR\n7dkV\r\n=j3d/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fa39d9d1e753796086537bc71b6fa2d2aa21a3c5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fc65fd00b.0","@material/base":"8.0.0-canary.fc65fd00b.0","@material/shape":"8.0.0-canary.fc65fd00b.0","@material/theme":"8.0.0-canary.fc65fd00b.0","@material/animation":"8.0.0-canary.fc65fd00b.0","@material/typography":"8.0.0-canary.fc65fd00b.0","@material/feature-targeting":"8.0.0-canary.fc65fd00b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fc65fd00b.0_1597072905939_0.650250068390446","host":"s3://npm-registry-packages"}},"8.0.0-canary.02e372c5f.0":{"name":"@material/tooltip","version":"8.0.0-canary.02e372c5f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.02e372c5f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"87aecafce058b2d55478844edae12d50e86f90a2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.02e372c5f.0.tgz","fileCount":42,"integrity":"sha512-0uD7ND/zxJ6VPLFbCbP2WSNfWWvKziY3FP0BbO2kJP3AFq6MBren+UNh8AabslFopPiFZ548NkjPlkAuJ7HZQA==","signatures":[{"sig":"MEUCIGwwGgkHi0pVPfIpFE1PKSS6ctCdihnKlmQPMkRu9DoNAiEA+yAc2Mlm9zouLxmCozLO5xAB9A5yPfofelwkouqNXKE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMWyOCRA9TVsSAnZWagAA1ZoP/ArCtqxLBoIP99R6YjtY\nkZKV2cWbUzS5Nm1VUDN8T32QomrVZ/m23ZamaoKeWY4wP9mf0RZxinLb0UD7\nlM5Sj9uW/1WPn1hzsiu+xR+my6RDAzI5R8kyavj9mWmokalYTKQ/D2MtMkYS\nf10B0HB+LCz3WrasEJ1UgDUQUYDN/3pn/ausCDCPDQ9Ojc0L0Vc5FvdpHMBy\nAYTUINdll2S2VWdQ3F671v92mxW5KjtbrPWzJnSGU4wjku7TclUhBut9VTGh\nRURV/59nD9tWHRaw23SBsMu2l2Cw9WQ+c2oiaAgTTopE1bq4M/Ly2GVMQElt\nt6j2s+ft2Dh6RLJf0VshkiCKEwmLg4r5HIZscxeD4ypF9OVax9Nyb/nBqZZO\nnmuSwexDbq+4vob5NCCJ7fxrilqTYdC5pmpC2y9sUYutqIZwCblsU1hPOVzL\nMlxzo0Nix1l9D9xXZalObKRz+30mscSuUay7xNuXJbwHYKBe0qHe6udh9Vfb\n72XI3rodxxiZqlLDzdcNR0UwRqbWzTAIC/ZmcR6cN5XtD84lNFptKeFW1Cfw\nYkTCN5YLDDZcYKtAthc3iOwDIEtom/LYTeiaGd1t8y4KuifbpuJzizXa4601\nQfAJPVn/OumhYtVTesh5TQSiZBuTdBem8yg7F8MvkIIdAtF1Nnv8Ui0lGP0d\nzZsD\r\n=byOJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b765f8699fe12742bc2032a8df7cc23807ec94b9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.02e372c5f.0","@material/base":"8.0.0-canary.02e372c5f.0","@material/shape":"8.0.0-canary.02e372c5f.0","@material/theme":"8.0.0-canary.02e372c5f.0","@material/animation":"8.0.0-canary.02e372c5f.0","@material/typography":"8.0.0-canary.02e372c5f.0","@material/feature-targeting":"8.0.0-canary.02e372c5f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.02e372c5f.0_1597074573782_0.9886991281956243","host":"s3://npm-registry-packages"}},"8.0.0-canary.66669e3b6.0":{"name":"@material/tooltip","version":"8.0.0-canary.66669e3b6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.66669e3b6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d3cf47d399c1ca0ae544e0fd90b8dbbae57d51c5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.66669e3b6.0.tgz","fileCount":42,"integrity":"sha512-mHC+SsxY3j/F+l+yjm45yMSxIFX2V6oJzDTvuj7kJT+RLGeA6fuI5UxthRoaxXiHNA/5/z8G7WFH5E7k4xd+1g==","signatures":[{"sig":"MEUCIG9vZ3d+vVcVdRyY6F8q3DLl0PVJZaKu6QgqhN/JrHZ2AiEA3E81NiTt7vgCe2ZieszQHFAyqrj3tTjnNpsgxgUoutA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMW11CRA9TVsSAnZWagAA8vMP/A4ljCNsTafVWBSu0nG6\nPLPybPn5075q8xUbajs6hl8lc/8IyA8rNHGBxw4+XfNe84rJoELAZb6smohu\nz0tHSqfPhPurGi0j6fPR+1/Jbw7yN4ITZMUKKBp8pJTeaZdAE8MHPjkedW2c\nCDhfjOqMxJp7Cf0UuimiA/3ZuvSPvLUiePyzJh7fpcWzw9E7BZPOjVzKJHnz\nNzgKyzVJP8LgCWJCnIJztDsbqFm/4JPH3o2l2GHFNmostWaJzIJ6oKHuwQQA\ntlIbx5xQSt8nerhbNPoGv8h/iqAN2RneCvj54gB4IPVtBR+veRTlKeXUxnK6\nmz6up/WFk9BbqeeMdOr1LCKvijkewaFw4LV+lKVy0Z0vLTGm7oKgNuKY6e8c\nLrHCsx1msqmt482ywbNE8IG7jHmaX8q1sTOUFr3NAzxsWDX6M4AomUEBw/YC\nyV1YbdtZXrYv9tLWj+iM8V8xNeQNjmI9//PsWZwgkufCqGoMWzzGIrdhZ/n+\nQiZq3vIQp1CKCRI/ExHDFbFwGPxd18NPVqTMxQnbiXE0bdPkL7Svya/B2HAz\nKkHGAyNwgqxpfd34DgRaWOcOKsmx4UO5u5cpyYWVbJbPSmLQV0oHpdDpbGLv\nw5vEGnc0oV9I89KuwDzh0rbqgdar3i2fO0yJu8tTdwdrpg7qSIbybYFy4uen\nheGK\r\n=qW0d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"96a6a7d492075777ad5f7692328b3bd50153bd16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.66669e3b6.0","@material/base":"8.0.0-canary.66669e3b6.0","@material/shape":"8.0.0-canary.66669e3b6.0","@material/theme":"8.0.0-canary.66669e3b6.0","@material/animation":"8.0.0-canary.66669e3b6.0","@material/typography":"8.0.0-canary.66669e3b6.0","@material/feature-targeting":"8.0.0-canary.66669e3b6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.66669e3b6.0_1597074805137_0.2828253967955847","host":"s3://npm-registry-packages"}},"8.0.0-canary.6d1ea9761.0":{"name":"@material/tooltip","version":"8.0.0-canary.6d1ea9761.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.6d1ea9761.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"519a1b211e9fe68a32019afcea0b22de448a291a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.6d1ea9761.0.tgz","fileCount":42,"integrity":"sha512-7CEIMdaKGZlAQmWDvcKbQ3Ue+upnQU7EsEuqT38G1xBOHi6jHVwrhOY5EBK2jRylfQWbfGZvleYTaCLSC6yW6A==","signatures":[{"sig":"MEQCIAECNpVI2ev0Hkq99520Aq9DRrEZI/gfGt3hBdItHTdmAiAuqS3houq5Hh2Sc7hnBmOnVpKKeqm4weRxWeVxJfXJTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMqvRCRA9TVsSAnZWagAA3ZcP/iNYt+jMDT5f0UlVyBjP\noaUyV/4KfMXdmcAVTmwkGVygB7rb9APaSYzuTBg/4WEQTD++yy7LIiAs1IBv\nI1pyKfq6p+hZ8GbJNIc5LAWD7y9WlJ7ANx7RSLnNmm77els3XoyNdenanCKk\n8EJhQH+kjzyJSpqpLUBvwynWDyXsA/OG/3CEhbuc4FqXO++EnfhMahdH9EzP\n2F64frNgl8gGEiB7PeVsMJ/wJJLhO/sholtKmk/gAdbFnAfMXuz6d/+MFbcX\nh9D9L0AfLbdeG6w1RMExYKsVpHw+21uLQIcSiFs7pEWXXbIgRS8F0Qolx131\nFX3rDsstqkS8JYK10hcbYLMQpVAlrGub+Dd8tUEtQ1bkC6O/LBNOWWYg0VW0\nsZNlXcKU2E1K4tXeuJXlsJuXQUHgB2hfgcDECUmYRiiuY3udxeJS2gZwSXrS\nxPMkwqufbvtNUk3t9v7JtwniKKo9RGUloToqhqvAh9yc1iU6J06xxtzaxqyP\nZcCjutpJjBmnzJhvmobTy2XYe5QAyHcrmUcr1KLo5BOqrIxOstB5RXxLziYa\nug7y6qjmddK6K8qV06lq4cUW4JbEH8TDQvd2AVGJMm4ckEpHTdqdQHxicFsK\nPjKjShJLZ0Ose/ge5i8bHrPWjd2aCYr/WeNX1Qwzbecm1/tPy8AWTMRomeQ6\n0FTP\r\n=yvVU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2539ff1cdb03aaa0365880e59b2705e6f6ff4229","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6d1ea9761.0","@material/base":"8.0.0-canary.6d1ea9761.0","@material/shape":"8.0.0-canary.6d1ea9761.0","@material/theme":"8.0.0-canary.6d1ea9761.0","@material/animation":"8.0.0-canary.6d1ea9761.0","@material/typography":"8.0.0-canary.6d1ea9761.0","@material/feature-targeting":"8.0.0-canary.6d1ea9761.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.6d1ea9761.0_1597156304506_0.9585141927598904","host":"s3://npm-registry-packages"}},"8.0.0-canary.79414bf9f.0":{"name":"@material/tooltip","version":"8.0.0-canary.79414bf9f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.79414bf9f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0adb18d6fcb6eea55947f785d83cd573b5426b11","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.79414bf9f.0.tgz","fileCount":42,"integrity":"sha512-/SmG19ehNDL3SkGeEoqXqHzqbaevotmIUYtAskKZ8d0oWdBw+hQl+EuacI4gCboqon7m1A43nqToe5yaAFTaDw==","signatures":[{"sig":"MEUCIEc6mWv8REz6nK/UFXWlMiKBq+LI9uwtoJxNXS4EdVM7AiEAivqAC7eL4BE4+2deif3jSIldk8uyyfb5vxVafchuk/w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMutdCRA9TVsSAnZWagAAdg4P/1SMXOTVwSHqKxs5rTsz\nYYE5zh028CnnptYiY/OO4+/snqAYf24ewB8gz4OJz8k/I8WWV9Kn2CuDZ6xM\nEdd2t0LMsxpcEQR5BqpPxBMFv3CgF69txYYMeNl+zuL3w7/pmejMxH0lNwQG\nO5or/QYd3/zCEv0lbHc/zYyoCRDpg9c0Vt7ND7aJz68aaKB2RbwwvyImiUft\nQxG767s7u5IKTQEuLzI8r933aAW0pZ/jhP7Za+1TweQsodlP1a3marbdD9UW\n/AKuY89Gv+RGBwDSyH+Ss2LDOIUu5AcFkE0Xy74DUjA0PyCsP7IOOWhUOlPE\nqq6a5os85k3jpdF+7GaXePVAv9Bd8/Pk5Vag/eSvhaZLPSd/kkuM9fAd9eHu\nVrzYTqH7mAkikxH7+Pj4hgjgjfAyZNIMHPKLTzoQxjM+2PXSq4olR/dZua7U\n9Kp/o/O5rY5rq+h6bntrm6Z2oH2lOe0BMhXjv4A8wmaGLKeBRq5v8YKhDoXC\nsLpJNzyl1O1Yq1kNCqnrO9XLm3BDruwa4GcyS3strJVdVsoXbpMEoFnyPMJD\nbbnxEOJlDlqMsTYyE/zXnfMIVFfjpI0uy7Fp9rUpo0YuxGe9pH28vm0En90v\nF91GB266CMybAyxYZhdvqB1t6LHaa5Z/6MTih95OVbkCEJefuGq7nNuZkzWs\nF8eN\r\n=ouTp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3101c6ef84c1ef8d9afdb44b6b6b3067c2f5723c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.79414bf9f.0","@material/base":"8.0.0-canary.79414bf9f.0","@material/shape":"8.0.0-canary.79414bf9f.0","@material/theme":"8.0.0-canary.79414bf9f.0","@material/animation":"8.0.0-canary.79414bf9f.0","@material/typography":"8.0.0-canary.79414bf9f.0","@material/feature-targeting":"8.0.0-canary.79414bf9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.79414bf9f.0_1597172572791_0.9854480368944201","host":"s3://npm-registry-packages"}},"8.0.0-canary.85a5272df.0":{"name":"@material/tooltip","version":"8.0.0-canary.85a5272df.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.85a5272df.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1e1a771ca662ffb82ae2dc950067872a453f77bb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.85a5272df.0.tgz","fileCount":42,"integrity":"sha512-U1t2mOk7Bjhg2pTJoyhlWizzDQX1G2AedRN5Gllq4fTnlN3GuUp5ur/oAoXgbZ75MzbK8MFdgFP8tjJ0E2JEwQ==","signatures":[{"sig":"MEUCIQC8AQB685ZghyEPJinUQndWHZDvPm7+CzlWcZoLon62uQIgUO92vz6Fb3dJ9dfA3awnkWSKZ+1XJUvFY/09wJGnyFQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMvrdCRA9TVsSAnZWagAAyVgQAI4KRmt8Brx90lEa6dvW\nDZFjRp5pYPKZob3hl+fzKvxvpgHWC7++vRrtOKp5EFYWJs2I/D3wVZ+Y5eWc\nwEjmAANJcP4q31lK1uQxSjcjpgstEqEqCxyOjlpm1JFaX54AtvI7vO17Fh+G\ndtPHejLvYDKdaCtmTGzoZDd3XMI9ukcOL9w+7dUNo01ZguqjUWviztRvN1+H\nK5QoxRHVx6VJOJoEpVX+cbJkq/xBM/HYBiW/y3GqqP1O5Q77X/VEe6g11pHj\n7SdNBtMeMr2uUOirJzWjJmbqIOAXG8oDoxe/BkSsECAx7YOYahLdu/oR0G9+\n2Tkm1SR9pZw1S+17RlfVlLhOc1e5X4eRM8hlISm98HyIBOLPrE/VMzbE4Ypt\n711hWW3WRPvhbt2y8u+/SwwpSMD5wIKRHQmrDcwP/gULDKrkQ44RiqcgSEDu\nFRcOi+9pDyyhXbDwIQnKnArCL7aMwfhKAmzBDjmAa9Dwup6Ad6HgFma628RY\nNoGSPA+P8a68xHlM/njKAAHra6wIHPtvPQd8Rm6PQMZdPeu4g52WdpKJ8elN\neJQ2WY0LIappwV6gGYa2YHfWVcQqajnT+0AiPWb4ojGoG4RDBKZ93YVag3wJ\njt0G6xwzxqN0nyYcJP2TeEc2BmilXsMEdI/1dRwpK5TFFtz01/T0XBLv4rGW\n8M1s\r\n=Gci4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"070016d39c8d62feb1148d71182053d37bc35fc6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.85a5272df.0","@material/base":"8.0.0-canary.85a5272df.0","@material/shape":"8.0.0-canary.85a5272df.0","@material/theme":"8.0.0-canary.85a5272df.0","@material/animation":"8.0.0-canary.85a5272df.0","@material/typography":"8.0.0-canary.85a5272df.0","@material/feature-targeting":"8.0.0-canary.85a5272df.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.85a5272df.0_1597176540900_0.3842284406083192","host":"s3://npm-registry-packages"}},"8.0.0-canary.fda053eb8.0":{"name":"@material/tooltip","version":"8.0.0-canary.fda053eb8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fda053eb8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"563a58fc4404a2ac4aae8387a5814872efc82d97","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fda053eb8.0.tgz","fileCount":42,"integrity":"sha512-BO/ec5+VtB25t3Pi5vl5wvsxoW8RajdNWjujpIe83Axa/cf/pD/cQrxQzOVn1O1Vmnrn4+LPl1VU6RN84HhsCw==","signatures":[{"sig":"MEUCIQCDZNal7ml9hJWQXm9N8qKMKyIl8i9EkUXPSSiYlhfF/QIgBSC58W7YLfhlP8swBpy71I4lgf/gLZLiJkelFcxLvlc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNEtsCRA9TVsSAnZWagAAnXcP/17/U1FaEtkOAAb0m2lu\nV5Qzbe+eJWWmrVkgvAtoANn4EIIDNuB2RkYbA+t7job58DPb52iQuZIPjqmx\n0nGlaAUWG5cwHKN4oJHpluYNRcwMHNxNqxVBDZJBpNz+uUZmPsWEn40eDUPo\nk94smNUiI+tswMOSWtT+c+PhRFSNAQUS3eEIfQKv0qaE6XMTk6W36S2P9npr\nIeACd3n8YCPznJMdiy2ZJzjhN5v0uOcXZN4NBAWH9G41kxOEt54L7iW7QWkF\nO/Iqa/KYA44ZJq9JB6+QI0ark7zKXDT5h1JKHz9+u5/VR9PFTcyklXtUwZDC\nx+xCg9f1n+gK/7b7WBMZJqMQOwz2p40Qoufi+7sqcwLfpBv0teEfc8QFI9Cb\ndQXw4kBoXRWDJwvPviQXwSls6+ssGKr09kq4HwihJaWGcS0CKHr4sImK96Pp\nwnl6DHt54WXFGf/nXbUDh7YTXGlZlbi/4W6DxHM2jNd5YJSrkiV+VwF0F/5a\n2t5U3olMcmtytDv9IoeYSACOjDbiMZHskKA5teh7C31WuAgaLW4Sm0cpBQ2d\nr39f+hW7Sg8DbrsLwSraSG0dRvlyTJyZYwbHxJlZ6qIm4ZaPoCnjSV26cU0V\naR/zZo2fveh5911oIASEm2JnDDSdkTrC733eNV80ZpJiPUDjhSifWq53+wZW\ntQrQ\r\n=pB7U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b92b594784940e2fbd248c33d60198f7f2e0ff71","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fda053eb8.0","@material/base":"8.0.0-canary.fda053eb8.0","@material/shape":"8.0.0-canary.fda053eb8.0","@material/theme":"8.0.0-canary.fda053eb8.0","@material/animation":"8.0.0-canary.fda053eb8.0","@material/typography":"8.0.0-canary.fda053eb8.0","@material/feature-targeting":"8.0.0-canary.fda053eb8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fda053eb8.0_1597262700331_0.4226530065246237","host":"s3://npm-registry-packages"}},"8.0.0-canary.760873445.0":{"name":"@material/tooltip","version":"8.0.0-canary.760873445.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.760873445.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ddc3cdc2d31e594a991037952ff10f1d6bf8eaec","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.760873445.0.tgz","fileCount":42,"integrity":"sha512-LNzwA78ahSdPTa+DykjE9PMeEfRTwrUymv5xlNRJHb72x9T68upxwiivcIX4i6W0qUqf63EnkC+drWYfpuH6pg==","signatures":[{"sig":"MEYCIQCEc7/dY+FeLiLkXkzwPXaNIUvuT9Ekf8cPGnxvuaEeSQIhAObhENIObdz/6YQsuKo8pV7Zmv6BehS7znW/b1+1o5WN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNGKjCRA9TVsSAnZWagAAV4EP/287BH/O32s0+tT/YMkx\nYkTAfWtC4w57vSnmmwyAbP1jteQULr14wRmseqWgwukxvjA9NZcIodqWTMQD\nsxdWwMdVA4ogWqQUW0cAwa+LXzG3EbDabADCJaddNVZDWfyZF7LEzsqcJC2Y\nY/MMWMLds4XKiPWZRmKO22RbWtZh03J7CGRb/Grm8o9je+l3nWWVdBlUZRJL\nBWmQIdaxG52ZsUU4iHwtEiJRdzkb+/hT9rEIsWR4HVtJk32ybcWMtPGpKMVI\nBov09o6pcUIKoe1+NyQnd03sH/XfX1FKsxV8gN4jtfxbnIAWXGFDr7/rbrsB\n4kUf966uEuSk3SdZAiN8L0IKY2taP75LccHDcEDIRL7cWcKbp4BZg39uopoc\nPnux1jp8ORavzKPpDMgJlpOXhM/+zTkKqT0QPX9vSPnnJZGt4zRXMOByqm5H\no48xPCt65I6AjU9rOyEZIgbtq3jkkZN33XTN/rubHzN/6W2BB0rwyeJ6gUHf\nOj98hhc8cnkwPOzxqBpG26vG0E1CNxIusHAKATSGDpJDCby/7LwZYdm3awRz\n0GMrJAjbmCKOxdIhc0drNbXUyfN1FQFy1Xzo7uw/A8jk1cEqIpkbzWdaEGGH\n+Is4pv+Cm6HoqJqbangDEoZ1qzX83owhUPRms9TH3XjPP2zDZ8x2c1S9kFSE\nNV91\r\n=46cn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a830629b92051950e9e15bdd288ad87238b7103e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.760873445.0","@material/base":"8.0.0-canary.760873445.0","@material/shape":"8.0.0-canary.760873445.0","@material/theme":"8.0.0-canary.760873445.0","@material/animation":"8.0.0-canary.760873445.0","@material/typography":"8.0.0-canary.760873445.0","@material/feature-targeting":"8.0.0-canary.760873445.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.760873445.0_1597268642746_0.2868892446295017","host":"s3://npm-registry-packages"}},"8.0.0-canary.2f4711a30.0":{"name":"@material/tooltip","version":"8.0.0-canary.2f4711a30.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.2f4711a30.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9e83db7d23238d77997eef117609787e1e19394f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.2f4711a30.0.tgz","fileCount":42,"integrity":"sha512-Q6eq/m0HG4r+du1rfOvlDyVT10fYmSFjxrnk7O4xrP4ToqAlppBUc8JfKLioGwnxp8GCRzcY/pPsWK30MrExdA==","signatures":[{"sig":"MEUCIQCtnAKei/dtlt9jOeFoUCJAhv6VwoitPaZZOFNhRIPTAQIgDkIDTUsTgZ3mzfVWLYtSxjciP/jfd0OkfwYP4l0oI6Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNGT8CRA9TVsSAnZWagAArdgQAIgzoeAdm+Xp9aW5wPnF\nmzDnb6XMudUTHlWgsQZZ/xFzS3mJkVLqXKr6HMlxyfvboQlg0/F1kPS3drN0\nhaFwpfjDP6PMOA/tsgrrDU0ZTJXN9xHw58N44CpMseZ70PljWM/3Ekhj0C7D\n2Xos8TZKWtgTj+pN2Z9FrhlW2ggYzrooo/eFJszI18RloFjAuqnkClkzRzRo\nX/wtmGchKY0HD5rTbXb7StIYaA6LC0FU0rfkf+SNUD3KUPdF9o6ssfIsGt3c\nZ15TUMGUanqqvGQeOLFzghWihZBHS+i03zhQLnd2K/tyM4h0+7jIcxY9ZQ0T\nrogUJ9Wgx43KW9o2643fH2BDAbmV2QGP8zpUagoUVNOc1Lr6qLH9TNhAymZE\nmTLu+4mEMDmYH1dUgnwuxodmARPbmCNA8jkH2plPa6WzRRUPzNtfHkzZZFpE\n92vuYDCBfFhBSDV6aX1auRcepNsyQh1yI0GEO4ZIjAsFcK0IR8Sbs3Tvqe+O\n99iDncAF+028dv/quEVNwTc6zjr9h4kyTplwVBxyg0t2G9EvwedED8Iy+Iux\n7ewckC/3zSliJGDPvwWJqsMlPiTd7mjBNXVmsARdnPiaqhJb2TZZctUowGEc\nkO6/gIhIp79kABOJlVTHlYLon5S//yYaUAowxeTQNyhPQfIrF5HX6S2iknSS\nc6G+\r\n=uvbZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1347e5c15ba848f3525dcbd08fd0b11061e94116","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2f4711a30.0","@material/base":"8.0.0-canary.2f4711a30.0","@material/shape":"8.0.0-canary.2f4711a30.0","@material/theme":"8.0.0-canary.2f4711a30.0","@material/animation":"8.0.0-canary.2f4711a30.0","@material/typography":"8.0.0-canary.2f4711a30.0","@material/feature-targeting":"8.0.0-canary.2f4711a30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.2f4711a30.0_1597269243722_0.5659732173840544","host":"s3://npm-registry-packages"}},"8.0.0-canary.2d72f3659.0":{"name":"@material/tooltip","version":"8.0.0-canary.2d72f3659.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.2d72f3659.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"40ad1e0f4bd5997e9d7bbfb2231c4b73ae829956","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.2d72f3659.0.tgz","fileCount":42,"integrity":"sha512-puzsWz2EITBTYGNAsKfPPRvPrbzdJS5/SwLsIYkGOSDddR3jTHBUB0ySObVMFezzwLtUn4+l5+zMNaBRlS/2nQ==","signatures":[{"sig":"MEYCIQCCBWRTRiozcv1ziflbVYdciPi0htFz45eF+QoBzoA+2AIhAP1nBZrVvIuoPMK5xgBUg/6CfqaTj94nhuXm4/qldRXU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNGbECRA9TVsSAnZWagAA/KYP/jTkeCu9dXJkWy5F17pB\nwQmOo1GBVN8jxqcxROXw7Y2WmTcU+/oh26SRzDFhUfFIEcjIPXaMeDuEHZRe\nOudC8clUX8bC2bl0DMpyWNxh7j0cIjfnoFudAYDVlrghjKX+NFRNKs8ei/h6\nJrOlH8DQo6MHcupbCgRlhET9n3vAbr9forB9sHq4SiSM5HRb9MrO6w07qiUS\nziWU0ZrKE+WEqVVWSRmUDRH2ijvcogt31f8uWJdHPAhlkWXah1s/EmliurVU\nvOL3tTs9r27yMwUoqabAQy72h4QkyGvZadrICNefO5/Qw1BTGYEwBnF3w4nZ\n7+KQBmB6U0MSS50oJ+FqRRx5L6y/n/K3a9nf/0075l50ub8m/roRulyJvwLw\nYWbqpmSUUWgUvggY40uGb0m4eOxiGlxBgV4CQK9pn6R8jxH+QCESGwkr3cn4\nLsZMhXBBF63J1iOzNSdN6QGHmfOnUXIx26uckQdCWXR35Wpfh+GOva0LuExQ\nHl8UOCqZv/3eWqsU/Tu9g1sCuCU5iqRb6oXgCWFhmq7+Uu6fZX+m6LRr5T3R\nHvAQVDmp6uUTRjBfNEShdRgJPopMasngWlOywGWz7s68MTlAEEGjqoEmssU6\nTSkjHwNJNtcIWotYzy12ysvnblR9Bg+rTvdy5/hs4+PPpHG1zo9hdQr8Cn+r\nJcph\r\n=954E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"de40c24a4d850a3bd4269dcebba821d972e01c19","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2d72f3659.0","@material/base":"8.0.0-canary.2d72f3659.0","@material/shape":"8.0.0-canary.2d72f3659.0","@material/theme":"8.0.0-canary.2d72f3659.0","@material/animation":"8.0.0-canary.2d72f3659.0","@material/typography":"8.0.0-canary.2d72f3659.0","@material/feature-targeting":"8.0.0-canary.2d72f3659.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.2d72f3659.0_1597269700029_0.8082590432096117","host":"s3://npm-registry-packages"}},"8.0.0-canary.1fee70a5e.0":{"name":"@material/tooltip","version":"8.0.0-canary.1fee70a5e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.1fee70a5e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e0859e06656406adf38aceceb396b0d0505c0788","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.1fee70a5e.0.tgz","fileCount":42,"integrity":"sha512-bz4nUVq407xwfdDNEWVA8wc1gbWml9IZ3r+1CtiC51/FOVKJYXol+z/QHF8XyFP0tLn6fpDRwyVPuvMlDgOdNA==","signatures":[{"sig":"MEQCIEh2qXgFACb3fWgZDl1ck6aiZRP2aEx4U935yiHnIHJZAiBulvH8E4Jq2YYPMJvDOd/3rhuQ8DZ5C6EFWwZOZNGJ1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNHtaCRA9TVsSAnZWagAAUjIP/25mNXyXgQbBkwk8lZMK\nXhPCMnXxK+Yp0TD7cVsQRAEbNXeC1CQ/0Oxz3ayFiVuYFwfMP9dA3gboW+rb\nxTRs3KGRGResQ/PC3EZKiGKixkzAFZwDFR/nPs89jxV/hD/St5sM9nJRTWtL\nJALijoC2FuwbKPniIRRFTqw7woq5ZFqrd+bErAaMTJyIg9T8xVQdLnnKJlYb\njyy36FoZ5+V9S6Ad09MgMRAdSyTPeXGAETc4AJ1Is8F6NtjHzZOVOiqH+PF9\n7jSCR5iOoe6lEQR1nZe5Wf0PmZieu1qz3pvc4Kzqna50ZziQA5JrWsR81zz4\nEJxVgqPLuIe6d5R20LANgwLU5cezsBv9x+Gm88jdpVEPRTpieyImIW4QT0iU\nWNnD6rDLJgyTXsERBDPsGRasUBc7fzHvikgvb2m1g7oC3R2wpx5Q34zhGgxa\nq3Aaf2TVY2VB5j56d4Z8DIDzJ56jv8odFP3eyp+0IMxL0SYhhm0Sa1+VZgRj\nAKltta9IrfTBTCUuX4BW6NG8iPqsWt2aT/SOqEV4u9metTRUAMyZNjXHrh+c\nnVq17vf29iTCCeR7d/FExRJ/7yoM4KO54WGyPVYCatSV/lb28lB8/i2TSuTw\nqMLprURhHVDIO+t+Z3QAxlYBc1PWKAHYvw1pmocEkREsyoPwccJF8TK3X1TC\nukqf\r\n=BEbz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2e5eed4b73395e9cae47d93ed6f34f0dc0467c28","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.1fee70a5e.0","@material/base":"8.0.0-canary.1fee70a5e.0","@material/shape":"8.0.0-canary.1fee70a5e.0","@material/theme":"8.0.0-canary.1fee70a5e.0","@material/animation":"8.0.0-canary.1fee70a5e.0","@material/typography":"8.0.0-canary.1fee70a5e.0","@material/feature-targeting":"8.0.0-canary.1fee70a5e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.1fee70a5e.0_1597274970313_0.30135404551451517","host":"s3://npm-registry-packages"}},"8.0.0-canary.023f3fa34.0":{"name":"@material/tooltip","version":"8.0.0-canary.023f3fa34.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.023f3fa34.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f6dfe00dbb2743b0aa1e9f39c7875917b355df54","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.023f3fa34.0.tgz","fileCount":42,"integrity":"sha512-zcJYY0NF5Q92cxhvyScOi//HOtxRHYFNzd7kVrpkzZtHoL1gD875yy0KIqTJnkzIU2tZDF9gjCtK9Pdd5fhY2Q==","signatures":[{"sig":"MEUCIQDS94fo1p+4I1G+l3nFLv2Vn78wNMasxMmyg9+LxuJRVwIgZwIiESANgvt3BK/uke95S8wtaVTyP9B/BX01MlE9HVs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNJOpCRA9TVsSAnZWagAAz6QQAKQJ99dja5UMMScSWgLT\nzgACNOP+Ie+eobxivBVcaJlBKwdwj8Hk6aEXJ2k7xQZd6bCF/8X+kNoUOY8o\nsED6Kbxx5xLtTz9JM/dQbUk7ynHAdWlGyLgvgkgoKBYZFXRWROR3btyXSD7z\nO6NL0NrDxniV5DE5OIsIlotcU5EUnnMEFL9mIz/d8iHHlskn0QreFCGfznHm\nRc9ebZZLgINnmZ8inKrFPQDDahuvGkoRI310AXUUz8aulrhXtOzn60oos3/c\n2xjXQdAfCDduzA6cdKPGnz8eFXMX+37xp8R7W5tJ2GOSyokLYGfxHxYSHOyT\nGkJJkYd2VChzF0KWwffydiwvTTcq1AV4yb92Ccs/2c/T7uSzWObqYUpPjpUX\njJpvY3Ubpe6W8cVIF7ZettI6i5OaFPFVqhvUclsvBGMyckJ6aCx89RRxUnM8\nlWJQsurvAC6ifg1Rm6NCr86dlc89Uu5uRxLv3LTbLeHv6dVkcfWogHNcUJSs\nNbYBpce4sXe+zEH0e1TzZ3M8UWTtz5d+drQxAjBqoegZFmuDIcFqnorz5j8X\ny1UOSd5qfMmDbmDjIt9zIh8V1KhtFEEf5h65h4CnPXCpNI2X2Hoc6nY/q0Mk\nu7ybJNFQyZ80ycMPgLUhe1fVRVSLtudtS+ll9iHsuuBshThJNe2WL4lwG5Qv\n9E75\r\n=/08p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1a6538d0b407fd8e7a7de8e39b4ed51bcefc560c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.023f3fa34.0","@material/base":"8.0.0-canary.023f3fa34.0","@material/shape":"8.0.0-canary.023f3fa34.0","@material/theme":"8.0.0-canary.023f3fa34.0","@material/animation":"8.0.0-canary.023f3fa34.0","@material/typography":"8.0.0-canary.023f3fa34.0","@material/feature-targeting":"8.0.0-canary.023f3fa34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.023f3fa34.0_1597281192548_0.6253942296110295","host":"s3://npm-registry-packages"}},"8.0.0-canary.80f3a9e5d.0":{"name":"@material/tooltip","version":"8.0.0-canary.80f3a9e5d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.80f3a9e5d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f5c581e50df159fca5e82a9860f1907ba1127c6a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.80f3a9e5d.0.tgz","fileCount":42,"integrity":"sha512-+3TWmUafLcdIBl+b0Lh4Amaw0Vd4Hlix/S9rpylrPuafmHEX6BsYLVVo9jeGrJykOgXGTed+eKx1F48f1llQYQ==","signatures":[{"sig":"MEUCIQCDnrMmTqo3u9CSXo746ZtYUFQYVukae/LjKa3M0HvAfgIgAh1cFZtgjzCvhUFZNYm6lBaHKVRtGUwgGb0rxTxe6/c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNJeWCRA9TVsSAnZWagAA05EP/R2QbcUlqIYZdLRZoHfJ\n59+Dh3AszWY6pI5ckpqxdiAoEjGBvhHY0rvfUSEvGWTf/l+89EdlHtYdL06U\nCQYMl7SxbZF3h6v4i2WhPPsdQFFL8n1RtNiBBuNjZwk++JK/oqKNJrmUBmTC\n4OezDLER0ugWiEjlBbX93SCicHKrmundpWwaYfRLrPbNBe73t+YL3dj9MQkT\nQAMbTa+pH1AxxQ8IxDuXNwA8j7MUduLc7U+AAcZjEksVx1AY81BJXpe8dC/H\nRCnGRYetwb2OOR9I4+QIrv+NDXs0zmOIfYcYckxPVOl5itcgAAtCWmXU9JqW\nAmUc/lSkew0/hcFW8xzNRmeg8xiPrlf/3aMI4vvm2v3vbcNLGZotBnAcFO99\nbl8nmMnkfIX5Y8lCnjL0uMePDW033X/3lE+yqctUOWI+xQtGufr1tErKKxz/\nTAyo7n+ZbFNKucmlNs8uz1B0tc2GrLtj+7SbrycgbYLaauPvlOwnNQ92CbeT\nk4r4EOsIJ4HF8oMw8d/n2zbhASfH5/VM3dxF44DKMax1f4VYrM8ZDvIeyRN6\nSM/6+HSnBZ2s5Das6YdGSRTrKgqnmXmtbhujPLZPeC9diGoKEIWKkBllP8fb\n9zI5VAe6hPvkejkHaNgTGth2pOk2OfjrGsPcvc/9DZZpUkvfa0m8ueBLhQPz\nVsrA\r\n=3Uwx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e47018f239b51581a67186dcbea3f4167f5ea3f2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.80f3a9e5d.0","@material/base":"8.0.0-canary.80f3a9e5d.0","@material/shape":"8.0.0-canary.80f3a9e5d.0","@material/theme":"8.0.0-canary.80f3a9e5d.0","@material/animation":"8.0.0-canary.80f3a9e5d.0","@material/typography":"8.0.0-canary.80f3a9e5d.0","@material/feature-targeting":"8.0.0-canary.80f3a9e5d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.80f3a9e5d.0_1597282197942_0.06359991323869285","host":"s3://npm-registry-packages"}},"8.0.0-canary.a1dcfe97c.0":{"name":"@material/tooltip","version":"8.0.0-canary.a1dcfe97c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.a1dcfe97c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dd6371bf31a0769562d7ec0b4a1a310241619523","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.a1dcfe97c.0.tgz","fileCount":42,"integrity":"sha512-3n+xz0eqLSSHNiLiqGWxqpCcIko+EfC9jmUKEhckxJftRjSbV90aV1Kv1KMEEWpN68gro9Q4H4pz9x9Zz/CoIQ==","signatures":[{"sig":"MEUCIGhfT706N8DgpDCfqoG/VXF8dHgspe1zLJH6Zrj72tE7AiEAq7F2yG1bkCzxbnA6FeVLw0oOJjfgCnsheXokxVvx35U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNP8HCRA9TVsSAnZWagAAjmwP/i3AbgUCFHWBDx90ygEB\nXvR+7MAllOVQKUJpyIKAJhxp3hr57Zyibx5/Bq77aZyggPGMgO8Sqr13m4jf\n1QAx5Y12bxXorsTj2O2onjPouq8iCn7RyIwxzMP8PiEEV23A9ZUqHlOhnznB\nb7GDz8baAQw7/nem4BL5Q/XBxxKYtQujXFDcOW3KGamBTnomuxnxd4rmJbAH\niTDQVIrXl2R8PzOQpfURHY/QJHh7otPu5JiZpA9rv4kNrl7aafu37oxdPKhQ\nIdf/RR3qvVFpooVf71dhHyEvB3CTsyMJi/+z8TM3yOeb1NShWn8hoYI7O9fu\nniJasiGsRBw6o1KB+7lFUpZ5ylG52JnRi+EnER1o/vXcwvQ51KJOnLC1Qf7M\nQVxdK7ZH4r60+U7aLsWj5CtJtpwb3FFNczfVeQQsW2qbpARlXNGTFMyNa+96\n7dXIBEEP/mK73SzbV38yqNAiackTVOOWTLRnyIJJ4YMrIfVu5ESaGvuUCPZo\n9SEEUZU6xUXGyip91RR+QwOXyPn8ndFNqhRir/gK27WxdiUzdfVv+qLR8W+n\nzg0o5qDdudc4io0JuUC6zzUGKaMuryfDqBSIvtzzCAuD0lJPZ8jC+6aQG47X\n5TFy+t+hvyyUEa7inZeI/RjmIAS7JJ9VZ0Jm9agbj6tCaAiE2hrR3SOCZECQ\nL9rW\r\n=JpCf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8ec1483dd23463f0239974be9a65ec22a6b54715","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a1dcfe97c.0","@material/base":"8.0.0-canary.a1dcfe97c.0","@material/shape":"8.0.0-canary.a1dcfe97c.0","@material/theme":"8.0.0-canary.a1dcfe97c.0","@material/animation":"8.0.0-canary.a1dcfe97c.0","@material/typography":"8.0.0-canary.a1dcfe97c.0","@material/feature-targeting":"8.0.0-canary.a1dcfe97c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.a1dcfe97c.0_1597308679062_0.3748931616883304","host":"s3://npm-registry-packages"}},"8.0.0-canary.af332d5be.0":{"name":"@material/tooltip","version":"8.0.0-canary.af332d5be.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.af332d5be.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3f2a2038597678b3f3fb36a20f67a9e064ba6a85","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.af332d5be.0.tgz","fileCount":42,"integrity":"sha512-Lt9oMquh4hqw04Nv/8yyUB1+GNxXQwG/ZpwMkP3805Oy/gf/Tt8L5uX3H8ouKH7T4lq8zxHSoGrlhd+4KdZeZQ==","signatures":[{"sig":"MEUCIQCbSB/CsEbGgs+kSiywIPqMTA5s1Dkuayqto7ERelDnAwIgVOEKMvRNXa/mWY7+05O+hRU+GuYS7EnoP2FInySWIUc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNa4YCRA9TVsSAnZWagAAwaMQAJSYiZeNTt1rrC72yTBf\nQ+jrq0a5r3WhR1/nxanJaMfCWSjGmGUGcOmFld2Ku9q/cv2r+QM6W6Tf5lsH\ndir5FDNRpvwCo55dC+peIfiMYFpIhZHmlH6vZrXArkmUV7h6hLaWQw/PwkkP\nawkOouNpJFaTUCCFc695Ma4NpQgkpiHH926q6YbA4dknam58QUPtlK/yU33j\nmTuF6u93qd9FMZ6692YA5EW1Bx5x60WavGAt7wbVh9mn09aCsysyXDataUr9\n3t0cNccHkeQGickPmrfI19NeMFSevRDqp3PJxcLlRfZ5v3SD7kc0C+QYV1Uw\nBMWAt91sWjS+4hC5Ky/ZTtFN4Xr1lXY1SMurw1UJor+CsVVQSLTHGVRzKrTw\nC2vlolmaRw87ZFqpMg6vi29wXSNDcH6mfrGX4tDg+3ueJv9vG5Hz5EozgTf8\ncpupE10ki1Nv5BdnBU32Li2o/pqdL2wm5Ninp5V2caHZACauT3+oJucJU10Z\nriNamUYaxlAPPZ73yNhAsuz3NL8JaIEUosuZbOTI6G9CKRLvP0/2DkdXM2oa\n+x0QWfbhMK+OlgRRGHMfuiHKzGqvSvMTzDbve5UxpvJwxcAHv2gljMxWV5hW\nu5UipUEiPBo+BxlTQ3ogT+y+hb7/o7ezHOp3xuHcd2HFnHUWh5pkfR6tpIBp\nC0Eo\r\n=TqGS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ecb675d071cb76738aea95a2d43ef88a134275be","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.af332d5be.0","@material/base":"8.0.0-canary.af332d5be.0","@material/shape":"8.0.0-canary.af332d5be.0","@material/theme":"8.0.0-canary.af332d5be.0","@material/animation":"8.0.0-canary.af332d5be.0","@material/typography":"8.0.0-canary.af332d5be.0","@material/feature-targeting":"8.0.0-canary.af332d5be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.af332d5be.0_1597353495367_0.32739905563899185","host":"s3://npm-registry-packages"}},"8.0.0-canary.7dd4567c4.0":{"name":"@material/tooltip","version":"8.0.0-canary.7dd4567c4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.7dd4567c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"555845baf793cf7c89c8f926515ac462a09ac205","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.7dd4567c4.0.tgz","fileCount":42,"integrity":"sha512-VtSTqcsdGOiBrPmyQT1PzcqgUh1559OHjg+sZhfiq5T+m+Z+JM6e3W7Mb0eY+MpchlrrBK5mjj1jaR99XuJIUA==","signatures":[{"sig":"MEQCIE8vtTaYrkHZ9HEd5oX5hDl+PDkS4xz3jAv/NmwK8dF1AiAZ1j7YVz4l60lmihCa2U35NC261+ZptlhNdpL0kORvsA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNeArCRA9TVsSAnZWagAAmb0P/jLkWOfrI5LwXEmLpWpw\nH12mDlvFyvoMI+7Gdglzuh/JHgBX1ZGiY8ulZ2KTgkT2r2Ut93u2l6qRut3f\n/da0qWKO74UFMtGwvWiIojZg1EK85lTGPe61itZMpbacmukNl1cV6tZ38GK0\nZ5svwbipnt7Ydi8T5HorJcx4NB5/VeRL37BmbiRrvCIN4Pwn6iVx6dZbZSSd\ni7b3EWW9AELHrlOacD4mIKVip8Wky9Pj3pI/gwImrs70t0xABL7xN9i3RN8y\nc6lhfZj5QKnBcLsvBP/B6SEZD9htXHHQwPPtrkNPqNWW+Ynhts9dK/uVsntH\nOYt+Tyfp4QDA0nKY+aHNnMr3D+jFZQZ9O251rReyEAIF4CLAOgZ8oH+B13Hd\nheel+5UpKh+cpvCnPvX3Y+EJrvJ0MLfyxDx84ssNxBkfCR3LxdauRBHoMRH+\nualT9rZZE1Vg5pNKaccxO0ch1wHYUkC/C2PjHS+G4UCzX/sgoVHA4v0oHDdd\nZxLsqB2xrcEUrjq8YynTib9S6PhGakh3Xjffgw7uw1wVI4+4cJvdun7E3O3t\nQddZW0QhvE5xacxeVDui6IOR5ALIeju6fliCCWKvxVjPN8I5BlF1Gf7aQe4g\nlBKb6M6IFr4KA0D43BOg14fOSKfGv/ihQMyZWkMmui/u6YFnpZ6XE374fxRC\nUpgI\r\n=6VK/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"515ae143d426f0329f0a745e0ad35113761376e1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.7dd4567c4.0","@material/base":"8.0.0-canary.7dd4567c4.0","@material/shape":"8.0.0-canary.7dd4567c4.0","@material/theme":"8.0.0-canary.7dd4567c4.0","@material/animation":"8.0.0-canary.7dd4567c4.0","@material/typography":"8.0.0-canary.7dd4567c4.0","@material/feature-targeting":"8.0.0-canary.7dd4567c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.7dd4567c4.0_1597366314745_0.019013231499604544","host":"s3://npm-registry-packages"}},"8.0.0-canary.ff870005a.0":{"name":"@material/tooltip","version":"8.0.0-canary.ff870005a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.ff870005a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5a534b39845ab31b145c90777b8a1f20fd4fc90","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.ff870005a.0.tgz","fileCount":42,"integrity":"sha512-MyxF/G7GTrQ2AjLokFVJe2/aWjPAUUim9ElhEm5VjCJvcV5fSrlerrwosPd+IxY/Rv0nFwmEEuLj5hgH/cFoyg==","signatures":[{"sig":"MEUCIQCbJy+pDq87nUN/ynbJm63+IvVRsBdlwLUh4dz/rVLc1QIgBg+WtNLiVWmpgojifSo66EDfB7yrSZNdwuvK/2Vo218=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNeYMCRA9TVsSAnZWagAAXQQP/0ONGcvt6/ixqPfvcwkf\nWrKS8vD+lRH82rfSzTeOizvspewg+gcQgVhV4bVRi2wZdxFUbp5SQmwem4X5\n8M/Eq0r1RvLdwSnfwBaXyDkiSwoYL/hirVvgAM4pPRU6Ywu4qh9S1gaX6zrP\nJt2pp6Yv7vkaLOSOjZnQGtFHrIR3Bu3ST3ptINHpZEhltsJ85Bb0+v004+66\npfmKg9VPtid6kzDbKD/D3IApdUgAdrlvKr0skAjZrWvVz329drChEKqTHd9g\nuTXchBLHXN+vD0Og0LdpTBdbh373jtWVRg/hIS/Sknp0A/wOGiWGqH6z0Bm8\nZg80dZlezWjTn60pGyCUBg4vZ3G+kVlsf0ak8yiYijiKX/LxGnTqkg1mNdt2\nyHXpR9GEYk5BvbIiTRaqUss9XCrR1zUxb2Y3p8S+UDewTbRwghx3VAhoiwLE\n0h/DQ3vQNpAp2wEX4x0e8g8DtBY1D/gKhz7XlT0JrpWJidDZE55gsM78cGys\n413IXT4RqAaqAXnCXr6ZEgXbVSNVyjzOglO7458tjEeuZRjCzXP+lxBI1huo\ns0FAmGFe+AIAxAsV/KIdzEJD0TSqcCgvi0uvc2ka//b4SXeL+BRxBZyWnZUc\n5D0ibHqTgj1Okona12fFk9P47hjGITdZWfCFAeSQ+sNz/reRLfbnzFssFU0c\nzVgU\r\n=Vqos\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"885c1d5e1cf217db1bcb8176917a25d6c74575a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ff870005a.0","@material/base":"8.0.0-canary.ff870005a.0","@material/shape":"8.0.0-canary.ff870005a.0","@material/theme":"8.0.0-canary.ff870005a.0","@material/animation":"8.0.0-canary.ff870005a.0","@material/typography":"8.0.0-canary.ff870005a.0","@material/feature-targeting":"8.0.0-canary.ff870005a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.ff870005a.0_1597367818069_0.10028703961825469","host":"s3://npm-registry-packages"}},"8.0.0-canary.150f427a0.0":{"name":"@material/tooltip","version":"8.0.0-canary.150f427a0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.150f427a0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"77b269bad00a1df037fc0534f63182a157d5be65","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.150f427a0.0.tgz","fileCount":42,"integrity":"sha512-tACPmxVN5BG/poHQ2B4Yier1HDMLoBcsNCBzuB3+P8lwWvFannS4fOhm3dUN+3/kMLOyALae+SVFvyASXKaoYQ==","signatures":[{"sig":"MEYCIQCX7Mo1G61Dk6Z2q0SiDA0QQGnS5eTiRAQYXuRMBA6QqwIhAL+KOlRNfJJW0YUi7JQLdF59PkAxAzkpEvjYEZlNUDCu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNpIKCRA9TVsSAnZWagAAjyoQAI8Yf08pME0z8gOfJQD8\n162rvhk1MBVGNbubOdz2SseOUq4OB4+UUtoNXBnHgyZpmgehzdhNu4rNGF8l\nkN4jIJpJJvsWiZmXJ2s+Yj2n2PxiYkS1RAiVWaiAmEaNckjjAL2Ndtch3gh+\nHEipqR6Vic6OsvQ1jZ5oiNcfYo1slG2MFnL4ovsAjYrxgVuehDxGQOyOECx2\nOLeTf+FFHdD8isxvvTui0bGL1y2+ETXKdZNKLJeV76D7L/1It319kgdT6b/U\n46VWCc08LOmWLaV3THCluiiv66RN9qFsuHsTILSTXC5BmMcSl9hN7atWkp7l\nceqC9+1gLEi/hHNmGNkOiCwxJFe3cdu7TpRxKgocdeEyH83ZMDWmCVXtCfbM\ni48KR+u5kPmaYqf26/3TlSdrsk6y+SqCK6F3euyytXEl+Y4hOdhSw9oQ0C7o\nIcjZKF77ltalX2Tm3eDjD506KU+kYgm4qBKUDVFm9NAvbYisjpoNnf+I5EbG\nd+XJSRLYCa2VqvcKatc0elSDxOKWFWSzq1cVek47nDJI/DZfa2KRO8gpBX4x\nMuNUoxB3R+mmB+LzQMbe9NdsukJF8Bx1QVXX0he5T4cVT4wDwOoRvPQncef7\nBcPOKw46zHi5mlZD1Sr2xdrM2UlwrmWcZnL+O0/GJoBquUdb9BAccFLsP+6P\n2GY5\r\n=RWZM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9250d38c39aaaa2210225133bd9fa4da3739df3e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.150f427a0.0","@material/base":"8.0.0-canary.150f427a0.0","@material/shape":"8.0.0-canary.150f427a0.0","@material/theme":"8.0.0-canary.150f427a0.0","@material/animation":"8.0.0-canary.150f427a0.0","@material/typography":"8.0.0-canary.150f427a0.0","@material/feature-targeting":"8.0.0-canary.150f427a0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.150f427a0.0_1597411849645_0.18636759763914323","host":"s3://npm-registry-packages"}},"8.0.0-canary.bcc58290a.0":{"name":"@material/tooltip","version":"8.0.0-canary.bcc58290a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.bcc58290a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f9a543bc927782c67f095cff4824867d1223361f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.bcc58290a.0.tgz","fileCount":42,"integrity":"sha512-0A/rEnaID67SyIDkng0jMTtBxFliu1GmtD68zP48ygW7zgOIs2fCcT722RgcSuLEv4Vd0z6jiNH1aHXu0yQgsA==","signatures":[{"sig":"MEYCIQCsUdQuLJokSMIBs+DCaMA/B38ClBGLOsnuBuSub9llgAIhANT5DAcOAf+25eI+vw1Elo7VB9eEeuOGukBq2Zikf4BE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNxzlCRA9TVsSAnZWagAA13wP/iy7lwnLm9yNCrEeQzwZ\nUuoz2bcWN925texVKMwXtKBSLtaGwPHMVGWy0wfFg7MEU6l2J7JXKfZOn9a0\n6qC3n/xfdpE1rdwl9oHHHz5reAM0FBLYw/wKbGXgBPbKyl/Zk1Xea2hvK5w9\nm9ZMPPbtGcEbNof9OTyDzFQi9pXYiqV4MpYK5ZlSoNs6Afzi6QU+UkF3VhzN\nlClP47ayZdQgy+KL0wfDdyLRUZGRHsAIzQEsd901/EGZzzmh+DnmbJNi8ZRN\n/eXyUF9yI2h9w9lHMzfVOJeS+7R9kVXB+ZVB/l+Ow/uzqf3f60Eo54Rl4xAQ\nRB2NeSAIeJ1vmR9B7Oga0dkbqCB2jW5tGy6awvTOCDE3ERHPL9eMBUxlaJGY\nQnV80pwGHnE5OBUDSFQhKGKQ37BZym1ov4ISuLoVWkpACB2mHh+1ZEW4ce/S\nPUYaQb1EYoGYrPaThh0GZmA98mHHikrnq3nRxjohi27Z6kBKOoWCiq6Dx6XW\nH7rDSdoXlFly8MelFw4Ec1r3h3K8LYJwXLMVofJ+uvU+U2A2Q3PreW4ztOR2\ns7KTHl+pJHctRs4NgUZeqjAY0wWu0EJqP7twybVUAuoNqyEO09VHv6quay8+\nxIg0p28aCHtxYT8v8ZQbqQJXfwzBTIo4T1ay+TjqchrDLPmBW5v3tyLJBKPr\nNRga\r\n=tklW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ba12c8e781c26c6169e16b167798237b5ededb54","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bcc58290a.0","@material/base":"8.0.0-canary.bcc58290a.0","@material/shape":"8.0.0-canary.bcc58290a.0","@material/theme":"8.0.0-canary.bcc58290a.0","@material/animation":"8.0.0-canary.bcc58290a.0","@material/typography":"8.0.0-canary.bcc58290a.0","@material/feature-targeting":"8.0.0-canary.bcc58290a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.bcc58290a.0_1597447396481_0.18022041893797014","host":"s3://npm-registry-packages"}},"8.0.0-canary.4f55400bb.0":{"name":"@material/tooltip","version":"8.0.0-canary.4f55400bb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.4f55400bb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b58f8bb4b09773eef79145fb26dd01b5dedcd1c1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.4f55400bb.0.tgz","fileCount":42,"integrity":"sha512-HIsJBw6KRUwlgxqa+wDmAGG6i//xjJFKwmvXEG3lxFKMevW6jYw25esrX1nj0lxXnbmczWG4k9J4Dg9Ad8GNgg==","signatures":[{"sig":"MEQCIFigXWQf1fewSl2aBkPGibn7nSN14ELv0qLf/u8NUlOwAiAXX+SxU+Neg9E/M/uNxZ1QZ5EaJAWuDshCJHwc8yjP5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOrK7CRA9TVsSAnZWagAAu0sP/RXRGVuJAOsqEHA5qCVG\n7gQBaEsGvW+Pe17nroEx+pyAFzescNHfahJEwpBtVy1K++X6D5OPAswx7TJE\nQtgW8n/AvxGKoUByXfrSgOfgaFkLt3Jf/fQMO9AOGMZcBLpblD4xOeVLosfa\nXdT5Gtfih8nxAGa92Xe7fZNnCmLl2h6qHX+8R9KBfCtJh1fAyGwdnf4VTZSm\nBqdqQztW/0UrwKWgMoM2EuDLnjuJMaQMhvS7uxPqtqsodlAEo9qmQDNtayFU\nl8eSZqVu38DsRiFLXRYBWo28q1pomDNKTXQ6tZt9TkRPXF4FICPO0byCRZmQ\nXtttuQUSCYiraY4uHNfzEx+05XHXlz/7RT0pdH9DtgevhvPB2lP90OnSaymR\noCkljs9u7F1MqWRTeiaobV0VSaqxaswRSXGl7ntZ5l/UpAX1VmETJ9K9YU9n\nfL9kVkUcp+QwYFwmTRlI2wgBV/Ol7KAoZ9cRBXLTwH7Isneqj0DUzhtDe5Gi\noe/R2qI9FTDMsl8itM812bh8M4JULii6NOkZDz8/boczp9G5kepfI+QNus/q\nssFubuT082iMw/yiBDM9uVKMFjHZp0gFIJ3wmo9PkLMSU9IwqFr55dw00MPO\nWgV97KRfbuhm8wiL1VpZt0obDgm77rd4Ow49aceoyl1DiX4odRuvID5IE5pw\nQQgg\r\n=YFW3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a9eebd86aa2e631b994a71291827e602b842dc36","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4f55400bb.0","@material/base":"8.0.0-canary.4f55400bb.0","@material/shape":"8.0.0-canary.4f55400bb.0","@material/theme":"8.0.0-canary.4f55400bb.0","@material/animation":"8.0.0-canary.4f55400bb.0","@material/typography":"8.0.0-canary.4f55400bb.0","@material/feature-targeting":"8.0.0-canary.4f55400bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.4f55400bb.0_1597682363216_0.3536952339940016","host":"s3://npm-registry-packages"}},"8.0.0-canary.000d64815.0":{"name":"@material/tooltip","version":"8.0.0-canary.000d64815.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.000d64815.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d7734a6667227e22e21d92df18fa5d5b1019258f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.000d64815.0.tgz","fileCount":42,"integrity":"sha512-yf9f4AJKLoFkMXoOOr4tyh4dHPZC0SnJ4P6U+fy14op++rSKc/UaAz5PKBacZM8hZYZA4l/WST50MIQEhHIasw==","signatures":[{"sig":"MEQCIDhowQPDSwYQlY+9fCK2kBfQVMpQkFc+6/tUo8SZgGmpAiB/FMzZZi/hhKv0lxbO10hLBuKIKckT7E7YYrzknloMig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOrjFCRA9TVsSAnZWagAAet8P/ibbDrEck2DLBDh7VePn\n8zMrG4uvM/gCYqWszDk19I+BaIAOIUQz3Mto+F94zTFRWC5uBIqaeVVV5LnN\nHIMT/xmUOcF5K10WNm6BSwvbqg403OnkjDIqu7QqFT+Av5QKOKr3soIn0Sdk\nz7ScM8/kiOZ1fY313jDra20I1XjH4YnYLGmTYy2DTSXkC+w5mYB8NuX3RgDe\ngbhuQyFGSJRHZwc8/ABHRAG0JZFXkQUPqqlkWplTOlyW++dtlA6yA1NwZrP+\n+c12rVAvsqB/41tc6z9oeqcqStdfd1KiEIe9DUmUNr4pphO62gZHR146vDkb\n0l0xY5RYz3159YOngYbTtxv/+/9NMLsITwcjMcmXiHFsGMqTiusrl/Zwhiol\ncIyaeW96eMhAE6VFh1gcvt/2XupB7M23hofRty0RFJD2jFEiMTTV1It51omA\nHCklHV+N56wNajBA4c8v06noPZhBgQYAOxtnDKANjXmTryWX9wN3CIBIBIAS\np7hy0Sz0zPZ2xoj4EQJi2j5WURN6WAXuwkBfbkXACU7X8Y0n2DHcNnrtanVZ\n3XFc8nFgFAG6k7o/u3aIWZ0HdhtxWr8Zz8t/HCMZGNEvWLnyuKplqr28YWbT\nXLE6XSBSTc46hLIyz1RqUx/XJVl8bUDY+UojPDCwnpef74NkqQs3F7TxX3Uz\nUzQg\r\n=AA94\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c8a69943d64e6f468c2edeaf1fc6204d372a9fed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.000d64815.0","@material/base":"8.0.0-canary.000d64815.0","@material/shape":"8.0.0-canary.000d64815.0","@material/theme":"8.0.0-canary.000d64815.0","@material/animation":"8.0.0-canary.000d64815.0","@material/typography":"8.0.0-canary.000d64815.0","@material/feature-targeting":"8.0.0-canary.000d64815.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.000d64815.0_1597683908856_0.4792777977670277","host":"s3://npm-registry-packages"}},"8.0.0-canary.defa599a8.0":{"name":"@material/tooltip","version":"8.0.0-canary.defa599a8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.defa599a8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"459271a6f14253f21eef23dd27401dac2682f174","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.defa599a8.0.tgz","fileCount":42,"integrity":"sha512-BUkYsqAQmXNBASK/MzuxWdV/Qc1EC93J895aFCTlUQ6CFDGi9OohkbLeO0O7G//ukNkxWwZgNVL5QQqJSGRDLA==","signatures":[{"sig":"MEQCICY1JtkJ+BAdMoRzkWXjTKTGT7zNxt0K5+z8suHlHfQ3AiBSQaal5nlmTFhFqZgtRElttKmn8K6C4UxIZ0bQxvQCyQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOulrCRA9TVsSAnZWagAAKFcP/3b/WKTiPWHuDDcebudU\ny7w+nXdKZorkrS8ANjQfEUfJUL+Y7VXnDnIrOGbLVyeNrubBritqxcFELue5\nZ7WGnw4zLZC+AHYDbNFUyHn3RONB8z4blsDCjvq4NjMF1/WWeedH+OZlgLUN\nZhB+h8EUKqznhKTsT+8sD0kSFpdendJKRh8RuM7TfCxITcc7I7mExi1xlcUR\nm8vsoSxQM26qmafXQ0qLBiOqemVsE9Nc2A8dOs6+BdsjLq+dnQFTksPagrTB\nKygr8iImIZ+LLUNzQSf5rbj+i3MvFVxmfCsptoqfjxdr+BhbfkteYah/ndCH\nGK5DAwT9V5sjbKcVD1ew9urk32tFd1KnmNhQt098/3nJt16y+2eECMwtLoB5\nSdqVzHZtR6jieCVbnPqk+k90B7xSGu6EihtzlLzLSpCFPmE2SpDgGydglv1/\nuFkR7SnRcRpu+KsegnAbYjC6wl7HpQ6AXFq270Z9oZFvrNMTBYbSKLCHZCHF\n8skHPaD7YT0NdzsjS+VKU8ltiUlWaBolAtOyHYScytvuLNyo36r0IHZ2g0FN\n4XvMBbBQbsPOBE7ln2LCEU6rKKypjpQ0UXtGeKWs8aKUchc9FWPnrUa9An9J\nzJNj0ucfcExOPsVE7E+vYhHphk4fNnZemMFKGeMjAV3kcN/76GDAIz6Bwrnx\nxUJ0\r\n=1cJx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d3ddc8cf9af988fc4a02f26feee3e4ca0184dbec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.defa599a8.0","@material/base":"8.0.0-canary.defa599a8.0","@material/shape":"8.0.0-canary.defa599a8.0","@material/theme":"8.0.0-canary.defa599a8.0","@material/animation":"8.0.0-canary.defa599a8.0","@material/typography":"8.0.0-canary.defa599a8.0","@material/feature-targeting":"8.0.0-canary.defa599a8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.defa599a8.0_1597696362832_0.17504949439378414","host":"s3://npm-registry-packages"}},"8.0.0-canary.66b8ed7e6.0":{"name":"@material/tooltip","version":"8.0.0-canary.66b8ed7e6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.66b8ed7e6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7f8f27c35dccd4b602cdd42782a957ba4257a23d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.66b8ed7e6.0.tgz","fileCount":42,"integrity":"sha512-EIdf+1CfZN1xlIv94U4m7/U0Jb7GePdcexVT7Bu1aT4Z0hE2Rl0XwW4b4N8Q7Zlc9Zni7ypBaE+Gr4wVs1GOyw==","signatures":[{"sig":"MEQCIHz8bQtzHK513Pg8AtpRUWKyzRP1MUbv5Mr6TA16+5X9AiAL6TRqtbfd2OluiTnWwZgCbT5D/hsa/Ws5p+3v2ii9Yg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPB/zCRA9TVsSAnZWagAARcIP/ip3BTgdvdIocZoiU/ju\n0lo9bM3+QsLWykIHHLP+jxTz9gTQrnmhZgBagUrfVDJxh3PZ7GlfbUjxTQpY\nloXv6WzBpQc8ZkPxspt/aoGPrBa18BYtCRPeQot4MAcyv307WjstdOQTb0k2\nKm2aDxjZgglWxuEfMpO4UyE8OshRbZ4zjOk1IB0BLfyVHPhaqnOXzLQZMB/8\nrKRzkmXFYKMcUDgRW9Aj4/3wjI4xBNbXyx0eC9b/LaavqpYW371BV7sFZyvY\nOqBs7OoNAMOKsJXVtW+0R2/5E+tDwpZz5dc5IReMtpDNyB4/Bt3MbTA9j/j3\n+BjARgOzmQjDvgUyrk2a4gSQwPJdGVjW3hufKakciYYah+C5p+1H8cg+HtAP\nD1J1mYkHBmh2vHnqKpH0k6oAj/kodcc/MAnS4kEMGE4k9kNGTmo4oj2kZbfs\nB8NZb/kQWDN1DVPK6O4e2WV3HV1tVaQW3ogFn+Mb7Ng93ALAu5U9oio85pov\n9sHoOPh5cg+fU9UZt7+Klj8viPD3QDaUODK/C+dcM6crbkTQuAI14MwoJuZE\ntMPgYJo18nB75ymAGb6a5e36OU35bjQkODvT3h+9U17CQPrN9qmmowb7fKtL\nm5rFn6SMl3JZcD16nN/c1eTNeYZmEG4TX6SkcTY2g/7BGZnNMH0Dd0QoSQ5s\ntZR+\r\n=K7/J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c23c9dce18363cb6806c169d5a516da2a0fcf89f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.66b8ed7e6.0","@material/base":"8.0.0-canary.66b8ed7e6.0","@material/shape":"8.0.0-canary.66b8ed7e6.0","@material/theme":"8.0.0-canary.66b8ed7e6.0","@material/animation":"8.0.0-canary.66b8ed7e6.0","@material/typography":"8.0.0-canary.66b8ed7e6.0","@material/feature-targeting":"8.0.0-canary.66b8ed7e6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.66b8ed7e6.0_1597775859292_0.6324651773054608","host":"s3://npm-registry-packages"}},"8.0.0-canary.e2b1033df.0":{"name":"@material/tooltip","version":"8.0.0-canary.e2b1033df.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e2b1033df.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dcde9da4d528b92abfee3941a9b0007cc9db0339","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e2b1033df.0.tgz","fileCount":42,"integrity":"sha512-QB9YlaMgPIk4q3/mLyiaA6zrGvadCPcRvsrnWI32dgy04Jcy7/EjT1wvJmA/zahUjoBb2y14qGAGyF6NoYS7LA==","signatures":[{"sig":"MEUCIDkbuuyEOS6JkwlsLG+R38zWh56aGzT8YyOz8yfi1qLvAiEAr7/WCdumBVCsF+XDa6h7hrlbsyFBP6GX4iRxAyU7Tx4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPXKwCRA9TVsSAnZWagAA2PkP/1tLB5zS3M6HVl5tnFdx\nBgo3f1dlF7LegtNTXX00DWDnPO9GI4b6ee/lO06y8enJx8x8ZlVaJOZZ3yC6\nX+WyY2IYpqpT7jBqGjVKqnpwFM8R7TM13HcIyfpALU2oEwpjBtvyDuh6TMJt\nG0x6GrSNNDXdi1RxRBpq6RMVc2h2acSKxEGlYTDZVTBFdTOVJ1cqcOOBgXUV\nTaSaQ4kSrNRD+CE74CKRi2v8BZxfv+AJ3Zkd8tbuJHkybOmbrI1IAXVoq/Zo\nKK9zHa2D0nqrZJ23/BjVmsU8SwjCrKdHkhs5sIe7NsCAdaPdJ+/HJIVZcTBp\n2iopFUyGB4kOBFvC58b3Isjp2tyU1+8EnFNeE9FEYIUSQRTeBY7hK7EXfwnT\ntRtl+IftjF5a7uCzGS1ZNjtb9X5R0oP+V54ss28TXO9K0mOkUDURZWFVJ+yp\n+ON+e1ny8LCNaVyBOYUcLuLsq8Td7DTobee8RdHiyUHyFgRBySU135QofW6Y\nPayPTzRLLGQxUjtEkWIwPEI/Gjn7qLPa0IoqjZEDwRWvgKuML8iO7Dia1CAn\noytmTaE7r+gUs9/DZXrLtaIKujK8BfMZ54sNrQw4welaYaIFM935bJyWWIqZ\ncfMYaT0/6r7QybiM7XiHcFanrbEKuf0V4MTr3PHByPa99cmOxgkqSVcQ3pMb\nowhk\r\n=UuDs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"763ba6b73959bf0639ed8d0c9656a53b18e30c1c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e2b1033df.0","@material/base":"8.0.0-canary.e2b1033df.0","@material/shape":"8.0.0-canary.e2b1033df.0","@material/theme":"8.0.0-canary.e2b1033df.0","@material/animation":"8.0.0-canary.e2b1033df.0","@material/typography":"8.0.0-canary.e2b1033df.0","@material/feature-targeting":"8.0.0-canary.e2b1033df.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e2b1033df.0_1597862576274_0.8504578962834994","host":"s3://npm-registry-packages"}},"8.0.0-canary.2e8c3dd2e.0":{"name":"@material/tooltip","version":"8.0.0-canary.2e8c3dd2e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.2e8c3dd2e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ec1c8ecd542ddf2a71344907aba2094c0e9621be","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.2e8c3dd2e.0.tgz","fileCount":42,"integrity":"sha512-sB0cfaHPEotkqxcj8B32PnyReszHUcVt6TKdANAIe5MDZlKcYy4fJmHHRciPHRTAcG334tGv8pDC52hQe6SuLw==","signatures":[{"sig":"MEUCICxBdashDTB/+2ruYpqMlRV3Y13RoO547DEeTtss6kNRAiEA4QRVs6FUbRoHd7OkVOhMWg9vzpygqsOlU07toCXp8nY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPXx8CRA9TVsSAnZWagAAHnIP+gID6NBYCutW+KrUk5Hc\nimd0Gva4vVyIlnYCC94kA6G6jPOqO/Da1LEWJkIbaijOGgFLQY+mnIPlH2Q0\nyZgN5vXLf1QNL0PSdyEKZv80aUBt6hD9qO36AIN1xbRBO8IN682LuDK80XUA\nR8xMGsKo6qKxQ0LVq6YiOCEJkxz6E1jlDZQ6LjggmnBVkAMwQKUQGc8nd8e6\no9ROWXYTziCAk1fBo7fOxmz5SSjlFh8PbyQWn5n3AcPwVkThkVnxEaCi+6a8\njG4oL4IpEquGGPBHD8xS78M96f0L10cXIkx6jR/0JEvkYep1Yk1TmEXizP0G\nJyICdKajEq8uGpeI5ke9EoXWKndDCFXNpq5Vt+TZm/0diYIufRwAvsBIuY6/\nKb9otUyomlf7OxU8wXCCeo8dPJw6qZcbYnCcy8CCaVyGGtBzfamR/RJFts3p\nyEZTfjRqSduS7TPmw+wn7CtAkCBASgT397YRK+pKlggjPhJMNjWNVw0SO+7/\nodwhICJ88xhJnz5kuLy/GThZ1GX29Z4boySia80JeaBb1vhZWgsAwemxgKxH\n7dgrOXnRB7lZZJD4mn2Oj/mgFakPxU2aHYrFKx+SozIaX8TfswT5DqZVvGfW\nck6Bx9kWBo4nR+DkflW1jQrOX9gVPdvEjHUtzNb2nF1vaOUondQmCreLbOs5\n8bjp\r\n=SY3D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"237ca1e061b4efa53d623ea5dc9c9d670d5c9da0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2e8c3dd2e.0","@material/base":"8.0.0-canary.2e8c3dd2e.0","@material/shape":"8.0.0-canary.2e8c3dd2e.0","@material/theme":"8.0.0-canary.2e8c3dd2e.0","@material/animation":"8.0.0-canary.2e8c3dd2e.0","@material/typography":"8.0.0-canary.2e8c3dd2e.0","@material/feature-targeting":"8.0.0-canary.2e8c3dd2e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.2e8c3dd2e.0_1597865083741_0.4620682700669576","host":"s3://npm-registry-packages"}},"8.0.0-canary.b2e80a5d9.0":{"name":"@material/tooltip","version":"8.0.0-canary.b2e80a5d9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.b2e80a5d9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e631c79d41d468f51988e62eca4f1839c873185c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.b2e80a5d9.0.tgz","fileCount":42,"integrity":"sha512-F2G0bKL8A2CO9pYM6CipJsRQZiUA8ZELbWRAwtn9ojITN/sKufUUPcDT94Csq6Arl8vEEq25atjMK2r218xYcQ==","signatures":[{"sig":"MEYCIQCRGxbxy+G+MkdPpXDQxm2TJIPMvQF44PofSrBR/rb1TgIhAMaZ0jp5QlTP5O3ZfH7tTgnI5zSQH9M3NpqA8tpV5kjH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPaX/CRA9TVsSAnZWagAAm68P/1VyQt550bpIOtvT2KCC\n3YfFYzV7NwRLYXPj09j9eprWG0DNuW7Mao7e/Voxio7C96qs6W8d+F73S5yQ\nrDRQu3ylskqkgBvEpww7s3/6QB05Wa1nkuY8M1UIX7/4COZDvlCbEouZlBBJ\nsyaHoZ8VwD3260sTecRrhiWwUSrz4swHYrl/QnO5SyPGNv5plGutRhcDyt8l\nXXuaBy776D1xB3Ru7KhEwb+A/TdT+Oy1MBNHbauAM8siq4h5OabgUKVfKv5U\nUzS5XtTaF0XlPE5iXe+rJkbM6A0KcBlWqnGlG8VREa8qzm68nTQaHEHVBMJX\noNjabEw5EnADW0iVQECTNM7/Acd+K+En/mvhkdTV9qp2uwUJDA70dks5WhUO\n62zqWD3TFkianUwmtMqtFROqf7PU+vy7NnN2K0wevztT2nbBzYfL/U6uEn0r\nZv7Qc+rfoiavrJyMUGK3Cmb0qjYUFvl/4A7VPx1T9xec9/Ny913GscPPMkyR\n7PDVaVwDRLp47knjWVhn8VnhSa7iMty5iEzoHTujDkQyvH3UcROx1+5/LP4O\nT7vi5YDJNRItZUNm3OeqcOmMQ3uzhVvDJQBqRaPfPVuBO9f02ym4+UAyOFUJ\nFmRU/R4RyqtrV/qCpQ4lNc/BY5s+BBs/9Ti62W+r/K5Dfsk4RvVaUuISIEvu\nVMAm\r\n=OEFK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"84085f6b072572fb6b09623a5f0b35bb95db6fca","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b2e80a5d9.0","@material/base":"8.0.0-canary.b2e80a5d9.0","@material/shape":"8.0.0-canary.b2e80a5d9.0","@material/theme":"8.0.0-canary.b2e80a5d9.0","@material/animation":"8.0.0-canary.b2e80a5d9.0","@material/typography":"8.0.0-canary.b2e80a5d9.0","@material/feature-targeting":"8.0.0-canary.b2e80a5d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.b2e80a5d9.0_1597875711169_0.7419640669423466","host":"s3://npm-registry-packages"}},"8.0.0-canary.ff88df637.0":{"name":"@material/tooltip","version":"8.0.0-canary.ff88df637.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.ff88df637.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3f70a41cfa71636215a095dc1f102f5eb619802c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.ff88df637.0.tgz","fileCount":42,"integrity":"sha512-8f6HZjCdjzHHlGORKfjg9TTU0Xuj9bO0i2gWMzAFzB0vsx1Cg3n7oDICykbIMm+kjB/uIXfw6D/vZCYUtBfpNw==","signatures":[{"sig":"MEUCIQCwGV6HNd+2k/888/wbWrrQ66nvxWHUg/MHnGGrriW69QIgXuCMbkn3vJv3gEwepmsmgtrktBswk57zRt9PwsFAXVw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPajRCRA9TVsSAnZWagAAUoAP/Alk7rZ0qVBv4R85dNF+\nd2uAJlgyZQkIh6uT4saEf/sahY3rP6LM/jDFXy3nnGg0goVWOlJYNJh7KbtQ\na1Cjc4GfXEscBAsgqjvxaIQphYTE81l1AUClhuEVjcv9L/VeESUCrL4/bd2b\n3gvFzFiQgrLoDVSht2tY1pU7xaNYSzRUa7WRncd9hJRfuYcZpueIMN0SpyDq\n518cx6KJoEPIYk+wXN3hisRSDtZHMRccww6RAEF8sUrORUzXaLH7kXAk+DNb\nINGu4j6vp9whkuimt9TSGH9VkEee3f71P+3xq0N83mptgTDt8M8pbD9DOtfp\n7vgQpPShOtCCl5leAut/5Sjb/V4W14ZHpJyf+eh/Fk3U6t7prceYFo7Hn0ZI\nPpHzAth2FeiFzpqCtpTsSBU0NvcMKQejo7e2NcX2+DwDVsKVGtFGwQyEHH6d\n7RNM/qKhJpXBDsSRYNhIg5wLL7Yv9TT/xqiH3EsxTDeGR0U//3Ta0nW9Qv91\n+8RX1kJy58crIaYScj2R8IL9U4X0eZyIMR8SqT7moDIPASxK7pYw8mGmgyD+\nHQPmNKFODFZdH0OjIff3bOoVse70ZDWnMMAcUBxYPbE+5s5I03+SlXXOSsoh\n2g7WNR1eSXw80wZtUkhrhaeKqAl7vKJuQNe5CAc3z5TkRLHtXHJBhPa0QJpm\neVjx\r\n=HvvF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"36ba8daf061692c2f915513485e71707d8eae239","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ff88df637.0","@material/base":"8.0.0-canary.ff88df637.0","@material/shape":"8.0.0-canary.ff88df637.0","@material/theme":"8.0.0-canary.ff88df637.0","@material/animation":"8.0.0-canary.ff88df637.0","@material/typography":"8.0.0-canary.ff88df637.0","@material/feature-targeting":"8.0.0-canary.ff88df637.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.ff88df637.0_1597876432564_0.8747823387023101","host":"s3://npm-registry-packages"}},"8.0.0-canary.32fb314cd.0":{"name":"@material/tooltip","version":"8.0.0-canary.32fb314cd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.32fb314cd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9c86de8d0c59bee725063e135f4c7214d082bf86","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.32fb314cd.0.tgz","fileCount":42,"integrity":"sha512-BPlIp/iMlHWKj5svsp2zt4T9cw1MLP6xN/ffpCFocFEo6nKaX1Tke9dBNIORYhWNy3XbD6gvJBVOWbdDwbqpaw==","signatures":[{"sig":"MEUCIGFUuMgmvJMCi1IA2u+n7jDlLiQyY2tvd6Srr7NqmwvvAiEAgkmxmvMo626gvZXdKO5pPYQHyl2JqnRwHAIwqz3LvnM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":359913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPlKoCRA9TVsSAnZWagAAeOgP/izLRAlbN3g7ED1pAung\nhsMBBfSYppWreNSjTwjAESvt94WrLm2bzOp5yLCujX4JPZa/2yQvvsA6wgnt\nqFay9JQLb1q5WqXwqpMxjk5mHA9eZxZv/ERRqYqrGwBGgcPLVk2DEOGez7Vd\nz7glmaEjJ0rIdZPG2/oBSCoP4r3NSVIBlPufzankBEnYANmXcGQEfP8YwZe9\naBqhYRLeZd0NfsFu+ufWlFeWdpIqeblwl2BKvXglo/8nNt2gFMmLoFL4hiVI\nNs+aiaygLvsDShziQhY6FJpbAZrBaO7Ppf/ebQoDxOhBI/v1kAimnipPP93K\nmtCVKlLvYqoNP2//OTWr8BQSFEocORahQEpxXwvQSaOjOb0ZlbYhiHdQ3vZx\nlwPolQMwLvUKE++oWlajkwhuCNOCIUDWHrQkhDSNyK1/Jv6GRJKF2AAde37f\nRg6ki9ed974QvsJamn5MsxpyH+NYsx82ezN8k07DJ9iIbYDoEV4djAx5olZv\n1UMnHyAS1SEnWeVh7FflHsbkgbQ1ii3M8TU5jUY4TyC17jRLkAIqSqNM5MJ2\ndQXvJdifDOa1mKJSrMwXzId0Pi0xpoZRCcmCBMi/WHzhDFXNcOKVUnZXOiD5\nBuJb6+YTf34HyVlkfxaorBSYSFkk+g0/rkHwh7J/4cbIB/5wsfTeDeFgAEj4\nCHoS\r\n=Sn+V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"61108ecdbe311b101b1b87763e8f3283dbb9dd50","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.32fb314cd.0","@material/base":"8.0.0-canary.32fb314cd.0","@material/shape":"8.0.0-canary.32fb314cd.0","@material/theme":"8.0.0-canary.32fb314cd.0","@material/animation":"8.0.0-canary.32fb314cd.0","@material/typography":"8.0.0-canary.32fb314cd.0","@material/feature-targeting":"8.0.0-canary.32fb314cd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.32fb314cd.0_1597919911947_0.14451196730596916","host":"s3://npm-registry-packages"}},"8.0.0-canary.546277d32.0":{"name":"@material/tooltip","version":"8.0.0-canary.546277d32.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.546277d32.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"64e0cf7a05028189d700e3f26aa3c393fc59d5db","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.546277d32.0.tgz","fileCount":46,"integrity":"sha512-DHXxvxYsm7b2NWIxOb/PChDY8p7iFgT+h+dl/nYSCkP+heR7NZt3OU81XElWQcfwHhZKQYiHp9kdxmjhBnGnpQ==","signatures":[{"sig":"MEYCIQDMlMW0TzOPlXO5kCNZ+dK5e3HaWW00n830SG6DL96C2wIhAOyGcjsbrtsItfzUk8rPkL/+YNsi8l1XxKIXQsmXPypy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPqh2CRA9TVsSAnZWagAAzzkP/3x6RCJ9g/IjmpzPiHeR\nqFX8ERDAVvCff/6+vHe9QSLg2jRnJQnOEKrzVljhiyDp8nS220LC9jlhOaUx\nHh47UvX5gT3Ig8ROeL6ScFsGUF4XBvLYI8w11eSIE8Sk+KzhCDMfz1vmPuIz\nitMJ7lqKnmFvkF3QSJNsk5GNljjftYZ9j2x8+ruZSymiosnYSgZF1ZBMd8IE\nQgu8MUMkqjxwBtJcZArPd+0az+L0ZFE4gENOLPyxsqJ8j8LVm9bgSkv9+d2D\no7ZkybRc6UJIJjEjs23sBg2p/2c/mNx2bEBDo2ah/6HsyDwk7QKAYLHy2ZnE\nrq7PgCl51GtKcwclrVvyc1YRB1PKodzRQpzASqlzjU5AWEOkXIEDIkjMREYj\nZ2qSwMBA80yNlWtPWKWEmOxuxpUq6/Dkq3ZYaDcweMZIALU97eaYMwjq4KBY\nLPfTOkmpo7sJQYxN5rmLtuZDtLBlS5m/z/CDikzHn2G8JI0svc6UMvpTLaQY\n+S1nku+h058VlXNhjdxL/uaBlSaA7ekDD7DDvcoGrZY5Er+HncqzCwP4bKkF\ndHEl9mvNlOjbETjq69Q4L7GKBMwA2jRj29YzKMLIvlaMKafDAAtV99RWoNhg\nQo9DE6UTIlBFrujWR6C2O6KvSG7ozl9U3aSho2uW0KNwSr7E3xlPnkO3emkB\njFyl\r\n=Jy2l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1d97622107fec59bf3261ad4f1f3bbe21fb1ff62","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.546277d32.0","@material/base":"8.0.0-canary.546277d32.0","@material/shape":"8.0.0-canary.546277d32.0","@material/theme":"8.0.0-canary.546277d32.0","@material/animation":"8.0.0-canary.546277d32.0","@material/typography":"8.0.0-canary.546277d32.0","@material/feature-targeting":"8.0.0-canary.546277d32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.546277d32.0_1597941877658_0.5043353858400459","host":"s3://npm-registry-packages"}},"8.0.0-canary.da72839f4.0":{"name":"@material/tooltip","version":"8.0.0-canary.da72839f4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.da72839f4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"45c22db5890987fc4aca1db3cf6542f171b7b8c5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.da72839f4.0.tgz","fileCount":46,"integrity":"sha512-Dox+Vm80Y1rGk80u7A9thWFsYwDqD1lpEYQTLXo8KemfJ2KOoJHy9XQAtl1QAaouM/LyUFMdYkF3zG4YKKRdBw==","signatures":[{"sig":"MEQCIGGK0mzsc3hhnhHFgPVBZfPxb1P6B5DRek2pOWyQzxssAiA6Vrgc6JV8JLzI28bdjsLMEB39VTIsDzxmBPEsMaPoSA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPrpUCRA9TVsSAnZWagAAkzEP/jhuli6p7B7HcPzfIRmw\nv1x8xGB353Nz5tijJChACCDyt+fq1nhM9P7XpMxiPNq4GXEDJZjc810YcwLS\nFDh+ubFdBIjD0aIuxWhHD0hwJSLH2N8tLwTVwCqYEQAqg7Beat20Ha5+7cQ7\n6gDFqfgnzDfD3dSu2K7Y5OXregk/aspwUikBiPwdPrEO9pvPy6bojN7RBBXE\n1DY2hp8uK7tXAS20F3eji1wMkWEALQzzM+RseAfY96uVm9TSvTQwdIrZ9W7J\niuVPTeNVbTFhTolnqqaFykAri2CWwRn3A8M89WloNV2mdtu5bHLdgTIn9tjj\nLVAeYYLwIrVByT/70fWF24zG+pkncyGV4NIEQEHM8NRG7Qtg2tcMCK+Zu5MA\nz6lqoJiXPYUGkdbxHTbvSz5VTw+YolZR9eedgwafi4VyAb+Uhzn/zA1tPoad\nIzV5V+QHTACsfJe94jJB+/a2zaBc1ibfI5UA0iytJDnoE717pfLTM00w0xiM\n4K5vhZoJecOam9EzrZABfOqhWbd+pCQUEMzl2WtDd3vJJaa7PrWgoozK2TwB\nf/eixBcYmaCbRPovVrn9hNIGty7js+rMzyZdg2IG4rjayDa4ltnf0MZopJjA\nwTP4vFllvVo4Tv74yKY9seiUa8XnpmzlrzC0a4KuI1Ad65+v09X6ANyQ3/X9\ncUtB\r\n=us68\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1b42b69de51cf24aa95c09d0e08ae1e644c71335","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.da72839f4.0","@material/base":"8.0.0-canary.da72839f4.0","@material/shape":"8.0.0-canary.da72839f4.0","@material/theme":"8.0.0-canary.da72839f4.0","@material/animation":"8.0.0-canary.da72839f4.0","@material/typography":"8.0.0-canary.da72839f4.0","@material/feature-targeting":"8.0.0-canary.da72839f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.da72839f4.0_1597946451439_0.6700665919144984","host":"s3://npm-registry-packages"}},"8.0.0-canary.346069ccb.0":{"name":"@material/tooltip","version":"8.0.0-canary.346069ccb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.346069ccb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ccc6b9475404473427901647d93a09afdc1f5ac3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.346069ccb.0.tgz","fileCount":46,"integrity":"sha512-7dYdhF8LbcvpDfDAAzLyhjgzsIvJEA+VguIejGwiF0nGDaWLuRehNuG5jV5ImUGSrrrXvWulnmeOqYiq6zYpbw==","signatures":[{"sig":"MEUCIAQOf7os5GDvwe1qMztJWz5YWKAHoo2Rkb2vdJNS80Q4AiEAky8XFhh6qVATkxRea9HodXKvJsxiE/3F4sFFog8tMbg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPr6uCRA9TVsSAnZWagAAc5UP/RIZydIcB9+9bU5c9vMk\noI20yluMlPf0/k9FmYnEsSsNsZkLskqWk86vGIR/tYj6/VWlvHyuucKI7ilY\nw9Ou1zc9snqDjcVaX6sF2H4xsuiG6YsRuq8CEDnN70mt2sSRRGxdyI9qye+U\nJwUdIIyhDTHYJMEMrWa9xxsoJDOMuZ3yqT/9VoH4ONnjyn/tsR3Jz+HeZlz5\n/gajZKGnZMVjQ82vQnHbe+4vbtaSJKu9Yhv37jPb6fuJodGWyagk2PX/spRE\nybS5Y2FgBiNGJ29Ko7sNAoa6okWJBWGzH1NqdmGSpH2mJr5OrOio1FWWn2Kt\njmr1kh5ny/VBPOEYAQJtC0HtVy+gNEGh33R3JDla6nzk0rXYePu1PFyMuhcZ\neX3A7iR80X4XSmOoaKUJUO6qXpTIq9tYInd0oNr6shi5ThklYIZA1XIXykGO\nWjK8xPHBfu4DgYAydbLPL8itYOB355Lb2rGZqTaqtKjVEXVSzG2BFQHOAM2t\nioreu69bigaPkNdJiADq67T0E6X3emZDpxcikZjcLx3LO/RhaYBaHcw8RVv8\nYYz/LeZv/XnZy2/VjHYRPUAcxKCmb+/D70xgL7zUukYEMh8RkXeCmMlz/6hM\nwpswvnR+WzuYx+58p73qLBmQYXKGYmdw71BQdNPaBlQOTFDo5ZkxfA4QOaPL\n9UOX\r\n=wl6f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"cf298389e23ace16c7e4682ded1e492e489011be","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.346069ccb.0","@material/base":"8.0.0-canary.346069ccb.0","@material/shape":"8.0.0-canary.346069ccb.0","@material/theme":"8.0.0-canary.346069ccb.0","@material/animation":"8.0.0-canary.346069ccb.0","@material/typography":"8.0.0-canary.346069ccb.0","@material/feature-targeting":"8.0.0-canary.346069ccb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.346069ccb.0_1597947566055_0.33982315462824486","host":"s3://npm-registry-packages"}},"8.0.0-canary.e27c5802f.0":{"name":"@material/tooltip","version":"8.0.0-canary.e27c5802f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e27c5802f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"557a7a9fe0a6d65e48c233f523fa4442ff1f0f73","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e27c5802f.0.tgz","fileCount":46,"integrity":"sha512-7UMqUY4TnnqiHKo9AfGfFEtqAMVjpKfT6/47M+SjSaodEbViI4HPQsL98pTRZU3GLNsa0wO6xQKGO4M/Wz95vQ==","signatures":[{"sig":"MEUCIHVJFNmYN1VYm/6IbuaMTb+iw7jS0h/AArAC5TEMkQ/lAiEAjzP23VmPyHQAOTxUX3+Spkjp4wPzenezXqK07GzOMbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPsvuCRA9TVsSAnZWagAA9OYQAI1dCN3V3hvhXZJhlUaG\n3XD+w9U9x2lEo+B0GpAScvfhBx3VmOZ7P/iqBdygvJItczQQWBVdEULqQIlF\ntyoPHDmFezJdiT8RxGV1FMw6GAZkwVsJd4LrMyigUUosSe6xOs49XSqVr0zN\nfla/+Kdry3qS2xHAg1PIYC9lLiC2uUHo97GJDycWN+x+hOj/zdlYyJ9Gi++Y\nHrpvKfjQbwOOqmjLk0epGkI7lOpRN/D//kCvWF1uhUQdBjB48r4ugwCEHlnR\neBHqnjCaYCLGZzPVtyJQqgsvBKAiNtSceZ4S8BDVyGfSauZVhVCGVXa/S2Ir\nUyKavoROcqw2cD26PiGcHS+spmtp+DTHNQ+BraFwA/qpsyGjhwEZJtV1NxgT\n0ZOWj3MkldXjACubLz697YGPmF16/uq51PxSPh9KE74KRksaxoSzDkXYx03x\nYmxaSnTvsdY48fBWvzfz5H2Rix8f5/gdKusIdHNGymdOV2tITPlMFbX5enK3\n54xw18WX5U+k60b6spnl5IVt1l1ejmsX8Ab7/ezZSwclGgSgmjQ9WrB44FiD\nPOORmnTXTsEs9qME0lRz46ojbNQy65NrxH45x+XszDCseCh3T29bt5pvPJT2\nt34MvEyR68FKEuQWFXvFU47hE/g9sBqwsXVdszke0JIhPRD6Ypqfw97twusv\nmf3G\r\n=Jarb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2c9246ec446246e8fcad54982848f7cd5839f69f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e27c5802f.0","@material/base":"8.0.0-canary.e27c5802f.0","@material/shape":"8.0.0-canary.e27c5802f.0","@material/theme":"8.0.0-canary.e27c5802f.0","@material/animation":"8.0.0-canary.e27c5802f.0","@material/typography":"8.0.0-canary.e27c5802f.0","@material/feature-targeting":"8.0.0-canary.e27c5802f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e27c5802f.0_1597950958360_0.426055004917093","host":"s3://npm-registry-packages"}},"8.0.0-canary.f4532b9c8.0":{"name":"@material/tooltip","version":"8.0.0-canary.f4532b9c8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.f4532b9c8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e2670453224ac8b48a9dfe15ef880701f05afb59","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.f4532b9c8.0.tgz","fileCount":46,"integrity":"sha512-hdT+xhJU/kmCkq2VLlb0HOc07z0KPHcQgmA4WTIQ/jPZSGnmFqh4tBwjFbtI7vXO8dkVKxufTLRKOA3F9TFOEg==","signatures":[{"sig":"MEQCIAC2sY5tDT5dv6GqN3R1MjtcEPMNApSRtQS5gufmdhh0AiAIHkXIlsnwSkRMmOniXXEbcbNe1Qa3aKgkM84GC+zAZg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPtXmCRA9TVsSAnZWagAAZu8P/j0ra81CZofvtG1sTtpH\ndCp0sxWpSdzPGS3b+SiWzGFvgdzNIF0IKWYvWy3MqgcqMvmnxnRwGq4YQtVA\nfXbQLOLsnjOPy4amn9rIexWUBpsrG+WchibquiTN5/+auF8QehnT8leKCZUC\n6wVTT2vxNy0HXDwDuLjN3QQWTsMNpxEbux/xy6PL+lyT/rOuZoHHnNgo7HL8\nv/AvHm80iO9P3w6gIbBkdyhEigCAtoi/9mdHuN+u20GAjWvOF//82oIOflbN\nJmULleJrf7I499WLfdpGjU831oB+ucgfNJcAnVlzjGjvGi3T7ON7bkOszMIM\nsWEQVdYnKXIsPRedUnNkokCwodafA0jKKtNgKrqXBcsskYnpxCP7tlQmuNch\nL4lYcrYRLyag6VEPQyz56Sz6vcC+q0Hy+U/gIp4RJWpRnFQzhIWBveq2a2Q0\ntQj0AK2B+d3++RcNi0RBT+gV/yvok3TAtEFHyUd6/MXUtHLAVVoinSEiPi0E\nzav2XPyEM27uL6G5wItWgnbAIRKFjTNnINGO2DbSpiClKIeBJ0wKusMCDQq8\nhmR5H/Vm3jF0MNpALPCjw903xkdC1iAdOxPOJWFgyJwaj9Pr27rHCzDIw+L7\n+ZOjGidl+MGuBUFGfs7UT+d9o80y87CjnAIfyv0KtysDyqZ/zg/51j9Xa4YE\nKRqX\r\n=hCsp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"be56493a06963f21f1f5343fc6db3accdc74216d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.f4532b9c8.0","@material/base":"8.0.0-canary.f4532b9c8.0","@material/shape":"8.0.0-canary.f4532b9c8.0","@material/theme":"8.0.0-canary.f4532b9c8.0","@material/animation":"8.0.0-canary.f4532b9c8.0","@material/typography":"8.0.0-canary.f4532b9c8.0","@material/feature-targeting":"8.0.0-canary.f4532b9c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.f4532b9c8.0_1597953510337_0.7223246176904121","host":"s3://npm-registry-packages"}},"8.0.0-canary.fbf73c2a6.0":{"name":"@material/tooltip","version":"8.0.0-canary.fbf73c2a6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fbf73c2a6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c38efd75445bf19eb05130d86ea78d41c6eaddd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fbf73c2a6.0.tgz","fileCount":46,"integrity":"sha512-KqBm5KAHB167OF4Q2EU9hBhoGVP91p6MADUgoXw9fITwjtLFAi8C9T9fgFxj7lY1w3/wiV/j2ICg7dxYaR975Q==","signatures":[{"sig":"MEYCIQDsvwZxP7o4GJYelxg7viqU9yL1bWMEL73tF4gAKl0PegIhAK6AGq3ggefQTyXiV2WNjyBTsYZaoG5SzfcxGnfDqPx3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPuYFCRA9TVsSAnZWagAAwPkP/20NS6W+NY1yhVdjABxl\ndtkUHQMXFarGGkIKyaskA275OlZeiAu8170Bq80gIqt8kVv0V2GiP4srTcKA\nYn8ZpfbYMp9NemRWsSLLOJVppCAEZlIII0n6pkmNF92yJqBFlKQbzrcMOI9S\n3yEmwFyJhbWbhp0gSjfHhIaVk44tz1LTmGvkn3HNL3cdMQVTnzpVUg9NAUjY\n0DQXWzXFQUUnTmd/k2dU89Yzem7q4lyjU32fnoDaHwx0UTj+p0jfWPk0zlo2\nUeWwLF2jVWwyUI4iKn+N06oBpY1eWVo+e7mE2nbqBqWyKotcQv21JSiZTLvT\nTFvcRzNj5oYhbVXvJKzZ9UCM5L6QCpeRrIpkgtt7GLpbEGBoaG0TKFv5MXLV\n/OqisJDxtoifmbF+uUcdIC1UB+QjQs9RV3xsHrwSLb4wdJXwWXfm7AY8+qsz\n93Vc9xuU8zu3Oqel76TxMpRZvZRBwq/90Qb3//drDXdHdiQXTWNIWCqTBcMT\nQBeDEeeVypgZ62eQ07pC6pJSa0FPUzqSiWclhwW6EUiQanHaxt0aICc33v0K\nWtyxShXZmC3egqDIfVfsyY8d3N2yWldG4IGKUtIQsc1Za7l7s3JWbhUS1TFp\nf7LMOeGZqn85LN4dZcs4/dIl1yfsFKv6r7OrcjfxO+jBXESM9Xsbi+xQ3qvy\nu7lU\r\n=gDj9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"64db59647b6d726098d0871993ac5c563d92be26","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fbf73c2a6.0","@material/base":"8.0.0-canary.fbf73c2a6.0","@material/shape":"8.0.0-canary.fbf73c2a6.0","@material/theme":"8.0.0-canary.fbf73c2a6.0","@material/animation":"8.0.0-canary.fbf73c2a6.0","@material/typography":"8.0.0-canary.fbf73c2a6.0","@material/feature-targeting":"8.0.0-canary.fbf73c2a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fbf73c2a6.0_1597957637013_0.2736189557293549","host":"s3://npm-registry-packages"}},"8.0.0-canary.cf800124f.0":{"name":"@material/tooltip","version":"8.0.0-canary.cf800124f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.cf800124f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"756f2ce88d11412b7047fc391efa1f5f23f0c1a8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.cf800124f.0.tgz","fileCount":46,"integrity":"sha512-rtc6gUvEOscMHqBOi3m56h3+x6JS96GLYSvYRL8JjsP2waG2GKhCitt1fSFUI+a2wZfOFQtZj1Bglv175gRgcg==","signatures":[{"sig":"MEYCIQDiInBcUeAy3p5ao9ZatG5IDAjEcL1I2jotCgn1bUCRngIhAJDpoGg8XkU47nhCuoT4gYV84vFSZ5elS1Kd9RQ+tD28","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPvDbCRA9TVsSAnZWagAAVqYP/3/QKNxEXamLvGICHif6\nAjh+vMqHEETJRlmDpZwskN/ep8MII6ey2eHT9O+6Nrm+Kt4wLPtOMveW7UVl\nkLS3loajrw2CJwJuIBJkTsZlw6rD6IyETICSIjkK5zufeyHSSEGa2ohR0cSH\nem5/C1jyh2Jebx/jRMn+hiNKyKqTD9cZzZ+VyzHO2dfc5Nq0+iF8gWNBqRuA\nPc5gVFkmC0q6s0rtr6bX6G1VGzKnNhb8/NuYozqCX7m1vF/zMAHVT+4W5BEw\njMjo27tCoOmzLwdPyTKE0ejwQHZFD7gvzPzvHBeMoeDhIQEY1+GNzy9OQihR\ncj+qt60sFPPMkbqY2dag/kQO9h6k5HZNFTCyZscvty3bP+li4Tvqf9dVbHXn\nPIG6U6WRc11VKFRddgZC8uOAVZDrFIe/+QCzQPv1WJsCl/5ZEs+vebaD6+fX\nAyEBvTpBrYHZsSzKXSy1jX0FKt2ykXsqcBKKtkJjxRioSAEelKNnt+OH/RH/\nU2IHMUkmGL3BLO04EJyAbrwf62dk/QUdn+bC6K9bnegZ3ct/IYpWtsEFO7pA\nyHFMPcK+w/wbjrbhGmFAgjbqUBpewiziLpVqv/C0Vg9cTeHCozfOLS6a4DnW\nAhEd7C5deiUzy2FRijFQbclk/HADAnGSKsQb3BNJSjfiCL8yCHWNoYI5OUUm\n90Ae\r\n=8ode\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b15bab8ce97a47831c29a3b0acf1c34e0533b8e5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.cf800124f.0","@material/base":"8.0.0-canary.cf800124f.0","@material/shape":"8.0.0-canary.cf800124f.0","@material/theme":"8.0.0-canary.cf800124f.0","@material/animation":"8.0.0-canary.cf800124f.0","@material/typography":"8.0.0-canary.cf800124f.0","@material/feature-targeting":"8.0.0-canary.cf800124f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.cf800124f.0_1597960410914_0.6871245595947264","host":"s3://npm-registry-packages"}},"8.0.0-canary.95e4eeea7.0":{"name":"@material/tooltip","version":"8.0.0-canary.95e4eeea7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.95e4eeea7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4a4b215de613944c236a6a4ec9164a4b16a3b751","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.95e4eeea7.0.tgz","fileCount":46,"integrity":"sha512-F0nnKW+wY/IeRKvV6t/IzQP4+cZGY3vibNPdBcQa/suzMkoUN/YmgVVV4xucw5kr6Xa2AVlf8BJD0mxahGbeqQ==","signatures":[{"sig":"MEYCIQCkXD1hAZ9UZA5cZyu6AKEkGCOntsBS1JM/NLnT18MacAIhAJFIn5Kd3bLm+jdH96ZQhOz+51p1YmsE44qU9CNOizkQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":371784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPwdjCRA9TVsSAnZWagAAXKYP/05uK0JkrA7URkHG1VDP\nKw2DCrgBzkfK6EGWJAYzZTl3b4r3sZv4IvIV9wLvqGYsP9WwE9GA7gJSrNPO\ncMogwywVJa9gpqwgK+1IBJFyROXOEaED7YtYkAMbxRYwcJlxkqSLyeAlKqzM\nH36pMpVZk9mwDqolPHgi/eR7FmdF3uxHxUj586Sa3YGlLzKroornvhfnMkX6\na8dso2ZDQ+l16O4Kk200au/onsQN6f6Nsuukd+R/aUOWo/u9ScGI0w9vG0wL\nmJbIUwbmZ8iAwF5nCOCy9fTdrk8f5C8pY76yoeA97+6eMoWF27xXU2ldnUtj\nEco7zy6OwOW5IvG4gZygDw9XOXV3hf0oKuQwIYi72chaja/1u9pvf36JXMt0\nEMJq6C0Q9dt277pUPGCFhO0WhGS5fyAOlFo9w0AXdzP9xJ+lJExKB7OO+5uo\no2DkrVeqP/yakaSd4cb/XqHPlDMxo7IFtRwhGh0ieoQ+bb33yk68EgJs4dNC\npz2ddvbZ8PS0zTaT7mLzyY6CCfUOHNT2JVzIttnLp3/Dp7kq5AiPTiZNo7cV\nsjwWcaNg1krqIjHGumF64ibfS4XWwJDgkGjp4NmABkXFZsgfD2GpR5903v1z\nNfKbLrIrD1MIh/58NW1O1iHtd6feP08f2PRXbsCdmQe4CQgeAvdmtqKe4aQI\nfIZX\r\n=QYe1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow this anchor element and can be placed flush with either the end, center,\nor start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end) maintain this threshold. If all\npossible alignment options violate the threshold, then a valid tooltip position\nis one that does not collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(pos: Position) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"be1ca8dd4a02de91f796aff6f2a9fa745f02df13","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.95e4eeea7.0","@material/base":"8.0.0-canary.95e4eeea7.0","@material/shape":"8.0.0-canary.95e4eeea7.0","@material/theme":"8.0.0-canary.95e4eeea7.0","@material/animation":"8.0.0-canary.95e4eeea7.0","@material/typography":"8.0.0-canary.95e4eeea7.0","@material/feature-targeting":"8.0.0-canary.95e4eeea7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.95e4eeea7.0_1597966178847_0.7186957491500516","host":"s3://npm-registry-packages"}},"8.0.0-canary.91ab1c62a.0":{"name":"@material/tooltip","version":"8.0.0-canary.91ab1c62a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.91ab1c62a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2f8d78c64ad81d5adde36260bb3fbf264f46b548","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.91ab1c62a.0.tgz","fileCount":46,"integrity":"sha512-ENYFIIrwCzzmoAYLDsa75gnFdTFgQrOhkX3lMlutHHwUrGWYayy2VpDPtLsI5WtIyezWD137OvlOTrRSXJYf5A==","signatures":[{"sig":"MEUCIQCRNbGAqGQn6KkKcKPCG2p+V7Fr0JJEyDEi7cNXqmmmDQIgfvK3KEYNGgfana4yL3jNC5VKSHDEOVWGHBo7q5cKuag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":396974,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP+RiCRA9TVsSAnZWagAAVPYQAJAKg5YfgrszfPVvIM5g\nAmZr4o53WvPiv9YxNLezxT8ICybIQqKBYZ6DgYVvjTOr6iflORHkCYlS4au3\nZ3G7lTQTc6hd07gCaNfS3zrYsqWT0kVh74pFZSeN73dcu86lT9uOVJFsprxI\n5XBkXGPTQZ8LnjOAhmN+DAQSWnI4SzkhYoHtgc9IPKUQGNBJ7onRniGXXR9y\njlS25NrKhiEVtCWk20Sywo8nts/gX6WHRJjqNVMzqqAtGtfo+G9sT32NXfOs\n5si2Cz95Tk+myzRyyG7jzN3TreZOAfbaNskdDpdac4HPSfaB8svq9VbOcbCG\n8/FgGhGcFlrIWTqliA6QJuL23kZr37EyLhRtJy8HTrbZIqvL/B6xJKBU+1wL\nsuZ7hQNn+LGInVAvlXI7nfW74MgN7kDUXLTMqUdwtgJ26YzsS/oCffpIIDYq\n4mnylLGGeeudYeuHsXt/NzMCzNlUJ6APsLjDFzTZ/i7DQpC5L0CpLmcWuKG0\nadD1KFb/SYmjHL7tGdY4IvbcsF3XXi8da5x4RPz1FH5KJYMAR+MEiBDAFeg0\nZX8F7ZjIZ5fkRGe3Z5BimhP+cNH89W4SqlwGTWXkke41869QlPBbNkviYo5B\n1TuNVymcg7QY/zd3HbSN2Q+bW34K36vtcmYXWpTwF+C5PKhF7mqWDKlwbM4b\npAvY\r\n=CcSz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"389b1e8f2b60ae90730087557ec80e133f0e0129","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.91ab1c62a.0","@material/base":"8.0.0-canary.91ab1c62a.0","@material/shape":"8.0.0-canary.91ab1c62a.0","@material/theme":"8.0.0-canary.91ab1c62a.0","@material/animation":"8.0.0-canary.91ab1c62a.0","@material/typography":"8.0.0-canary.91ab1c62a.0","@material/feature-targeting":"8.0.0-canary.91ab1c62a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.91ab1c62a.0_1598022753668_0.5375111625692235","host":"s3://npm-registry-packages"}},"8.0.0-canary.58eaa9f02.0":{"name":"@material/tooltip","version":"8.0.0-canary.58eaa9f02.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.58eaa9f02.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e4c515da408d8a864949ab0f0c31605f5bf7ad45","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.58eaa9f02.0.tgz","fileCount":46,"integrity":"sha512-+slnPTz5zh3HGpQM7gflHh1lyAvs4d4JilDZFTgb440NURPYZMmktuRe/RnClzEWLxhnBkg25/ZT4NrVYJ6B5A==","signatures":[{"sig":"MEUCIQCc0ZxRs3de0Jb8TWmVYE2ioJGPPU4uEY55PmOefc2xkQIgQMvcItxFuXGg7rjD1vdMRZccSakihmXVvws0R/+BJcA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":396974,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQCgGCRA9TVsSAnZWagAADdUP/jJxffRywog9gIec7mVD\ngAj2hmmIZqNRi5jDW/3gW5HE9AckaV74CO1oRN2Sud3DXz+MUn2kvBXoH+kJ\nlhCXvfkxXuwvAl6KelJDPC3wRfzMgO+XmgNKnjSexpipt2RsPQ0W1UJrDJgm\ndozkTx26R5g/5iHfhXm15w3b8UzUEXoCCVdBINqjemTufhrXg9xV+doZhvOM\n9Rs4xeMLvTYo/4HBh78kZRCg1e3SLBBCMu+W9JfvQQ02uW2gz5evCHRDR19C\nayVmbMWmTlnhhtOjTFEoEWYLCrxrP5I+q/mIpuWnvihpskTrqb2ClJoddvjE\nb12Kk/64Vws4x7EzIpSZE5Zb5QUL9o2/9BdBHMyapwB8Jg2mirLg6eDK3dAI\nWrcKfQxUe5VH3hur9Qn0ODjhTlACsfyfWqHAYFDqKdjSj7RI5zg8Fylm+GfX\n/vp3JJcey3DJdXgHoiwvVKWpI3sxPeyqQyvAYZ2umpZVo9XnzN+rH+9Xk7J7\n4tWtYyNBcizf3hP+l0OASvpj5mLW7vPHB3//eqiHHhaQ6dUDqC5dtNBWdV3B\nrC5TrEPRFIHVDclspEVY7Tfe03Lif+egh91nfnXGfsXyVCiOOMx/iBUSrumf\nAowmRs930+KRijtV/nwD8g6G2z6O/T4CVL1zLaXlZN2ndGXpTI6u1U4gf95y\nicYT\r\n=Ymv6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9f3944d638392fa39379eeb30bd7348c9578f67b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.58eaa9f02.0","@material/base":"8.0.0-canary.58eaa9f02.0","@material/shape":"8.0.0-canary.58eaa9f02.0","@material/theme":"8.0.0-canary.58eaa9f02.0","@material/animation":"8.0.0-canary.58eaa9f02.0","@material/typography":"8.0.0-canary.58eaa9f02.0","@material/feature-targeting":"8.0.0-canary.58eaa9f02.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.58eaa9f02.0_1598040070140_0.6470902007953363","host":"s3://npm-registry-packages"}},"8.0.0-canary.238216fc4.0":{"name":"@material/tooltip","version":"8.0.0-canary.238216fc4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.238216fc4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"102680966096cc1d6677fdeed944e2643cd19772","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.238216fc4.0.tgz","fileCount":46,"integrity":"sha512-Yji0nmbfy11IM0UbzrZXQbrmYzXrppEJ2Aab2FEdGh9bcFv6kG7R4q2HfNqbTrxZjTDf4lYJP8okckkar250Kg==","signatures":[{"sig":"MEUCIDwVzoBN1UKBfnKG55OO8nIKJMSbqJS8v3vpOzn6FmHiAiEAz9rYRJ//WBGdftdGmI/jPNq0y/vRjKXgaGZyU5onTTM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":396974,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ9+yCRA9TVsSAnZWagAAuugQAJoFOkA2rQ9XzECEneWA\nHTQQggiB/H9dCVlyMSL6lftYqEqu4JITtX1XIGVMJ+gAcFcpx4n4j8J26SCE\nbLBjPSNhlUQIlHTjgEssldyri+AC1KintleTncq9IfkUej7eLXKlOX/o9Q0b\nzuiXlqotH7KgdJp5vmZWS7uW9EXswgjw07vPV3a37d/zys4+556jFz8A1TqR\nQnCtslGVXK2pDGgLswEEbEiMrekU3D3rfhtcpraNq1YyFV/guPHP3tMm843a\nqusfmZ7vKBN0X6ehDzVwGOPQLQg0Jns171YN7GtjcuWhb6Qep2QFjpsXukcB\nxBHcCC11DNVfMeuWdBt9S1X91ai5DY1kBd6sQW9k9OotAXyN6nSeddKabSKw\nF4bLqCM2Y6HTHDFmlwCZyenwFT4E9tHqRU9QaVAZhyqe/lQdX9k2qqg+mDTe\nlkc/tGAIadeDYkLf0cCJtyNnhIrYzabWKmGlOJSLG66xDtTG1UzV8ndldYYi\nlwO8Rpd/hZnRDRO2fzmiXReqFNPhBdgR2fkrr/vBxpjon8RtWq3Si7xhHkcH\ne5tnslf2/OZyzx2AEmPBa+DGsXMbPVX1zH1fnoq1ugbV/uXcG4RrK+O7C/P8\nUmTUmI5d4maid80RXpok/00/U5qI/Ghi5iLZbuTR1kG24jIK9LK6FBUaCKHP\nrkVn\r\n=Ox/Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e224b287e176f866661b15e2ee791e17fcc44aa3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.238216fc4.0","@material/base":"8.0.0-canary.238216fc4.0","@material/shape":"8.0.0-canary.238216fc4.0","@material/theme":"8.0.0-canary.238216fc4.0","@material/animation":"8.0.0-canary.238216fc4.0","@material/typography":"8.0.0-canary.238216fc4.0","@material/feature-targeting":"8.0.0-canary.238216fc4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.238216fc4.0_1598283698142_0.3687021456722852","host":"s3://npm-registry-packages"}},"8.0.0-canary.a1c65593d.0":{"name":"@material/tooltip","version":"8.0.0-canary.a1c65593d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.a1c65593d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"718765191ed90b9a068bd4a86fb9ca85ef48f96b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.a1c65593d.0.tgz","fileCount":46,"integrity":"sha512-uodAUhSZmuqol+XkkP6zCyXPVllUU23C/phbDAmJfTJGQbuhSwFjz08ajxlMevDms4qzuy2N4yGBvfP3S0lGSg==","signatures":[{"sig":"MEUCIG58AZRI2rfA7eFj+ezczXNJjYMbTjvkVNzaCZTJ5yb+AiEAg1wNXCMiZnnGX/upKks9UMg0D9tgg0lqa+HUwl3FuZE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":407638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRH/FCRA9TVsSAnZWagAA9YIQAJONqgbJhFxjfab9jZ81\nYzHs2sOfMfpm23aoDXFQHzt+uqnmSjz124Twl7iOKNgEyrOUZnfeVIMCEn4p\nlFowiE7LmO7YXT5pYZJZyvTcOc8UyRdSzewF8hzSgKNmdncpqSzBZaKXcjr9\nfvVGVyffqNZj43WmkTFxAGam6uPaVqTECM2e26L5ifyQ62dx8cwI0d8Y36zq\nW4WeeVoIDVn0LREiLX/H92YDRmzGdrA9sYUDTJzD0nHjQ1eFM34/T/e9013C\nbapG+kkhqdoM/xwnblzNQ6SqaFzxVB1QrnAYVtIpZiFEQlCVmPrf+q73KLXw\nTBVHNQxLj9P6g0B3X+ZMSkAtfzEHRX+iSjjbmILK3df0gej2wjP9Qg0cE/Sp\ndgEbTwEzfJV448uZg0YL8x9j4/4FKAF3l1WIXF7AvX008zcOHTQmqiAfMfz6\nxH6oRLfyPHToFBYRw+EYgt6Z7o0mbfyVlLN9eD3sUE9egPz5NiCBmvLO72tp\nSvgNbTfWNDWjSRL/isIXta6czWig5FZdX0OQk+pqO4iP68+nSzXNhcQ23L+C\np/3QvZ0BMoE6Bs7HAIooXs8YHue/7INUYuhA7ntT9VbUfUpxQoQuLN3rupUN\npMQQDNBDJkOX9iubjVx3zrJvZU6s7eyCZ3DwL7TyOadCCUS+KGDMehhHMoh7\nrJXZ\r\n=B2K3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"71fc6b5e7b16ba7f6d37b724ad4982780c9c9932","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a1c65593d.0","@material/base":"8.0.0-canary.a1c65593d.0","@material/shape":"8.0.0-canary.a1c65593d.0","@material/theme":"8.0.0-canary.a1c65593d.0","@material/animation":"8.0.0-canary.a1c65593d.0","@material/typography":"8.0.0-canary.a1c65593d.0","@material/feature-targeting":"8.0.0-canary.a1c65593d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.a1c65593d.0_1598324677525_0.3206918939606733","host":"s3://npm-registry-packages"}},"8.0.0-canary.708cc09c4.0":{"name":"@material/tooltip","version":"8.0.0-canary.708cc09c4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.708cc09c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b43b62473f668b480aebdf852ded04fbda0bd8c0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.708cc09c4.0.tgz","fileCount":46,"integrity":"sha512-Dg23vOMlhbD56gEBrrDWZDruNi8a6vDanVjpE1uxllLL4axaKRKvkuQjT7EpjwHa6IJw51X0PEXgmc7HfdY0Lw==","signatures":[{"sig":"MEYCIQDNgdQVhBH7/PIKMqpLuWDjdQ64SOqeDn7qh54pC5M3QAIhAKdtaCTZ7e+3/LMN6Q4NOCOcesZJ28T6SmvGJpqVxLLz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":407638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRTTYCRA9TVsSAnZWagAAtGkP/RwtymDk2a4E2k4uhDrR\nA89GF+bqjjbZ9h+Zw5/Hc9Vi6HzUGjCnTjwEHM4mIbVRtP8idjx5H4Mvg8LN\njVrAPqtteyd1XmTB/gcI3UyYF8mgARuSBzFVfHVwQW9xaEZd0pvl40uOu7MX\nCGP/A3cW7Xlb2YHJRgeFAC00JajLJVF8Y9cQXJOUEKUqf+X1Y/7GDjlIaW/H\n1v+klA7sGLpNRIj5fDsO/FVM1pJU5aAfD2gJ0ammw1CdFdZwmdJ/L16r2TnL\nfH3QRxqwlJLkjaGswS5J9V2Fil247dAWhRy9erZY9PG7n2XldwqTKTA6sLxM\nXxgTXvTprp/zXpaZmjhC3DlSWoPucd0Eos2qMylCW3ogsUJ0cLK7c7+2DaRX\n9Hov9jwqHSqB5FXjREf250V00QoFwhjljmVQoUsdmqbApm5F4WjmgnvlYEHZ\n26lYEiIru0nN7nHbZSv6/CnkAv5enXyjGW3whPCf2c90NkKccMDsom36HxE0\nJPJjehPDWPO3aTFn/6uUzlLMvMnvyH7r1m4dddWyXn3j4x3zgk1qK/NZaTGf\n7XlNXHprUr80hc0HUKtJaudfrHeUq76CLpgyQucBwUFai5VZ4ck3DPLyrnW0\n54QSBBOVeO6rdXwJd9egxfTC4GSB7V2Ce+QQEnG+yU7Jx+BAdnSEg+X4ZRBG\nBkbH\r\n=+gKc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"41353a40a8a6a80ac6438fa702cff9ca690b897e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.708cc09c4.0","@material/base":"8.0.0-canary.708cc09c4.0","@material/shape":"8.0.0-canary.708cc09c4.0","@material/theme":"8.0.0-canary.708cc09c4.0","@material/animation":"8.0.0-canary.708cc09c4.0","@material/typography":"8.0.0-canary.708cc09c4.0","@material/feature-targeting":"8.0.0-canary.708cc09c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.708cc09c4.0_1598371032314_0.5939501298098766","host":"s3://npm-registry-packages"}},"8.0.0-canary.19bea2ad3.0":{"name":"@material/tooltip","version":"8.0.0-canary.19bea2ad3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.19bea2ad3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4487686156e23ddf5e9a23311d1807961ba64769","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.19bea2ad3.0.tgz","fileCount":46,"integrity":"sha512-R9PvTJ8az62bGwVrMU50VmTgCj2a/cE/R//rkwgc9SyzcYb5Ncqq9FbcaqklOEo1WImh042FNQXb23pe+hefTA==","signatures":[{"sig":"MEYCIQCac853EIIT0quQl7Y22KmLg/rrSLFOcwDqo26toaP3BAIhAI9NYwq/fRS84vEQukxF++4T/iOQuoaCEvw/XURJpX2k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":436942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRq7lCRA9TVsSAnZWagAAJ0YP/3yaiFsDVid+lFKx9Lgf\naBnIde6PY05eSFXgDtju5KGLcueSTnXUlLrdBD3o3ilReys8IV5Yjtu8HiCK\n/b1RbhF113Xks9EvFoaNe0dNiGu46jwpcGhwPHFSS2ss7l0er+46Rtiuf+c9\n04aqrU+HWiLVGy/GKa+2aFdCqqxqAxUtOAV+AVAMOybqoOd+2Lxd3lGUmEOI\nlszJeKcai+fMOua0pi1A1rVnS+xpDLlIpE9GbAeidTBA7pz8nUagg1Eyy5Jf\nYkkjOWIqdbuizRqpH0W2iN4eP9s8m1vArZ0rYufcXAViPuyCv/TbzqQxKiNM\nFmjd5+mDzepwf/J54M189LbUuEwOKxuMvfNGn54Ca+Y//FmSRpzvWwUtmEUk\nXhbLSTTDDh23BNjVnQkrXjQREcnHRcqMpXFNif5fb075GefElZ7RpwMFOUyf\nKGSTjGPoRu1wHFqq1B7ugb825yHJDsAsnvnLGOkN+j2pR0NzcIGI3jcEtWpU\n1FNada3l6HmRXuIM9spfwLXOqx+eqbC/DrQOyJemwIUw4CdX6eLqaNizUrO7\ns1B0Z6k+8rddHjI+NPqmdiVpQ6L7DmHjlLpzT1UTdxjU1Gmpd1U4lHGTmZ+2\nPWWi8iZDOIE7S8Xj2gb032+fy8srAHhf7ziFKcT+Vj8pXmd/UGSITb0ZRMVr\nRAB3\r\n=EroE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4f1ed83b6a09dd3e7d24508d420cd99be9dd3893","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.19bea2ad3.0","@material/rtl":"8.0.0-canary.19bea2ad3.0","@material/base":"8.0.0-canary.19bea2ad3.0","@material/shape":"8.0.0-canary.19bea2ad3.0","@material/theme":"8.0.0-canary.19bea2ad3.0","@material/animation":"8.0.0-canary.19bea2ad3.0","@material/typography":"8.0.0-canary.19bea2ad3.0","@material/feature-targeting":"8.0.0-canary.19bea2ad3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.19bea2ad3.0_1598467812833_0.19946878290510406","host":"s3://npm-registry-packages"}},"8.0.0-canary.911014711.0":{"name":"@material/tooltip","version":"8.0.0-canary.911014711.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.911014711.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"37f9929e8fda245ce3a07d18da1d07cc025b87ac","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.911014711.0.tgz","fileCount":46,"integrity":"sha512-PxIO1Tnyo6kaTGtn/szuNSIAKJxHumWd7YFQLRHGXrmM1Ouf3etRSXpwTWclFwf7y+a2TufkLWxhY7sO1kpb+g==","signatures":[{"sig":"MEUCIQCPgtn0jeu+aBd8IKTmUTaOoLdY2O6Lv8nKq8lbyHbrwwIgDZmFerX/EKbpzKazus507misPZv5FztS3SRra+atzQg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":436942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfR9qZCRA9TVsSAnZWagAAl/YP/0RSGZiQ9PhQgNTNO/Im\nfMyuNlnL9F8CU54WfsTfV+llC0DysJ6xfDYXYLpzwwGMZgTNBJjJk19IBytT\nIoZqqgYHo8bsHN5kx5wTGpeOiiYS63fJ7BEJrKCIeoEM2H1QhNrO9OFhkVz5\nPF+28YijWG87LU8Nrsonm7TBvEoCM4epEXwQ7fvnDe4wWSRd01i7QG2sVgQA\njv8/naqF0s+u7iovljmXoDgKopIsyIpTp/emf5YdkzW1Xez6WwQLRXMHl4xA\nOaEHfqfod35Xinzv6RMH0Z3qnHe4/KsGjJUpghtOmq10X2SINtuRfG0XPC2d\nlQ94uxJaRckP0Juh3evBCIN7Gjoygd+DHoyA7rlzVPYpLqUwG+LkP91/FEcC\nOO6DpNnllBJAP4wBnMnNbPzGKWEEpeHGqq8wu0m/2J72RzdbYF9h8bPB9/1k\nRxy0NwlWe5btWFXB2oWvBIJ+aBYxS1om1vPW06iTXnfL94ja3o7F+Z/5Ruff\nqPFBi9qUUv7paAK80VsgvrhwYv9JcCZyZJSgMpwxGSuPu1TRBBKoGNeYrBys\nUvtMisuqPJulFrNg7QRMtKz0HeB7zP2vY8vBaGJ+ZjHOJ4joVrsLbS4OuAFA\nE5WS1QVttp0FS8RZ3621KAMzBCu1KivMI/H/JbAidFbumb2ksj4Ftlfa9bgf\nJ31v\r\n=ra4f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e0563b839594887804244d231bec5f415812fc4c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.911014711.0","@material/rtl":"8.0.0-canary.911014711.0","@material/base":"8.0.0-canary.911014711.0","@material/shape":"8.0.0-canary.911014711.0","@material/theme":"8.0.0-canary.911014711.0","@material/animation":"8.0.0-canary.911014711.0","@material/typography":"8.0.0-canary.911014711.0","@material/feature-targeting":"8.0.0-canary.911014711.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.911014711.0_1598544537089_0.9831766588649162","host":"s3://npm-registry-packages"}},"8.0.0-canary.d3387f54c.0":{"name":"@material/tooltip","version":"8.0.0-canary.d3387f54c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.d3387f54c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fe4c3884f8d0fcfa26208bc5a393de8e1d3a4ab3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.d3387f54c.0.tgz","fileCount":46,"integrity":"sha512-YwYGBD/VAef/fDLiXHVYz142HSwx7jYYjvy66Trft7qslN34W7kmnQ7UTAV6aZ2lWsTtwi01jXvflwdcS/7nsw==","signatures":[{"sig":"MEUCIQD1/YhsEVQ6DojPI9T/aW1LeEwztZ4sn7cZdUjSnMkwgQIgCE7l/6BOMaPMCOETxN6EEcARvFVh0xTMBOe4hNKgCnY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":436942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUViRCRA9TVsSAnZWagAAun0P/ihJSQWTUrsHHhasm0L4\n1Zkc0TdFyKES/3mIyJZPCVwSACXAMBHrW/k7jnKbeK5sxJ3TyWc64UVu1Tua\ntBHa9LXgHw4eeSld88+sbYK5Zwtpj3fR7UOcZc4WBPJo5gTIzSp7M2hWWX6l\nFAArfwuvZHxiHEGN8QXo5X5czv8xh9dkgnLnG5oHSHTfWZFPPexIumXvsN0g\nNOZUKFOH41F5jroQ/paq92awZpXHdgFLpe76FMddzLMad1WyUf4qLohmuGbt\nJKVGeLp/k3hpxpw8uw8NwsWeyFteHdeFsfMDEjkcwfeYztsSn63bskCoXmxn\nl532c59FiqoAZTRcRqVrXo1G998ih2ryj5hCGsBu+zY1wxb2gEYCYYYSaYXE\nkGozrPzZaFq8hF9fMLEK1P6T2SO5z10UvlyfyjYYm4Be2ULWb8bEl8IUAKg9\nt2R1lZxbg2zKxIHp1Q9qVJ53C32TLtUCDQr3vaSDpcs3Gic7MG1EZ0fy4w9y\njR9qQXyGzHA0phbVpcg+wLTbOltPyMx7oHPfwrCi1hVdP4R5wtcH6lQdQR5f\nFdgdddArYgK7ZUp7fAGK18ZOVLSA3EOQuEaxfQ5e6t9Ui7QIE/cFVs2gduZx\nNbFmQG33Y3JnPsxlS87zReaQv23+Qd1Az1+kIHy6vSu28iSEb1WswHdSlCaX\ndTa0\r\n=nssS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b8c159d735641688e2fc1631ac7a98134ac5fbc4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d3387f54c.0","@material/rtl":"8.0.0-canary.d3387f54c.0","@material/base":"8.0.0-canary.d3387f54c.0","@material/shape":"8.0.0-canary.d3387f54c.0","@material/theme":"8.0.0-canary.d3387f54c.0","@material/animation":"8.0.0-canary.d3387f54c.0","@material/typography":"8.0.0-canary.d3387f54c.0","@material/feature-targeting":"8.0.0-canary.d3387f54c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.d3387f54c.0_1599166608865_0.5939685693501271","host":"s3://npm-registry-packages"}},"8.0.0-canary.2ccf996cc.0":{"name":"@material/tooltip","version":"8.0.0-canary.2ccf996cc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.2ccf996cc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cccc92814643df4245d5ccfcd5a02a9dd7b67233","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.2ccf996cc.0.tgz","fileCount":46,"integrity":"sha512-Atc+8mg5N4J6u+cRTVfUM+83SXB2pr1o/kI3bN/DIVxaW5HZgeE9G2xeri/cijAfWZALOA0BroHO1n4jJT2/vA==","signatures":[{"sig":"MEYCIQCWSJwnQYgV/elVf/oD5tsCv98F2Gbf9M7niKESfsAMawIhAPYlaeCJKjMUiI0vlL46zs/mpbQUaBfYgT4zpVBIkyN3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":436942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUVicCRA9TVsSAnZWagAA3zoQAJzd9eRyBs2tNRQX8YKG\n5XaoUgjlBfkqgxcjmul9odLmkk2YfWA1UwPGwimuNCCrC8dP6okK1gnizGcL\n32s9vazNI7oiGTUnGiEvRXhDSCqNv3mDGcte7f8/z/d8Cd1FlcWwFK7zYNhb\ny8xbpLTF+VvxfKYr/SULCmHx48sEEFFabdx0j7UEUzBdrI8BHRZliaQZgIVC\nGz+QR0Mqdc2nyQm03KDWcCFOoUB6BhdxKRL8osPUVeSD+9SR3v2O8ADsTelu\nTeMkTa6hfbt0Z5G/nwUo9TwwH50+WaBJ654jqQToraXYT6MXd/EIaWxFAh96\nbnPKLbj+mHuFz51+hw4YmB6m2qnpo2TFOziq/ORkOe/p0CTo1ftHSsX9OM3x\nfQSHp45XTLItOyUfpzPKe4EJ8vRcGAQl/ukIZqCNDVMtDpSgyItPlmH4n7wK\nsfJj2Dl6R6UQRMMII8fqzdYkhVS0tSDJIEI3Fm/2a+4wrdfHx8/PSFrm3wKB\nD+RmxWppKI6xfFHAAy6nePqCa5vp2Towtj8VSANmCOF20GfRzvV/PBDdMG81\nZQ0iqBjM4NgSBrIksS+6j4deTmHuEQQKeRqqLto4yUBsto5RypjPLtXktPug\nHcsXWTQdNm64e4ftDplVqTLs4R+qRrbx3pVwsM+H6igKUwHKfK6pTIShyE/+\n8zwW\r\n=61VR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b295adf5299f65a654963fa774da90dad3e39244","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2ccf996cc.0","@material/rtl":"8.0.0-canary.2ccf996cc.0","@material/base":"8.0.0-canary.2ccf996cc.0","@material/shape":"8.0.0-canary.2ccf996cc.0","@material/theme":"8.0.0-canary.2ccf996cc.0","@material/animation":"8.0.0-canary.2ccf996cc.0","@material/typography":"8.0.0-canary.2ccf996cc.0","@material/feature-targeting":"8.0.0-canary.2ccf996cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.2ccf996cc.0_1599166619582_0.8856733419149638","host":"s3://npm-registry-packages"}},"8.0.0-canary.744bfe5d8.0":{"name":"@material/tooltip","version":"8.0.0-canary.744bfe5d8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.744bfe5d8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"493aef5ede4d0e05fc35523d5b9da007f7b57058","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.744bfe5d8.0.tgz","fileCount":46,"integrity":"sha512-m8+nV7Hy/v0cSjV23ES8MYKUYQQGT6DoQiPohEd4o7954k4p5K3/RUqdYPLcABY4NHVYXTXSi6GXaSdN52u2ew==","signatures":[{"sig":"MEYCIQDv8mzDKoa0OmDg2ypWj7YP4gkT/r0soWwM8Gwoujzu9wIhAK1jOyHVOtA2/tzhtTB0YK7g874HYdCmY5zM4Gf/f5+5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUVjfCRA9TVsSAnZWagAAmroP/jFtQ1W2rKBt9DVxkFQB\nLQmuh25iAwwfjlMoiwFkCqiUzhllZVrA/OTGnuvidsOw2lQpO3Y5UFsfEDIx\n26DmGMSLMG18Ld64a3cnQJcaFSw2SB84xHCWMj5QHND0DPm/brXNb6H9uAJn\n/hKvpbIyWas8CLJ/k6192BaiX79XaoTYzZu9VQ5b2oJSK8fFkeicbLXJ5eWp\nO1qA1w+biTTkRDUkl7z1D2iCk0Cgf7CCVd+Yi2NFoJPSfm0K0+ukLrAxxyjb\ninU3odxFxr7dgreN7QzDXk5F9464qvYz4NfMvyBpPMiKBEQgNOP71YNMqGYB\n5b/ElA6hBnMbzT2Ek9TFskivKbTpE9p3bRPKNz3O9fl14vB2qPz3/U//irvv\nXxbWMguf+7r3bg+7PkE1kfxkGMWVsAusWd1KfteDUmQ2eukfuOZmRyIzmY1L\n5Zw6fpvEk1hbm2Lzb1mGQ7ectV3XI4/4rGro41XuOWqUYLyLQq4juD2AQYek\nrHakBndpnoTFr9qhATZK2H8y30xW1Ued4oHIaZBOTuZ+7ZhwB0QswQZy25RG\n6tKS2NguDS/kUFcjTUxxYoJBmc/0+BdlG7+7HTd5wEm0c+qgI4gZgqKBUqIj\ntEI41SM8hCyG4vcv5ee+n2AfKN457TI3Deg1DNsGE4On04sJjOiuyPoB0+yf\nJkce\r\n=qY+f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e8e9d5605e05fdd50b88c6ce659dc2ddd8ba768d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.744bfe5d8.0","@material/rtl":"8.0.0-canary.744bfe5d8.0","@material/base":"8.0.0-canary.744bfe5d8.0","@material/shape":"8.0.0-canary.744bfe5d8.0","@material/theme":"8.0.0-canary.744bfe5d8.0","@material/animation":"8.0.0-canary.744bfe5d8.0","@material/typography":"8.0.0-canary.744bfe5d8.0","@material/feature-targeting":"8.0.0-canary.744bfe5d8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.744bfe5d8.0_1599166686778_0.06977288945233329","host":"s3://npm-registry-packages"}},"8.0.0-canary.78da96eaf.0":{"name":"@material/tooltip","version":"8.0.0-canary.78da96eaf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.78da96eaf.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5bb6785311c7532ce3139e26a868b2ed13ef4c62","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.78da96eaf.0.tgz","fileCount":46,"integrity":"sha512-QucQucwI9p0U5vjeZsFZUl71j6VFfv5JJ/stJlHtmDjRHK9z9Un+HTxDTRAKGveYK2QqaeQ6jTgOfOrohDFbWQ==","signatures":[{"sig":"MEQCIHWQSi18Heluc4hrNq6gIAAbLWvnJjvDBmVXASbJAMIrAiAoUyOI4P31ahZNe8rEHIVSATatU94giEIrhwW0vmUKxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV9fkCRA9TVsSAnZWagAAU10P/jsCcH8UnnPVaoJQhIZE\nUaiJxAq/OfxScEUT24H51pRnAeEl2SVO9i6NySfP7+C0k8kuAVbutabpwjr9\n7HpN3ENTFnlWsgtuYt5jaumx5Hx8eSazTdnXhWAUWQlJzXqAzILpBJFc8hXS\njbmZQuiHN3GRbud0Nn9Ealh3PztyC05245iRBwQZCMadY3Td7Vi5E5kHS4cg\nvnuJQAj3weGb1OgaIkDHekqXmQzDkgO6wL21q9Kppxjv074WTLT1ofjyXoD8\n4gdPmTTbyHepvKvBQBvR6VbbDwvIYthsZbb4bI/71oHQeTJpdkjDoObWfL+t\nM9nJGPAfCNi9wdeF57eQ/K5MfhmBspjEgIDl1tAseHMdXiU1sL/manFmfBZe\naXG3UALVlWeiR+sSuOxx90JKJySYZhEbzy3ksi/8coKxOJSnlgrmQwHG8e01\nBbOlVp9EEy/cvueAFplgrHwVaBGOaIa0Eolb0NUsfTFxQiFo/2yOEv/Z4BU0\nFmJGUJtgRK7w8ILfiUEg6MvlkScYRsQ1mxNkfjkZQMI/04PVco/vJwk5tm8b\nrNoTplnqkNmAxwqEAmWExQqxXMTfF/JqedV29TBpJoMTMtJ1h5pMh2UI/wKh\nVlEaPZYPCYd+Wm4iCZGaFTOB1+ydF/kI2kDypRHXkWh9Zp7QTVS0YxxfJ32f\nLRnO\r\n=IaAV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e9750a8b0ebee9367eee7e514953a1b1ac6fef7f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.78da96eaf.0","@material/rtl":"8.0.0-canary.78da96eaf.0","@material/base":"8.0.0-canary.78da96eaf.0","@material/shape":"8.0.0-canary.78da96eaf.0","@material/theme":"8.0.0-canary.78da96eaf.0","@material/animation":"8.0.0-canary.78da96eaf.0","@material/typography":"8.0.0-canary.78da96eaf.0","@material/feature-targeting":"8.0.0-canary.78da96eaf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.78da96eaf.0_1599592419424_0.4099595595176193","host":"s3://npm-registry-packages"}},"8.0.0-canary.b0ed593cc.0":{"name":"@material/tooltip","version":"8.0.0-canary.b0ed593cc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.b0ed593cc.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d818b2b6277039f7669ebc7179d27a074f0809c2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.b0ed593cc.0.tgz","fileCount":46,"integrity":"sha512-8Uo4Wf5yIgeYlMOsr221AXAa0dsNDB31FP3NV8SvlUwv68Ibd6+uW68Mp1JchB/+NOeLKdtXWTVB20BPYv91Lw==","signatures":[{"sig":"MEYCIQDknNRL2r2lFo3ei8fzqcR1FSGiiFe/H3dBToQSPSeG2gIhAM0Xj6B9LtIgTpGE+4DOLP2P5+lgT1mURa1C6MNcfTHb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWHNSCRA9TVsSAnZWagAAyVgQAIoodpdMuNPQdaf/CvPl\nSLmCgdQXCF6zjTHNdKHu2haOe7JD3w/F1gem2KBoShCBIy9sA5ZHAtxBsK9t\ncGPqPUO8VYUomG/amJMTYb7T195eNTsyG6+dWvsj3KXpqJ92FyNONhP2sSAE\nd0id4Pt3RneUsF644APwr5iBqH5ddkx+56FhLYhUNuEnr++U3XQhuR0R9/Ib\n7KwZDOmg59jFkdYuPao50mCRRBajOTLyd2z0zJs+l1C5YPY9wC2wxbsZ+0ki\n6qvihPrudWlW7QdzRqxkzf4J7SpOEHteqP8tjo1CuhtOVvbMTmWKi8+0d6xO\nu5BbJpbU05lb34pTVjDnZH8e7q45tTInadQgDlam2jgigrs5+hTKSI55Ba3Q\nWTmqm/3A+u3bJIyBspVAFA2/JiuHVfOZVmneeMkRBgs292yP4cx2Q6RDAtws\nSRBa3UHnro1rm0q0EiLmJpFLCjrmX5DWnNfUPuUVCzTNFZSlPlqgBVpqadE0\nrRJWRExzg28tzZJif3c5abVNDDUeFHCVb8KxzH3B9B+uTHygBND74rW8vL+S\nBBjQM66s8bXhbZ0c6oO4MuGgQyvAAk7NbxsQAixwF+ImRdLqNWUlkMI/x3t0\ny173NjZUTcVCcw1yqtdR3GKf0jNMnKyJBys9DJkJYGSsxI2XS1gHX3J0c6+X\nuc3N\r\n=qQvb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d4dd3b56db446c52c35f891f9a19896a2b762f0b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.b0ed593cc.0","@material/rtl":"8.0.0-canary.b0ed593cc.0","@material/base":"8.0.0-canary.b0ed593cc.0","@material/shape":"8.0.0-canary.b0ed593cc.0","@material/theme":"8.0.0-canary.b0ed593cc.0","@material/animation":"8.0.0-canary.b0ed593cc.0","@material/typography":"8.0.0-canary.b0ed593cc.0","@material/feature-targeting":"8.0.0-canary.b0ed593cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.b0ed593cc.0_1599632210056_0.4745507409991996","host":"s3://npm-registry-packages"}},"8.0.0-canary.85a1fa9ea.0":{"name":"@material/tooltip","version":"8.0.0-canary.85a1fa9ea.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.85a1fa9ea.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66f5128b95a6dba037ee4d9f91aa0f6711ecdc39","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.85a1fa9ea.0.tgz","fileCount":46,"integrity":"sha512-y/2ICIRa9BUrbV7sTl3AlpWkyEBBIaipcLl86dMqoR+ZYYcMV88bbgu9WM+sLbrfEcZgvHcpCpN3EsNKurXBYQ==","signatures":[{"sig":"MEYCIQDA2Tv/kMowqnzJxMCXv/qcTnDryz17sxafh3g3LZVS4gIhAPb/0qxj6g1tG+ZIXNU3yrxcbv9y5X9O2A+m5eyEf8QR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWpaCCRA9TVsSAnZWagAAcngQAJSz5J9BUU91+fIH4Y0G\ngMCiwyFYxe82M+MZS+lQ3/F6aVhL38aEnl8yE6arapIKAwmP7BYZ0lWd9jKD\nr5lFuWKn4qELquOUBmRsVjxbLqzCoAKrbDIbyBZ9HZsFZdoMFQozODQQmLjR\nC3rxr06+n/XUonrW5Nt/VEn6eA0y/y9tPtUAk9z8DffNsZpjd/Ii2L4I6C8/\nfDM91SORBJkIWm/go/+Igt2eGivbmXG1STfma0gCsZqAIaE49UfTFq+6+G2A\nCA+mna2S2MEgCvaEWs6RMkSSIPNtpFcqq0Z05T7FUZdeERVpRhZOJ5P5aDRI\nb1Uo5i6lY1TPnGzlBAQ9mNffllocySWrhD44rcdpWsoCbVcqt6Eyk/Xh5ygS\nb0ntHVNhOg2NyQYShDCP4asTh0cDwXsVj7iEYayI1KfRw2Vu2/njhk4N176O\n0aHJ48NSLTG0Pb3jIN0ukBCgNxcJ6smmD2ZLppNk24cioaOl9xbqLzu1HbRm\nNu17ZYuMGlvwhB9NGwZQNWzM4kpaUFeTHjh/hkIYf2jbRzQDxym4OIm8G0ZE\nga9MaQYSP3aA+TQDUViM+C2lPPQQniCk27QFQd71l9kJ/Aogj3z6mtYVq1nf\nMrmwzLvjsZCRh04AQdNQXypJS1LQwVTZfGVJuZlwy/oqsT3K/FBp1CSz7ian\nsteV\r\n=mchE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"96441cf0eac61122c48c43aebac2e249d5bf492d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.85a1fa9ea.0","@material/rtl":"8.0.0-canary.85a1fa9ea.0","@material/base":"8.0.0-canary.85a1fa9ea.0","@material/shape":"8.0.0-canary.85a1fa9ea.0","@material/theme":"8.0.0-canary.85a1fa9ea.0","@material/animation":"8.0.0-canary.85a1fa9ea.0","@material/typography":"8.0.0-canary.85a1fa9ea.0","@material/feature-targeting":"8.0.0-canary.85a1fa9ea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.85a1fa9ea.0_1599772289701_0.6601344981928414","host":"s3://npm-registry-packages"}},"8.0.0-canary.0bc41a9c7.0":{"name":"@material/tooltip","version":"8.0.0-canary.0bc41a9c7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.0bc41a9c7.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ecfb524f82756d6b6cf5a035e59845c80636138","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.0bc41a9c7.0.tgz","fileCount":46,"integrity":"sha512-AyRSfpb7/9bovIIhGTIXw6K8LUgHjMA+RqCa60S2ksj/c6l4Ge7OzhG9kt13gHj8680FhwEcwmxVe0tk1rKAGg==","signatures":[{"sig":"MEQCIAVjyh+P+Y7w7NGgoexjsCdUvHCnhT1TkXe38j2cNfI7AiBFfr1KaqDZJu8f1zGkgfZF5q53mW15yxZA0idoB92sXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW7j0CRA9TVsSAnZWagAAnNEP/331v7A5O4iCQ34HVffA\nUJ1TokOja7vkXW4DbBlBRDOZOI/oq6EEFAgsgvR8rnvxjuzioDOpCrdlLYN4\nEGrFUo8rzGIe1cIl10IfKqkl+GLGKJHwnL2shRRG6ZMvLXnox8ONzkaHPat7\npwFj/wMH/zzjKrUruT1Ogx9eH7juxIHZl2AYlU48+AdIa3CeVqLP/35cY0I1\n1RBbjULZtbI8ulo5Uioz0/s5bMzY3SsrzikWaMsESza9w/TUFhn+BFfF1dy9\n64GmHyZzBdXHKjyQkh0GtmmdVvyUAREKCYl/0cJnt0K1ipvUF0KVdhFziYoT\nC5tijissECIxb2qdJeLY1JN80rx82r+nwjg5+SFm5N4j/xN9fslz+mMj3uxo\nP14F7DWmJ3+MYUXYs4O7ShbOHmlgDQZHBzxO9QHyHh3xkD8IflwFLV55IBVE\nSVgQFZI4UrTRQs3QhgNFZwIzcXegTiPX0qljy9iOshIHd2GmBjYB9k0x3dE4\nyZrn8BYr77uw4RFR82+790mLbMIMq8qxK4NsIbHr3TXbe024WD3zuC+Vawit\n+n2X1C5spLj+ObX6HsL+FSKJUCd5jo/gzDzfTP+kaFb2kjmReDArTM0R8a38\nPaLKBXMz7OylBxrzzDHvwjKnWhEOje2MaLwH/hzJEj3+QLrVc5kq93sba5+4\nZzkw\r\n=R68o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f9e2c4fbe617a115d220d49782884d15a0d9ff51","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.0bc41a9c7.0","@material/rtl":"8.0.0-canary.0bc41a9c7.0","@material/base":"8.0.0-canary.0bc41a9c7.0","@material/shape":"8.0.0-canary.0bc41a9c7.0","@material/theme":"8.0.0-canary.0bc41a9c7.0","@material/animation":"8.0.0-canary.0bc41a9c7.0","@material/typography":"8.0.0-canary.0bc41a9c7.0","@material/feature-targeting":"8.0.0-canary.0bc41a9c7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.0bc41a9c7.0_1599846644508_0.7667792489056253","host":"s3://npm-registry-packages"}},"8.0.0-canary.fc0eb5013.0":{"name":"@material/tooltip","version":"8.0.0-canary.fc0eb5013.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fc0eb5013.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0fc549b81c4ab77c6792e7785afe18a5368e6317","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fc0eb5013.0.tgz","fileCount":46,"integrity":"sha512-sevPJxuFMaxE0El5g0+GHyumFsOum/FM+5HPxhgc8esgb08h0JRDTdsWAOP5YutsfJPSE4BCnf5rcJAWvHynWQ==","signatures":[{"sig":"MEUCIGpcwUzStfvs/kZb8PX15u5hZaa/ZX5Hcn0jvbjHgUnVAiEAs3qheYGetoWVxXM6+OnXvcqS6cOaE3H+QW6s+du2wzU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW9ZvCRA9TVsSAnZWagAAXOQP/36hq+g+bcNctEZOIQer\nyD3aiNrP4XqUjkxVWPZrFuZUk1AuukWpW1MtHxsoL85hzMt4J5cozoL0lIcW\nNbCsrtEP2S/ahR0LPx8yRbVIoWSnlQ2bg9Y7UBQ7BHdYgd2ctlj9727mtxNj\nI5IMmPsF9COSew+fVLMPDHdIuIAvM2az7bUgkVuF6JBqRwf4iKkPtQrI4J+0\niUv7OJePTWxf3seJxGFXc5dU8NmlffhpB4ZmX/GvCKx+zIvt8ChPj0Et350a\nGnp116NK4+anuE/xPShYLBFlZwyJybxwL3oYhHM+Btusd9qz3fikgzkJB297\nuedh7cBt8NXwRPZiijJoD+c3HIOv5yMxnHy4tgii07nmak9PS+WzY/WpTz3n\nnOU9Vg02yVXbzAgKCI0Jh3ej3v+np0aWcedCLJDjFh5kAsA2Ib7WaMpg0UmO\nIhkg5E/MvnzN6f/oAH4q4gxEEUBof+Xf5H5M2WSVTUlWKm1U04RJCa1VdCxn\nkLEgRSKql9dFJ007hORxf7cCaHAQnT7bFl0oLPi046/1fAjN5rp/LwlyWdE9\n12fGWWTBmVjQ3kQDlaqT1mHa9KZdSUE0f+HDEIfS3P//lVDURHkOuKknINbp\nx1xC0EbiyodyTqOOKzsW7+HkUg8ahUtHDxW8ggFPo0xSB0gD455dWJIPo7xZ\n3imh\r\n=FICj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c6572140acfb45fa86b79570328d75e3869c40ef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fc0eb5013.0","@material/rtl":"8.0.0-canary.fc0eb5013.0","@material/base":"8.0.0-canary.fc0eb5013.0","@material/shape":"8.0.0-canary.fc0eb5013.0","@material/theme":"8.0.0-canary.fc0eb5013.0","@material/animation":"8.0.0-canary.fc0eb5013.0","@material/typography":"8.0.0-canary.fc0eb5013.0","@material/feature-targeting":"8.0.0-canary.fc0eb5013.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fc0eb5013.0_1599854191119_0.5115024212788473","host":"s3://npm-registry-packages"}},"8.0.0-canary.319bf66de.0":{"name":"@material/tooltip","version":"8.0.0-canary.319bf66de.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.319bf66de.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c41a29a2c68aec4a31ebc62a05a22a9847ae8ebf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.319bf66de.0.tgz","fileCount":46,"integrity":"sha512-YNkGl9j5TnOheqbjnIH2645UuuC0TTyClCb8yRGydaLrm1pKfFRpDG9n4a1TOJn8WO8SN9IuXv4CSW0EkWnamw==","signatures":[{"sig":"MEYCIQD/vxJmXiWRfoRP06Oeu8jrhH1I7Y154492BujzMhkCuAIhAJbPBHH0FaLCNMVx2OQR29FG37/Tlzvkxjbv3d7ZP0mD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXAQNCRA9TVsSAnZWagAAfvAQAJYEDkwIH6mfrfSU647h\nAmptYHWJruSVS+nwThw5na2fMIvJ8PAGeKB4ZMcRKRNXcGILhmHF28WhVJDk\nNt8H2uikBIyxZRbApKE8OY2vapxqOEdZWaHLKBLG/j43pNCmx7FX00t0gkwj\nkoytTubGz0U8Gt0yT/nsCvgoEVVl2mSjkxrWLmyi0O2jP1E/puJne5ao/x3a\n92xTkwjZccdAcdzjm9X9N65PYehML/Ckcabaah0h85ZmfBY+a+2exA1DtXGS\nrhSYuGOEBCX9/I/d0tAvlrFPosSwudB+kV4mk12r2teyvYBexwwih/crQ4MV\nYLvu94ifbf4qmjK4abX94+2L/aiG//J2sufA0QIFjKhXaeEwMM2Q3ocC66yA\nf6auQmu5rBnJIu8b4unTpeWjabky7XTlT4qf3qAdu3wk/eDYQ/sZEv4sWTyH\nzQ8LKTrVU5RXeirkb3c6ivyDEIzFznctpQn32/gydo1Q/lz3qxmdGvdjfvfe\n+iiDYxmJ5CNXBAZvwDOY4qOxhLruZff7gav0OpgD0E3+SQWmXrBzE9F+l+24\nlP/DB4Q2iO4loYIp6XwoOroMP2f1wnC0jPM4Wu1diebtDGbZgzsJOTgAwthf\nn/IfZEN7BemUzzWv78yIuo75EcDIg/HnWbMf6VG8Efo/B128LR9sre9eEdFc\nedXv\r\n=5fcV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ba4054064292bafde40e53fcc87405c8dcad24b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.319bf66de.0","@material/rtl":"8.0.0-canary.319bf66de.0","@material/base":"8.0.0-canary.319bf66de.0","@material/shape":"8.0.0-canary.319bf66de.0","@material/theme":"8.0.0-canary.319bf66de.0","@material/animation":"8.0.0-canary.319bf66de.0","@material/typography":"8.0.0-canary.319bf66de.0","@material/feature-targeting":"8.0.0-canary.319bf66de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.319bf66de.0_1599865868761_0.2239985638877635","host":"s3://npm-registry-packages"}},"8.0.0-canary.5bfc305ec.0":{"name":"@material/tooltip","version":"8.0.0-canary.5bfc305ec.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.5bfc305ec.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e1a8a26e6da2d3c191c8ef34e94c52f95e1f1b52","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.5bfc305ec.0.tgz","fileCount":46,"integrity":"sha512-T7WIZKKuDqwdD3zkIfe1b+Tx65FdXXvQ8jiELFTTAgx4kfLdR/JO1TPvXB1T+ORBOcSkBF6NRqQKuIqp21UW+A==","signatures":[{"sig":"MEUCIAV8LSnnB7/VzPUIdnkj7V2yVw9pZYkLtxo9CuuiousWAiEAu4TdTI3gmh21dyErLDp3rApHtiwvqFXO47/YF/DxmnE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXqSwCRA9TVsSAnZWagAARuwP/R8eQexG+IyFBMfYXLcf\nM8HMln8WVZDdNt4O7oe61LDWUYieGjvEFnv4g7YPNg4EdZ6cffOjeNrzLgcU\nBk3/SBPl6xqODZgf95n2ihlPSsN8yLqTwW3sQ6bv19iwOMn7zNe4VQFvI9vt\nP+NOPEXdmOCeH23pc5EafbrS2v/M2p3vNTBiNjFln9S3EWIDeyiyI8KcnPZm\nOqtGv3vcA0vFKYy4q33MW2+B7v9I88h64UmEqTXpav2CjtOORGI4yC6fFcER\n7gB33SqLhdXm76XC0ZnpW9xGvk+KcaoCP7ED9dDRJQA5NC/WJrRFF4sjpqUB\neTGfi+A6S/lE7hSf3rSwPe9eTL9GE59S6yRLRqoZFTXzopA2Gkn2eDGRlBQT\nq0EMwD/9L9zSQspCv4IK/uR017zxGLxSRAubB/vBnHuh2+GZ03hxBLYhgLu7\n56XuwN+jyP+UhjSpsq/RHWRxgM4YrGiV44HuiPc26eyIo2KH3tGX3+q/6S2u\nSswC1QGok9z7CC3NURB3ppDkBrK2GsHWAi2t0SBvGXihrlSBzVaF2PXaGolH\nSl1fzJExhAP0p+iX7TSArJVnSv/2uo84NqYHaITblncUtlX2NNFMrSRViKEQ\nKjCQcrmuK2JN3GwDpWBkD+L5iLs7LeYvZqDEEFPVPfN4nd61DSqPSTM2HS0V\ncUiy\r\n=k9Go\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"96c0c187c7fa544c1f5303e96ba3e85cba86e5c2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5bfc305ec.0","@material/rtl":"8.0.0-canary.5bfc305ec.0","@material/base":"8.0.0-canary.5bfc305ec.0","@material/shape":"8.0.0-canary.5bfc305ec.0","@material/theme":"8.0.0-canary.5bfc305ec.0","@material/animation":"8.0.0-canary.5bfc305ec.0","@material/typography":"8.0.0-canary.5bfc305ec.0","@material/feature-targeting":"8.0.0-canary.5bfc305ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.5bfc305ec.0_1600038063992_0.6588608408585401","host":"s3://npm-registry-packages"}},"8.0.0-canary.83d83f131.0":{"name":"@material/tooltip","version":"8.0.0-canary.83d83f131.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.83d83f131.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5baccef8da94940679e2fc696a00ce09b1ac1850","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.83d83f131.0.tgz","fileCount":46,"integrity":"sha512-ZsyT1motk2ZCQQ0X1M0mNKWQulo5prJuIOyeIoODrHNWxN9RMmRm+f963iLYrAiNfOK4W05YKsvsDOYCB/sdqg==","signatures":[{"sig":"MEUCIHEAJEWDe6CnuH1gkOp4jETQfo53mXekGqa2TUuC/MZ2AiEA9dtsoVnGmR3kh4JizOFGMwN/HkShM5lRRLItV2JgynI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXrpfCRA9TVsSAnZWagAASSUP/0FYop1w82k1+NN+qhSb\n7HR5Q8H5Lp4pBjdT8HISWZsfnP0V6KIlOclazqSv4P4nvCQJzoB5WpfcBTFH\nrLo7NBKjNjdi+zEPGl7eH7FonyFF4CzGylzbM0F9YEaPmGtqXw6ofkfchxvQ\ngW37htlSUj763kFSn8YNWVltlchnaZSat8AwhmqcJXezKZM5AMq1oA3r5B35\nKrJdJ9pPLgHWeTuOaoOM5rE6+ObE7cwp8dZVkJvKbWbwhOCi/cqQIgmDzd+D\nzLSh+50l+mbhkV+uAjWxxXoBYcbQadUYnSMllzuF4W/bvH31kL1iRUESDpdO\nBzQbih3UhFlseTK8VKeKD1Hv8XnJ5rE5tgd+N+UTHQ0SA7dq3cn9SqzrF50J\nfL/TnWeDFqMv+lXo/e17vY1WnzmPOcmK1wkror8MaWX8OIkLmzEndr/H09aM\nY8FzkBV0Suv24q4u9MDJ1p8sFpHL8FyIzTmUMSFrlSIWvpgIRbBHhJTDwkHi\nwLKgNTCDNoc+8st15riXq9S8LeCuegEIq+95sSvO4uV/5IYc9rb+1BdJAGXf\nc2YYue+jZoDfGsXNVeNHVLg9ixl9NmGCYzw2F+TGPuXsh35abcahwK7G2Hxw\nV/Zj/KVf8JHFfQLMr2WEmSketj9ZXU/hxqGEJiNAgKdsoi+BdP7hAt3Xt0bl\nmwQa\r\n=1yqy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"520e8b604c3cd3e7ce96b30f4315d576bcdad3e5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.83d83f131.0","@material/rtl":"8.0.0-canary.83d83f131.0","@material/base":"8.0.0-canary.83d83f131.0","@material/shape":"8.0.0-canary.83d83f131.0","@material/theme":"8.0.0-canary.83d83f131.0","@material/animation":"8.0.0-canary.83d83f131.0","@material/typography":"8.0.0-canary.83d83f131.0","@material/feature-targeting":"8.0.0-canary.83d83f131.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.83d83f131.0_1600043614719_0.5095434046097822","host":"s3://npm-registry-packages"}},"8.0.0-canary.d52b165b5.0":{"name":"@material/tooltip","version":"8.0.0-canary.d52b165b5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.d52b165b5.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"189694f571b41d3c08ecd7ce4f78eceed2f0d0ef","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.d52b165b5.0.tgz","fileCount":46,"integrity":"sha512-rbw4cBQ2QWwQOll12iFOpm3cZSJTZsPKOMeBJy+DGxbLwemnpZ7zWKH9vmCVNe+WiwI+902NYoCVEZx5HeS6EA==","signatures":[{"sig":"MEYCIQDa6AV/yxUUakiVVxfhWWHEl5+u8ktXVjHoI0AGNz96MAIhAP+nvqUfbovEoJjTJz4+MKxEevF8blFQlMeo/QCRWXkY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYNXWCRA9TVsSAnZWagAAhMkQAJOzBUhKD3/O1Fc3fR/G\n+JecyGOLDVaMz+LcW8DHLeYtAMIRXjY1z2WVgCE3sCTBPvpzU7a2s5T/BXx6\nW27ve4EKqey0pNbDNUmPI8Gr1JecyhsuYbNh38K44dnksfNL5wQss2T6zoPw\ny4xSAohQ4lhjE17OtrHvfhMpJ6u4p8a2bmjymQ3bUFOXP+mnjE7LByRo71ka\npeOIsD9V2Syf3Pqe/9QZs7OcdGQkR5n7uOAVigObsICK0ldx6rmctakgNmiy\nmqhkFMenH6PEV3+x9bGo3SBD+N1g/p4lLm1r0mKcpPAKKymIwJYgn+a+1KxL\nnniwV+zH+A31e2EEQnX9+Pn+qDjHaMFpABp8kpPkQMk68KTYG6fXYoVB6Ndb\nwJSFSbPRZxafayZT7ROdJeD2M1SUs15wTN2FckTSlBDSDEloYxnSQFg8MVIL\nVBACde1YudiXC9iWWqtK5Ysl/CKr56ezCPVf2S8gW1It1w6jnNtQag4gjj7g\nrxNLx2IwRgd3m6q2Q14IzEdI83uufqGlY4kEJxT4DJVvpAImFYrtmlom6ocf\nFcLL+JJ3aQ5CVBStLUsXON+6s+zLLaY+cx4FGGM/KDqVm8ZS89O8bnT6j4Uh\nyNCFwmv82bNvYkj/p1FS4l6vPqCA97uvA5bvCtMugZGZ+2J186NTObWmLVWD\ntY06\r\n=YjwO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"19ac3399f14583da3b2ca5e37a0ce783539066ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d52b165b5.0","@material/rtl":"8.0.0-canary.d52b165b5.0","@material/base":"8.0.0-canary.d52b165b5.0","@material/shape":"8.0.0-canary.d52b165b5.0","@material/theme":"8.0.0-canary.d52b165b5.0","@material/animation":"8.0.0-canary.d52b165b5.0","@material/typography":"8.0.0-canary.d52b165b5.0","@material/feature-targeting":"8.0.0-canary.d52b165b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.d52b165b5.0_1600181717756_0.41148648667545085","host":"s3://npm-registry-packages"}},"8.0.0-canary.a831d4799.0":{"name":"@material/tooltip","version":"8.0.0-canary.a831d4799.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.a831d4799.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b3a6e12a3bae76e8a9944b27fe098968a7f7450e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.a831d4799.0.tgz","fileCount":46,"integrity":"sha512-y8yUcY1zEzFdwcmChQ9XF/4XAZRfEbgF0m9NUbnCvMxgG0Wdq3b3AZpENDQDOajR9V1cO7QPlKL2aI8pkeL1Qg==","signatures":[{"sig":"MEYCIQDag8cJJb/cQXsAXDDGYIVF9znZX5kb9f/IgLnXd3w01gIhAP3Bke7f8KSywodf/D+1TV6AJ5GOm2KLqWjQf2vaauxd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYP9uCRA9TVsSAnZWagAARYsP/3heew5LdEKh+1rkhxjV\nyos0xf7ylRF+9qN4yM9WOjpvpBhn+X5QkGgYGR/iHm3ZAcZI/WvgIp8gaVtr\nQ0Y9FxeISu67VdRhRCdKZfxvfWuNodHE0TXN224JmW5OpI+1wqOraC6xUOqX\n6/RHuSP2mgY+OY7I4MxX4s1HrnSi2GdrrIe65BUHRk9gg2lIBGuscLN+Cv8Q\n8/gC/V37QZwELaftCPekxQ/+jrMckXk/AVMP7GpA31Vqu+rOCOPxqRi5EdrV\n7chkxyaR+p1qZex2rxe97hdegmhNTRy61YQEdtOtniWgKueNLM5m1hTIug3H\nzQK6mS6kT/VNmUb/rw1ZCspJGDn29M37SSqHpxajffMcYgWlm9ICoyPfgZOS\nMfr2X4miayD3rsvWsx49Qb+gLu5cFsM5jfbY++38dSN9obNcoYfivLD43Nw2\nlJ2AIOTqdP/a42o+mmvtpo5OXN1PuoRXyGsLEyVdvKKH8EconOVlfdEnlyOz\np923ZO+zmURjGP/oXioxRv73Bv63p0WPNem57zfMEDSuWkUUaDK9VMScSb72\nbgr1bttyD8+CoQL9JvU+43Ab6eBtl9VaMdBhdsuGs2UAYxvdoOVPCJrDWQSY\nk1jHlZfiItYHlIDJmxvKQCV8b+hFq8Iot5XRiVfDCqqLO5cliJ+0CpGUClyE\nGfNy\r\n=KxUT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fa7f461e7963e1bdb73e7811d2f70b0a07acba16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a831d4799.0","@material/rtl":"8.0.0-canary.a831d4799.0","@material/base":"8.0.0-canary.a831d4799.0","@material/shape":"8.0.0-canary.a831d4799.0","@material/theme":"8.0.0-canary.a831d4799.0","@material/animation":"8.0.0-canary.a831d4799.0","@material/typography":"8.0.0-canary.a831d4799.0","@material/feature-targeting":"8.0.0-canary.a831d4799.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.a831d4799.0_1600192365866_0.13512390657610496","host":"s3://npm-registry-packages"}},"8.0.0-canary.a306aa488.0":{"name":"@material/tooltip","version":"8.0.0-canary.a306aa488.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.a306aa488.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5611e35768dc025aa7c620b45822ef4036c4365b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.a306aa488.0.tgz","fileCount":46,"integrity":"sha512-o6lxiHFR7cMkjqSk3JD1HUk+opi5+OkM4tKQtpHfoDBPEChQOuYFkvpvl6n6AW8eUkixQrGIC9vyikOoezgP6w==","signatures":[{"sig":"MEUCIGp46hXTULs5/FhQ7t3bDj0N0rjTZFjpxTkDj0j8QKa8AiEAyn01oBTMxvpUipYsXHMO/v7LadgHum0uNwnElr3Z+pM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYrT+CRA9TVsSAnZWagAAH0MP/2l0LqEvzV34aTpG/C2D\nvJjf5ewK1LMtjImMH50Fj3rCJd9iUogdQINl+rpGJZTixtTYyLBBxzi7wT+q\nJyjrGTZxnfUXPvugF6BfwWcXAy5b9yExvD/H3dVaWvg61mQuVHKIqejmGtm8\nwqH1HvJn8yWtIFHkoXqRAZ+EBJ0otid6DNJY8LBBbJJ1r89xqR24gCMHZFVA\nn9V8lpOLdGNB0E7G3FrM2Uuc0oEyAfQfB+Hx9qE5ysph3WWj1flnhnVzimkM\nC5jbkmwnj8A5kU641JRm3mYlzBh4cwxYhTXqysUfFTtGb0iJVCJ0r07+EbOi\n8JHbhsxpZWAYukJHJPJ5WMqEsbaoPqzwMu+JYxYBoZFxq/qRljznmdpWZHSz\norXK0pVQtwhdK7JN2fVGjZ/UI7fRItpiCZwjG5aW6yt6kmklfOUVTVMIg//L\nbL5rArXjYtKvedl4BV/DEnNeS3FDA4GjLJfcsf1+yTfsrCVs5vk8eNhBNH4C\nrVLb74Rz28zolUVTmn4MOiZz304Upf6s+TN+ZfWOu0W2Vyu8PcQFOn5ReDsK\nBhzAiPboyuIGFmjQ1Zques77mP9Yj5d7WEaNlW48x27zC13zRWSvMBMKV0c+\nZY4WgjbqOejtel/rkvAiEYzf1bngR/JJhYdJ1HsFPk0RU5BQ/HPVI1U+g1GX\nR8vr\r\n=+tJ8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c6addec60d43eb106ac774211ca2af4b04d40f1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a306aa488.0","@material/rtl":"8.0.0-canary.a306aa488.0","@material/base":"8.0.0-canary.a306aa488.0","@material/shape":"8.0.0-canary.a306aa488.0","@material/theme":"8.0.0-canary.a306aa488.0","@material/animation":"8.0.0-canary.a306aa488.0","@material/typography":"8.0.0-canary.a306aa488.0","@material/feature-targeting":"8.0.0-canary.a306aa488.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.a306aa488.0_1600304381817_0.6024692577611392","host":"s3://npm-registry-packages"}},"8.0.0-canary.fd608ff66.0":{"name":"@material/tooltip","version":"8.0.0-canary.fd608ff66.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fd608ff66.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95144551bc50020a5968ed6c3f5fcf9b94942cdc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fd608ff66.0.tgz","fileCount":46,"integrity":"sha512-MLG1PCzMGF/Qhhq9ECmLuC+wQmCmpX6/0zt4HIA95xvX8IpSzphZo9IOFnBbMzA8twcDjy+acJfSmwrp/FvIrA==","signatures":[{"sig":"MEQCIEefyGsjXlLKomHMgZsi3rvbQp2dilmcfOwb6Btuk9e2AiA2jLWlBXng15X2APRXSB84Ydr5l7vz4ESsvVvJskEM8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY3IoCRA9TVsSAnZWagAAq1sQAIEOrKvoU8Flg0Jf9S+f\nNZAsP2lmD8XA7A1np8C5R9AeuoIYD+n6KBRlrg53+nnJ9ICVtlTV8UtqbtQR\nmTRzsicFG7B55Kb+MpaQdi7zk8rlPH4ll23N9rdyX2RPQ7twDhIEQsfvgwI4\nHtPDL9NhgpVhiscNs6k5XbThKRsYLwFp6V87AXIkwfI5VdD6Y1pVllSEfSx0\nE12wis9nVbyk23EAkCqsRmETSG2fRjpXShPkSESlhk8H3HDH3P/K9BxnSGwe\n49fg2EugvETnQjVt5Jjmj52qHeLanyWma2Qx46kcYlnEhZrC6PeTUx98ryeq\n98CipeWswyRXWHWdLlHHELVhB0zQx2w9tkakT3J2aNVfN4t77xBvRVYfYmDA\nd1JtV7hEa8RokKb4VA3glvZXJD9PH8cBYjoYLPzxqd88cI9Jl+M7aC9z/k0c\njvkPUfbAFVFiLF4YqUMJOtA+lJjyf4Sj4s+WMOD9/Gb786igm6JEfrGRECeG\n6MSODBNG3IzqavSGIp+CewZvDEchfcVxfowQTWGjGUM24O/0R1ZEuIvY8aNJ\n4sqdLhsrIn+CzfrTRCucQ+YhrrB0JAcwFotVVs/XeQyoUe72pcViLmiAflQQ\nPKOX6Bzn3NYrCl1eyedSK5nKxSXo/q9R2ub/a+mWii9cETc+qVnOvZQ1EUwC\nQBWa\r\n=Od0K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"03ec88b3967ad97da4309b1dee0b9764edcf89e1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fd608ff66.0","@material/rtl":"8.0.0-canary.fd608ff66.0","@material/base":"8.0.0-canary.fd608ff66.0","@material/shape":"8.0.0-canary.fd608ff66.0","@material/theme":"8.0.0-canary.fd608ff66.0","@material/animation":"8.0.0-canary.fd608ff66.0","@material/typography":"8.0.0-canary.fd608ff66.0","@material/feature-targeting":"8.0.0-canary.fd608ff66.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fd608ff66.0_1600352808222_0.6193796772979363","host":"s3://npm-registry-packages"}},"8.0.0-canary.3e435ba57.0":{"name":"@material/tooltip","version":"8.0.0-canary.3e435ba57.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.3e435ba57.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"732b91a805a5c49c97723a2fad5921e5395ac42f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.3e435ba57.0.tgz","fileCount":46,"integrity":"sha512-4sDDpAMhN5uGdIGO+raMtiu+2S/Fc5Y0jGkitHOvLdRB1IwwI2no/vS2mCDmtbwdTjiN1J8klxHG6dfs6upiYA==","signatures":[{"sig":"MEUCIFj4nij6USR8NHti3D/5GD9r/l0VJviD26lNJKmj4PvnAiEAqGb9wEUkMjsS0Q3hptK25SWWs6L2ClhtQ652xuN93rY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY3Y2CRA9TVsSAnZWagAAtfYP/j2cP4LTDcea+qvCLU/P\njZ/2S6mcdW1QMqxFuwZK4DXsbJqMceE1B1Fs8Y5z+blfEM26UvGKgCQ3JKAF\n92HB9DjxWTJeps/rOnaI40EmVlaXIFKcCyYb6a9Xg8lR+N1EYC7XqcWnXXSr\n66NRWQ+ByRqHHX57WB+oZYwboQdveSyIeWw/iShh+UopqwO3WD/YWUhuyFxb\nZSU6WQ02cSfbFw26HYefJrhxZrB9GpD5R0khB9cE5h4YvCRk9yk63e9jmzh9\nRefYSRPBTNrELBTbiuiP2pgwiUb+EhfQlUjNeYLahAjbY00yke2+xXThtuHt\nTuBwUOP/bJRsxJf0Ryn+W6LEBhh5Sgk1U+626nVzMyyHf4CjOewdQ2vPwTXj\nd2rooPz7Z9DQo3nSZ9V5tKuqRWHZv5N8Q91sKXDGPMDXqVZ/gjsmy8F+pv5x\nhAT2bZsRxnT/1w2O+CkRonFpSrXCiSePpzVRuvFcYju2Dr9c+VAZiPf0gMJF\nVPYC84QCfS8mFf3LnjwV5FClRWB7zLTn/xcAib+fVatcHhQYQF83pn2Rm9xv\n7+0VLD21ne6a0PMr52jv9Fu8OVuk3is2tqeBreLFDfrf8xDQ7MeD79GOuLH3\nqg7yLr6gyrLWJ9o4laO5Q8YgCyBA9lKDnsrcwdREWtcEzYyQVQbwDpktOo/B\naSlh\r\n=uNWw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"15ff2ccef4cf94fbadfb06cb750ee6de035cdd19","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.3e435ba57.0","@material/rtl":"8.0.0-canary.3e435ba57.0","@material/base":"8.0.0-canary.3e435ba57.0","@material/shape":"8.0.0-canary.3e435ba57.0","@material/theme":"8.0.0-canary.3e435ba57.0","@material/animation":"8.0.0-canary.3e435ba57.0","@material/typography":"8.0.0-canary.3e435ba57.0","@material/feature-targeting":"8.0.0-canary.3e435ba57.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.3e435ba57.0_1600353845560_0.09301167716304959","host":"s3://npm-registry-packages"}},"8.0.0-canary.c250ec52a.0":{"name":"@material/tooltip","version":"8.0.0-canary.c250ec52a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.c250ec52a.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c96cb29e6a45353c96403537da4179e40b94bcf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.c250ec52a.0.tgz","fileCount":46,"integrity":"sha512-Y5101iQ2wSjdOyn4xzUn/Qhq7W9UkOCjmB08YykBuMxPQTUHVPsL37GMTPMLLmK/b75NDlBp+wXxn0tukEDfqQ==","signatures":[{"sig":"MEUCIQCHi324iwNBZ4xR0Q55Ec7REwSe+ceNCYCEOjnaKiM0xQIgTIB9SzoZF3bzcYuKQFG006SHDqS9+QXkEO3UM+YsasM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY8LsCRA9TVsSAnZWagAA/bIP/2EvUyNEr0bvWIa5lu3i\nkICDlTG6BcnX9l8ojkJ79idfAFTbvYxnlSyvX3N9fkgIJikqrlj1Fubk8VEx\ndLSAih1dKlCty3LpAAVCp9oZiQnqvZBb7SX5OsurHT/oqslGCZa8pjXCiJDL\nIKDQE066P7N3XAOhE+v6adj6mWHQod1H8rwbb6XGemcIVBRtY9RQ9Vzrm5ZH\nnGVm0wHr5TgTDEDMgDUPMw3XKcrmEvO6udJg7sh8XcAK+Lv/rylKyoOUGO07\nzyK4lkHHgMO2WxtwVu89llbwlV+wgAeeMgr8SZMA2bfzVeJYbbdRelRUkFsp\nvYOiWQ4wDRNxlXO1T30eQaEgn1EsXi1EYvKWd37YN3RlSsjNDdOW8D4I0A4A\nTZ1gfxwWES+Uy0B78Sif2nA84vyWD5ROIfBa9hK1CMDDBMbG0ZXJsd2GVMIj\nLLerIV87UeRJS/9+Pv9jpDJDVLzHu4KXSDitm4EEmSdJrNibyWFMtVw/lCI+\n5GdEcZMpOmtpHYMcgltPJKcEbOqRvoBlQHDu9w/ghFGN2eVvwDz1ppmi6NWr\nK+qdsEBeZavdXDHuPlNEcoOW1IvMcW+u2poGBijJK4DGuWZ6+NphvVWmqgOy\n3dJXrELRMyrfTD9hsvb/N8fOVHnsU4buhxCiWz4yhFwec3iLy0Z73lsU0wja\nquGI\r\n=lDvF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e214ca7cd3c1a65ab89d2fe2b4fc899aca418adc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c250ec52a.0","@material/rtl":"8.0.0-canary.c250ec52a.0","@material/base":"8.0.0-canary.c250ec52a.0","@material/shape":"8.0.0-canary.c250ec52a.0","@material/theme":"8.0.0-canary.c250ec52a.0","@material/animation":"8.0.0-canary.c250ec52a.0","@material/typography":"8.0.0-canary.c250ec52a.0","@material/feature-targeting":"8.0.0-canary.c250ec52a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.c250ec52a.0_1600373483687_0.9337539928232108","host":"s3://npm-registry-packages"}},"8.0.0-canary.e34e411b1.0":{"name":"@material/tooltip","version":"8.0.0-canary.e34e411b1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.e34e411b1.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7ddddf5eb800f4225ffb6988b1215f5d4ff9bbc2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.e34e411b1.0.tgz","fileCount":46,"integrity":"sha512-6sN4EoJs74lLoUHxsZYhtmoHjSH+l2zvOfks1Gztg3g5oNDjaATzdGwqwiT6kDZkpQ1oPuPvU50UA74NWwLLng==","signatures":[{"sig":"MEUCIHf2YSCVJQarlK7wE6CRo7Y8dVSBoA5ztDxApBIXXPiNAiEAwIyq53hZ222+AnShTzpaHr9pFQBfCrUlnlqV8Y5U2M0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY8SkCRA9TVsSAnZWagAA8yoQAJ7Z1+TiEQF0J3mrzSlE\nHyelzyWn4YZ4vfnKWszOrON+6Hg4yo6ff60MkPPnGRfdQpod0dqMovETF0Fv\nzQsN16ogkesjGxRogeUkzinkzoWsun+vu1M+qNEfluQTdeI+z4llGi8KPqag\nOJbI53zaBsC0vN+kVil1TvswveVbpggC3NU6/BrHAnk1mj5Zdrox/PbVBWaQ\nHThxr3S7kc5WdBsLZOAzou+t5p3w/AHTRBVFvWceoMMHW+nXyBdg7TSPDJvJ\n3xZRzVr34U/CbeKobhz1seH4HKpHXOOIEAGWJbkbc/EI8ODmEh5IOO5jdZfB\nFOQGUkUXQXQQP+o8sEAlSkqrtMULryE89JaQB9Bt0s/k0H22A1oMTK22s+CI\nWCmyWEdfhS3mQdC1F02TQ4wdzwLQdlPdcb2XncXTwCPJApYkg+BoQQTGIHCO\nuMwcb8HFUUVRvdVfMtfO63Pckm1mRxIyDZjGGJwGQyHrlMRiW24Cz61wrtJg\nwcVgWAdyouALsVCNxG0NZL/lD1fuKg6cd94f+9SgkvIDrQe/Tx55OS5gMbAG\nINVm0nWGWSvRiy/pa77QmLoV3HE3AywOf6lBE1gPO8DLW6uCevPajBce+5CO\nkXN0VjJ37d2H0tvi3G/EfhkGUz5VtNbScIwYqWzuJ5heObBKWaoxLjDwymxk\nT1A3\r\n=jQD6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"460337b237852aa88d59152c38df2b32b73792a0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.e34e411b1.0","@material/rtl":"8.0.0-canary.e34e411b1.0","@material/base":"8.0.0-canary.e34e411b1.0","@material/shape":"8.0.0-canary.e34e411b1.0","@material/theme":"8.0.0-canary.e34e411b1.0","@material/animation":"8.0.0-canary.e34e411b1.0","@material/typography":"8.0.0-canary.e34e411b1.0","@material/feature-targeting":"8.0.0-canary.e34e411b1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.e34e411b1.0_1600373924098_0.1959905202506267","host":"s3://npm-registry-packages"}},"8.0.0-canary.4e9343929.0":{"name":"@material/tooltip","version":"8.0.0-canary.4e9343929.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.4e9343929.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3939533008f06bee9fa71171416bdfb98e65c26c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.4e9343929.0.tgz","fileCount":46,"integrity":"sha512-pgu9jydnaheG4huMpl7DpgXg1ky+Y5WI66hn/MLoa8TJhoSEcZACeRJ48nTE0eoPVXfz6eKj3+Bs3PFGyN0kRA==","signatures":[{"sig":"MEYCIQDtybSLJ/4s2n+AuIELxiEw5em3BDumBbQDbyj3zevfygIhAJS1Zboc9h9ChdPu+TNIw8+zzl+JwgtAB1Es0jjtewJA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfY8qWCRA9TVsSAnZWagAAzncP/iZyk7a3o9WSoY1q4RJJ\n+QVkdNvSpHGNSSlT32Xf2Km9bI8QzGzpb3oxupyyKbbxfvabHKB7YWdEQyqn\nfvTuxR66T8C1Ms6I/q6fH016KiMCV6tRAfucN1duRjd9vlJW0fsVr2kwJVbQ\naQ/m7KU5FrzYaXrlHsPcbx0BFDxp9FcXaHYlq0iymecv9pwBk7UnhxH/xfUx\nr/97Z2WriUpLMci4NjS9M4BbahktILJsljGi8FzU6btfiqoMO6MMser0eUVn\nblo1rTYLtc3X5nMTPr31DsoYub8QxzK24ZyHuovN+y/hGLP/Jod9HEpm2dUx\noEnprRm923/MuOsQ++JQ5yeaMzk+F2f0q0/QvoicemUT6m9Y2DewAW3gLm1z\nPZB4QVDLI/ATx6E5Vct7WUlF5ItZ9vmernYUvgI1s34+sjkmwlEtNfNnrQ2A\ntQ/+uy92DO7lHrB7iwz4vkgWuLgG12eknXxBvGrifNNd90v/noL62goUXBCD\nyQGW/YKeFuBr+QtEEJcU1r3vIm0+thSBVv7l8yxM5zTbShsOgwBZ0OJwt2Gk\nybtznKcHWdsrpoe0KGlLpsiHedT/1/Hk8BqoWKdBidEMWMt4eKxc77rkYCcK\nLI1osIucIX0ecTtxhn/5K1gVxvwQVZbgQ1ATVTA8E5EWAHyIxSeyOlUjnfDr\nU1pR\r\n=vIH7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7bab75a521cc7f81a2f78587d2146ac140e3cfc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4e9343929.0","@material/rtl":"8.0.0-canary.4e9343929.0","@material/base":"8.0.0-canary.4e9343929.0","@material/shape":"8.0.0-canary.4e9343929.0","@material/theme":"8.0.0-canary.4e9343929.0","@material/animation":"8.0.0-canary.4e9343929.0","@material/typography":"8.0.0-canary.4e9343929.0","@material/feature-targeting":"8.0.0-canary.4e9343929.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.4e9343929.0_1600375445914_0.7967397710487176","host":"s3://npm-registry-packages"}},"8.0.0-canary.4e5c350c2.0":{"name":"@material/tooltip","version":"8.0.0-canary.4e5c350c2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.4e5c350c2.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"953d3bf0ad5fb160e8548d5f674c5f45c7c23774","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.4e5c350c2.0.tgz","fileCount":46,"integrity":"sha512-oqTMRgkKtyHQ6XON2i16ntjI/XuU1DcWfid20+HGqS0jVMSCErY8WG7x/TLE6pGzs6S3MzQgJ/uBWX3ivdCqSA==","signatures":[{"sig":"MEUCIQDssyiaj6srsmNxVscqu0PvFq16OeX4HaHEk2ZwZZb+3AIgQPlt2Xvti1hNA0W0pPfwrRiFhM2dGU8IPQmyDw29Zuw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaRfaCRA9TVsSAnZWagAA6mgP/RKSbem3/jEzbiA+XFLZ\nQn3McPQFz0cVcONXw2JewwIHQgZ+BFrJGub7c3q+ZFdoJgaMkq3o5QiT+oas\nCzvHyF7ZRCRkBaDrx2AoV+5qwonaLDK0W0N7dkJJuW2czE1LwA29s6BKetEy\nSVMLi4yM6Y3oHZ5mJxqtV0iHOpC/NEsNKoozQqSs0jvKwdFPLT3ZTK1/+CE2\nYjMXb4A647yHEIC05fw1oMj0Vb3mu90hheCyQQtAqGpBxNjt+jSjKmZJTB89\nUMVwzEGeZ3cYsj3vLH8Zv1T8kAgVy/3tTlic3wsoU9qjT1jufcIwL2DnBtQY\nbTrjJUHiC/lJTmMCgVRF7EYnddxtxABv2Rmaf52z5ioMsDSFHj3m/GAmt/Aj\nUqQCJmE+ToLtSVp3fWMjH4U2/oUd5J9GXujszO3IlGWr+qY3ckWllCMWiRsK\nuI8gvJde5b5v0GzQfT5k0xF/mbAttaDlYf1BJl9/c3b3hQSkbJW/lFBKeJnS\nYmCktqosvLFUSOqpMKinTiRPexudwU2Hl8J/BGCQuJ5YdwwofzzCjJmBjD6I\n03eoyl6ktZrT3wRYmdkitgc7DKfm+dNvn52xXrAEbTJFhplKx4I6S29EBPUw\nJaxqVp28Dsxzl8z5mQl6/tHYFrMC00TZtu4szY8bqigVe1bbXHu0aE623SQQ\n0dqp\r\n=6QqY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c753481bcbad808064a366112868670fca5381f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4e5c350c2.0","@material/rtl":"8.0.0-canary.4e5c350c2.0","@material/base":"8.0.0-canary.4e5c350c2.0","@material/shape":"8.0.0-canary.4e5c350c2.0","@material/theme":"8.0.0-canary.4e5c350c2.0","@material/animation":"8.0.0-canary.4e5c350c2.0","@material/typography":"8.0.0-canary.4e5c350c2.0","@material/feature-targeting":"8.0.0-canary.4e5c350c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.4e5c350c2.0_1600722905621_0.399921188182518","host":"s3://npm-registry-packages"}},"8.0.0-canary.16c563ef7.0":{"name":"@material/tooltip","version":"8.0.0-canary.16c563ef7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.16c563ef7.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4d9ed19074ab1817a2c8ca540c10ce7a94440c8a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.16c563ef7.0.tgz","fileCount":46,"integrity":"sha512-cL8IyFEQVVzEHk6o3tGr+JyAIeqLwG7s5tY3iWgdqI+618mqRbOBBehJ/NRz8+TDFZDlrCOTDT3MAup80SrYUg==","signatures":[{"sig":"MEUCIQC3QwpTujylITE0xBw7wTLW5qelGozBAUUfbIPWGRdnxQIgdlEAe9nHofHHk7U6FmZ2ZuZ0xegVcQmW39u6Fjp51T8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfalTBCRA9TVsSAnZWagAAbEgQAKA56Zv4Bh2IMdvFTG6Q\nid4eI5aQePicwWhOFcSQdaO7/3i1GaAKPnvWk0VF9FCLekE+ONFzzSv3mNvN\nXPtY9MnGjM8DnXl9HT2GZfgBugJ5FzV+lcMWpuqRnc3nLgtxdJB6TWfSF7Nl\nHq9P3b7t8MIUfyIC/AmAwBQf07TgHBFY/9isU76qRqehPEskVVom31OLl6o3\n6yHXjXw0Bnb7SWKfhMLfDbE1XPzTrYMh0/63Y1iZkVHTJHZScZYK8MA7mcDR\nPF22aPuC1K8vD90MaHbu1q26LCEM90DBd9mVxfvYsBLtq+tkmq+ZBB9i+9yC\n1ENXMdkx/dO8T20eBx7+0H/gs9RvnhZ+j4l0luTalddOlnFDBl5n4XwmRndp\n0d56zOJ4Us1CdkbbjwcAvJxrdTUVWER/wTOFacfrkhwrdYBolzkywagoMzUL\n1fsWXxvEMcNwe6G6rDxF20lj1dsjpsOsvWg/mByjyJ6R3gO8BOCVvsXyFkEq\npjsb0nGATxDRSMYCYAdJK/uSbbpeIqK/rmvXqZq0kDkA8usgwchF8vlg0rNP\nS9R3aQi9+r/d4i+xdbR3GLV3QF8Nf+F+ncJtghS1jHalSoDS0O7ICDGI5VMB\n5N7vvugg+V2XphbiojIqN2QDtY9hcXAQT+PKT2c92JqGgiyl6lU/ZzxNRAbN\nDjSJ\r\n=b37D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e3abdb235aa76184bd5171f68c237f58b8541f7a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.16c563ef7.0","@material/rtl":"8.0.0-canary.16c563ef7.0","@material/base":"8.0.0-canary.16c563ef7.0","@material/shape":"8.0.0-canary.16c563ef7.0","@material/theme":"8.0.0-canary.16c563ef7.0","@material/animation":"8.0.0-canary.16c563ef7.0","@material/typography":"8.0.0-canary.16c563ef7.0","@material/feature-targeting":"8.0.0-canary.16c563ef7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.16c563ef7.0_1600804032447_0.2906867597649987","host":"s3://npm-registry-packages"}},"8.0.0-canary.fd8af3d43.0":{"name":"@material/tooltip","version":"8.0.0-canary.fd8af3d43.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.fd8af3d43.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d728d5d03beb769fc67b408695675b787a9c0940","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.fd8af3d43.0.tgz","fileCount":46,"integrity":"sha512-BQ/furAY2z1rQ0sHpzmMTGHuhL24TVFmwNZF13qqW7o6oN4i38aYza+6T7cXU0NhShUVwWxbALs1EmqCH47IVA==","signatures":[{"sig":"MEUCICAIgmI6JJex1/RecqjZbxXcT0LuYCnRYp4CB8kdfiwTAiEAs/Dw4H+GwOZaInKj1Rgi71sxZQywxK09mllsy64L6U8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfa6L6CRA9TVsSAnZWagAA3MgP+QGHvE9rs0DRq3lNfbBa\nfp15ER+rayqvkL5QiidNQJhhL1d/wZkUXPK7KiGKrMhdTVZf+wVFY2xpR687\nd88RSihM5JyitAFaj0qJS6J1N5Vr933A/e4GZCR3gY39XIZcswfAeQu0KxuP\nLwEYuuPrrboMh2p4oqAU3ev/tMQ5okafbZmS9uGKaLiYwOTyuDQTQOymKLxW\nnYHk++IigQ12nDbrj/ORSJQcrcQ+5FVSBbjihg94AdC3mRe+TVQB0r7R1xtS\nhtiMyQlFOrFDyMUTNdc33IcaUjzrgt/DiwyUgovF8AzfcSJQQD5BUKgLEqoe\n1WzaHPbgotXqtvnh0Ok5iuPZqPdBdfO0pE+IyqHWWkZ/Jbx52/bkzYMwmiUJ\ndqWGdoO5GP/FidnBp2w4kiihPqp8n57DWU+goR91+etJvbvbUXiis+3n9zG5\nUawTH7BIdVTStKiaOPUtBVdm5zCB7AQnX18pMeotJy+vI3PwKlJtgCtvzRi/\n4OMbgtUYChlJ4Rq4k0Xz2L1tuBhMPRzxSH5RtUKotsgYN/8YCVcJP9BhIrz/\nXqUeCiTjbtHUNwFyNjSaTpJlfRtEehTtR6tvCWFi8Hk9nkGJWFy9bBG2HLbv\nnfRUBTD6MyxCyGWergSuYSJEWlKksoKJ3e3aYZcTPwVOpp+SpKkBQ+qpl8vN\nZWXp\r\n=8oho\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0f295a5eb9518e726dc271a945985bba278bf9e2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.0","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.fd8af3d43.0","@material/rtl":"8.0.0-canary.fd8af3d43.0","@material/base":"8.0.0-canary.fd8af3d43.0","@material/shape":"8.0.0-canary.fd8af3d43.0","@material/theme":"8.0.0-canary.fd8af3d43.0","@material/animation":"8.0.0-canary.fd8af3d43.0","@material/typography":"8.0.0-canary.fd8af3d43.0","@material/feature-targeting":"8.0.0-canary.fd8af3d43.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.fd8af3d43.0_1600889594033_0.9639903539261392","host":"s3://npm-registry-packages"}},"8.0.0-canary.d4cd83a85.0":{"name":"@material/tooltip","version":"8.0.0-canary.d4cd83a85.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.d4cd83a85.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"73aed104bcc1e73b1f427c20435a49cd2859065a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.d4cd83a85.0.tgz","fileCount":46,"integrity":"sha512-/yIK8yYXCwIgyEz7J0N+gAol90BEJ7OfCRyEMFBf78TvsQPbywwRUwVhbf+2d6Q1SXzvnfgSUjZYBFdwI/6+xg==","signatures":[{"sig":"MEYCIQCJdpHRShbVpw+RP8z3hE+v0qSdl6pHv4hkSWgnFtZnCAIhAJEkvAQwlM0M9MtukdPfsxJbRa4oh+X0zKjCJYiaZ+Lv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbTurCRA9TVsSAnZWagAAeroP/2tIyJkwjQaOOc0fgSwk\ndHr1Vq4p1birZFLcDSykvffs9sJRDqWde6oxG2RqUgiP/Ar7RnXZWfW6M/X6\nO0O+oaFwxKUfHQPcoTjsEF8CPd/Fh9OkAU//PQwe7YM+Y8SALI+CiUawhDOj\ncHYjuyi3fia6P2eQdjDrPIzQwhXBjOVn3v5HQgRteyjN1NqfVZ4oWwou9L9j\nExK4rGv9HSkWqGXZs/U3TAAOThKJBhpC5R4Ll0HUuPmcB0FEQLhbq+zltVKw\n4MrLwnO3atwERikRDF7690tmkC6NRo7MwQ8X8PVwOxwRGnFr9mTYHBijRRA/\npoWuevhOPCdANZhW16Ni3t0VAtTYMo4snsNvEVbcPlPBWM87ORFb1+0l7yw6\nGxyN3IPfHRv93CEcpXnXGljcb/ccE1XClMOOIkJ+8kUmRkLOGr8jk7yBSzZ+\nk27l3odL/4SXbYKgiLex2hTAKTtqI/gsXficuIp0mT+4/r0irWCYUhqpwmsY\nIZutAYk0xyQuH2p5+lVEVug+LMwBRWXiTQCfENFo+IGc8W0C91EHTt0feNDk\nmJxPvJR9bm1dS4Kh9T0zEysD7UrnW9fxc/19kb7Ux5iMVuGIaj4S3NwqkUPO\n/YnthyWq2VGFmqh2W+x73bo4zZ2k7zLqbwiKeSZI1aihn6/0bcS8UbscOPK2\n7iGP\r\n=h9M/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"80cc7639dca83570a37de4bcf4d7501246ee8eee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d4cd83a85.0","@material/rtl":"8.0.0-canary.d4cd83a85.0","@material/base":"8.0.0-canary.d4cd83a85.0","@material/shape":"8.0.0-canary.d4cd83a85.0","@material/theme":"8.0.0-canary.d4cd83a85.0","@material/animation":"8.0.0-canary.d4cd83a85.0","@material/typography":"8.0.0-canary.d4cd83a85.0","@material/feature-targeting":"8.0.0-canary.d4cd83a85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.d4cd83a85.0_1600994218703_0.5739437510810137","host":"s3://npm-registry-packages"}},"8.0.0-canary.199aecdfb.0":{"name":"@material/tooltip","version":"8.0.0-canary.199aecdfb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.199aecdfb.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1d07895c8d820e3097d3523a08dc6c486b9ba03d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.199aecdfb.0.tgz","fileCount":46,"integrity":"sha512-t67/uGO8J5CL+lroEVek/RHHj5ne7QTKAU/e3aQ7/KXB+2fRqHykTpgDdtmAdyH+l7p+luNg9llDY4y0V6jwug==","signatures":[{"sig":"MEQCIHIWGWOoEOvp3h5nI1QnpnGotAcdDvqeqFA72jwdKvpwAiAvzq8Vk/36AsQq1uRgXiEW/Tug4j+JHeWgc/5FyhosaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbhI2CRA9TVsSAnZWagAAudEP/jdX6DdJO5xL2mKAcwaF\nhgQLcnruGBrkLFZEtjwVMYHPAVD6SAaljpFrSBRUJan9PAUljZfBpv3kbYVY\nnTw6sH8wN2e7GCzHVprxnH7df/ApGVQuXqDcNf8wyF5YSFpgF4vK46wMLZ0C\nQvw3jKVe1K8FaDwG7TLjV3gDEJAthe7FSWPXdGSWbVNlVTPjkDuDtNzllRDE\nEaOc6JLzNXAcj18DX1MNCTwc78bfM9+nWwwYfv5Tjz/aamB7H9qCLRAXz194\nricsDaGDFBqRlUR56JKoBVOTnZIRb7seGMSZkGZX3/PLq5zDOLibfqeXtCOK\nAiQVlzYLXCqKO7Mje5QPVG71t1zjgLtrGvEayZxMRjyBRxLoDwF9ROA6FW5L\nuZj1vbuErktaQ9/7clpLJI1XjDx1X6QkFuGJubsSFaWOlI5DE64HaZNQbkUz\nwAWyILdwRyGz4YIU+jJM4CsJrh/WbMmgAUZg3JWMLy5OH19wB/j2DMOCc4BH\ntu/k2gvvAduevEXM+f3fGjKjI/K7i43WZtoD/O1o2NX0caQo0d3nIhrIiKYD\nAzUi7N3wJ3nV+dk6PkDaL7+JJhrl2a2UNz5u38SJEcBHGZzzgEYLKNhZWkIk\no3JF7UF68UVCcVjJRXowGFDG7lf6hzxy7K8QkWBf4by77jyeOtBdD2+rEACK\nLhcM\r\n=BJa3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2ced06dc0aac728f58cce508c7393aec959895d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.199aecdfb.0","@material/rtl":"8.0.0-canary.199aecdfb.0","@material/base":"8.0.0-canary.199aecdfb.0","@material/shape":"8.0.0-canary.199aecdfb.0","@material/theme":"8.0.0-canary.199aecdfb.0","@material/animation":"8.0.0-canary.199aecdfb.0","@material/typography":"8.0.0-canary.199aecdfb.0","@material/feature-targeting":"8.0.0-canary.199aecdfb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.199aecdfb.0_1601049142288_0.7183499298635072","host":"s3://npm-registry-packages"}},"8.0.0-canary.38ef4501f.0":{"name":"@material/tooltip","version":"8.0.0-canary.38ef4501f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.38ef4501f.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66370bc4b576e63844caf41362e4cd25e7c03f6a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.38ef4501f.0.tgz","fileCount":46,"integrity":"sha512-xapO3pHpD2hDJSAD2WXvEEeaGddTyPSclUfTiIWHKfHAzOIl3ari9TUu6ToF2hEoujbXYuyIhGK/rQ6WMdL1Uw==","signatures":[{"sig":"MEUCIQCfWFlQ7Aey45kdJmW0bvZpgsetlIf/9Xbbve/OO6CIxAIgCl8aINuqh0WGMjyHm2XVB9RP/uONxs5zeUQ8ch9c3NI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdM2dCRA9TVsSAnZWagAAGv0P/jisYv26v6grEw4H8weC\nclh9odmA3mValU23dfwIcTvy4rqALuO7NE8pa3zhA8yGmBHK6kLX7BYJLGIN\nkWwZ/fchJKwIVUp3ACtHlgpLf6TWs00wePXByb5JfVhgMI4zN+HtiIF7Us+6\nr8IzQYkXNWS8FaryF9sbTNv+/b3eiPvehkbDt+/lHAJUyMpLbeRFofuz0nBP\nGgN2XlJ9uzW1+qiaZecyctHdearI9YI1ULWUco1B3AzbFHZOXwTr4JehE0UM\nrcPweHc5b9sJRsz59hbnX6F50h5XfsvBmGtM4QtPFb+kL3RD+mcj7YCPtDey\nOf+N6Wkn4v6uFcyT7DEj9bc4/bcO1pIaSw4QQ4d8gZyeNPUDVYu0TTbvMQzS\nrAji+oE/Jr0rU7sosfSo9CVf3Wx9xHLrSLLvfsnV/7y+mNbU1JMdyoLBsPNn\ny5cF9tY6CbaGFz5w3n0MphyPnFZ2uc3UzYxokrKOcB4JMMrRBVs6pwzJkoTH\nehPQTmJS3l8edQFdDcUNBqgnqFgZN9AobjmnzJSf4uif+cD4IGuaNrF0TzS/\nN3LEZm95t8aVSF/PIa8Zm/htg4gYn4WsSTMCx9saAFLTDLIkDRmeLaZX43mc\nOdXxJOtPGxv58q8Y7kPFMSKP5nh5/wnmEybPSB4yZ8EXz1GjVuhcY9GKbAwQ\nkv/O\r\n=O9K2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bace3094edebc680b12a257aebfe6170928076ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.38ef4501f.0","@material/rtl":"8.0.0-canary.38ef4501f.0","@material/base":"8.0.0-canary.38ef4501f.0","@material/shape":"8.0.0-canary.38ef4501f.0","@material/theme":"8.0.0-canary.38ef4501f.0","@material/animation":"8.0.0-canary.38ef4501f.0","@material/typography":"8.0.0-canary.38ef4501f.0","@material/feature-targeting":"8.0.0-canary.38ef4501f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.38ef4501f.0_1601490333251_0.5099670995867349","host":"s3://npm-registry-packages"}},"8.0.0-canary.774dcfc8e.0":{"name":"@material/tooltip","version":"8.0.0-canary.774dcfc8e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.774dcfc8e.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"54c4149d7a97f25d69cb498bfd7d6b3d59ec97cc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.774dcfc8e.0.tgz","fileCount":46,"integrity":"sha512-vhIbbjKXlOpzw+JDahxyL7COIpSI1h3kxagcE6MmP6h6HQs+zC9uV3EhUjX+bkGvCNigmTTXJL7/Yx+5XIvA2A==","signatures":[{"sig":"MEUCIA7yy4bHLn4o7iI/6fuExYOirZQZFwAxbtEriYkrQu1SAiEA+/CS2MXAZcIVECcT+MY76vt2+aee+kG/9TNtHxU9+nQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdaeFCRA9TVsSAnZWagAAIw4P/jTZm0dqYO2OCy0p7BXl\nW0vF+mIp7J1gKL5E7RA8KmHJkXLd8PVtrIQXSMWj+udYG+qCydjL9DWy3Sb9\nNmziOEcK3bLi7jUmlyLNHsy+VEzRB75YLIbRDRr5fJuHddJefq6JUhTxo96A\n9ivnq2T2j9dQ0VoVuKhlgt4mHyJAXr6f5XvpPfhhveBvZKr8V4GhWqK1soxf\nBWbtpEwJDUYXomAATBWA+ySJpJVy9ldDNVuOzg4tPJi4NejA19SBqH0SO9xs\nwphWhnRw7H02cebBHOZGR1orVs+85kSvXXqO3RMpVZhSTjFdLitx6IEYSVND\natVshjoYQueEY5EQ+5zsq/tZ/gQgRhPTsDVf0sawvVKBrAAmZ7su272K5Kog\nLR3bmHuWnCMsatIXYBfvi6PRq+a1XmPzr2C1tQml+ak5pIavl5sL8MN+BbUP\nxgUbehDmAyuU/bnCsp8FUUf9yaWxfPUA4IVo9mKgdM2ujy7eMiXG1S214LN0\nChmY8faUtpAIB3VW87NctdfV5O+UflmMaxWaBsboRdcyrYmWHuTuWGiyvRI+\nqSP4+PmtM5KDKY9CT3GL2Z+bhdasGCBod0VhzJu7x5agBXQK2CnzgovUE+G5\nxVbtDhuLZ5GKlw0zkYtNmDDKuz+gAxamNA5M8lz2WreIFjQLVWcgWKeJQFxG\nJjqe\r\n=o7w6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6c37b80b059fbd4c815253f3a3868578afcc1afd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.774dcfc8e.0","@material/rtl":"8.0.0-canary.774dcfc8e.0","@material/base":"8.0.0-canary.774dcfc8e.0","@material/shape":"8.0.0-canary.774dcfc8e.0","@material/theme":"8.0.0-canary.774dcfc8e.0","@material/animation":"8.0.0-canary.774dcfc8e.0","@material/typography":"8.0.0-canary.774dcfc8e.0","@material/feature-targeting":"8.0.0-canary.774dcfc8e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.774dcfc8e.0_1601546117414_0.22038060783701052","host":"s3://npm-registry-packages"}},"8.0.0-canary.0f60323a8.0":{"name":"@material/tooltip","version":"8.0.0-canary.0f60323a8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.0f60323a8.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b0215de56bb5bf8b1cac91a550d64ad2fa1362a5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.0f60323a8.0.tgz","fileCount":46,"integrity":"sha512-p08BlJwzZ0RJ5E9SrpSM80PeqH09UrTo/zdLNjNxd8SrrVC3e7VHGzxOaVUI2N24ywtE1n1aeDSkcmZoflscDA==","signatures":[{"sig":"MEUCIQCGy01uyi/S6BNcIUPwtZnbyHHH9tvid0IIOfI7vA1qWAIgZcyjnWyh5FjV8eyIAWey1Lwy/mzLmigOexCvjZUTVZE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJff4BnCRA9TVsSAnZWagAAEYIP/3VtzEhkbPg2k1omXTR9\nCKNyn4ioMoSukGjfyHVjIsgpa8Y/KrlIsr7E6CZE8C7WHcnhPU910FYU5k7T\nXAlQPFaupkOeKbdtnkKxF9/uvN0TIy2yEW2BO5tGAZvW5izvpOLdb9uYoQmK\nbBv8B4UFjP5TlgA/ditEgW1EBSuhpyRmET55L5VR0IpkuhUN+U6vlHncDofI\n//UfFAFvm9/amBZBMFcHMQJTBouQ2bhOP1qDW/utyHbxjFi7HVrZF/K321hm\njpnlX+0Z1F+fAiJPdberDH/o2kA3gBdb/5EqNowOhMR0LaBRyOH02ATzT3A8\nEW0ukvO5T6hdqYFEmrVBUBlIH+ZtmLHVPwy7OtwMMzEhDFc/heXPQhLT7cSE\nz3HLihTPeXuvXAua+9cp7UCR8UJCnfKEQrjpY5ZHP/Dr7fkrtHJ1wDRL4Z0d\nOiNyqDusnc6o3BO11UMiahMpUVoR9FA8sg3cQrOEv4geGqLeb6oVErLItUVq\nCxb9GQ/cTNMUdJj6Ua/snmrjvrFd8+tL7sc+gveTeE0jaQOc0lSI6AieuHkw\nmRzt4QYX+t7JFPk+h7WXVUxF09pvJT+qwMD0T/jHH2U6SwlhnXOhDpSosJPa\npKmqWaNF46lmFEQSpwn9j9rCzzT0FNXvJHVOQWLh2wd5D+m6XyTLvFgLeMB9\nWLCH\r\n=xnsp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"edfdb55487a31cd5f5130aad32b3fa8f369e6d0b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.0f60323a8.0","@material/rtl":"8.0.0-canary.0f60323a8.0","@material/base":"8.0.0-canary.0f60323a8.0","@material/shape":"8.0.0-canary.0f60323a8.0","@material/theme":"8.0.0-canary.0f60323a8.0","@material/animation":"8.0.0-canary.0f60323a8.0","@material/typography":"8.0.0-canary.0f60323a8.0","@material/feature-targeting":"8.0.0-canary.0f60323a8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.0f60323a8.0_1602191462812_0.0001170581673060056","host":"s3://npm-registry-packages"}},"8.0.0-canary.d71622574.0":{"name":"@material/tooltip","version":"8.0.0-canary.d71622574.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.d71622574.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ac0a7b4494eee0d4155aa6ec87ac93a32b48400a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.d71622574.0.tgz","fileCount":46,"integrity":"sha512-u9fbwFC6hO2/rzNMtpFeNsUJ6eUMo2chNDRjegXaUrqGIn22ho9587qe9BeaBfFJ62Nw20obJDi5Rxt2URqOpw==","signatures":[{"sig":"MEQCIChO7wu3NZ9UwhFquYGS9JRXYRlvXJ2s8UQCP0JwLLMZAiB2KKwpEaRJZeT5Hkme0QUz2xeWQBDyW4C+Gr/lVPM5lg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgJCyCRA9TVsSAnZWagAA6O0P/R5fH43avD0KOYo/BHO9\ndN3PPD0WHyK+0hyTOpJxidiSUbqkI3XBpvyljVVGIfi7Bj3zhH4GgtJLy5da\nT5GhMeQ2QLVF9ak01SqtBKQ2rJlx6uDoW4n27gq7rUFQH/3K91mMCIYWv04U\nO5nLNstfWjdQnr1zM3e4PbNZ2x/Tw4TTxuAVVK36CqOVJKYmjYvA92IqsgF9\nxoAaoqkRoyRPf5zyoNxm7zKapvn7+/y4Yw8aGQjdsXaLRGH8Qc7IVfiZpIVi\naKMSKDgPRH9w9SpN2xK1zzl6H3Iw4NQf+SqOL5tXpscv64HG6bOfdrPGiyCS\noi9VK7QV90iQ72g5AQqZchMM6M4Hu3+UiwMYctITYgDW27dGdTn9FmS396BA\n3Ggi497cucEOfT8Qa8h8epV858fBvmER+abucXzuxhzkOwCNT2ItLqf8Qww1\nJGl8WyJ9WzXSfhVkS6q9BY97Gf9B3sxeyPJCrLGvcsDkJqBWrj4lLh10v6tI\nE1hO5AUHZj+QprxOFfUIpkgOyrN5ALQCJGJUGJPlXzh/YKPkmbb0TF6D572Z\npzJNPnxjYbK3O+IcQxfkHsUW5AvMRDDc766n2C3l+ya8KTcB8D82C5jPlyGS\nGM8FhEw/f6KQlpjAJbhFqrbXl5gmWknCIRZ6HT515HxSkVuqdrMDGM8lnqCv\nxus7\r\n=/MCz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"19a45f4824305f22d61cbf9deea0fef067dea3e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.d71622574.0","@material/rtl":"8.0.0-canary.d71622574.0","@material/base":"8.0.0-canary.d71622574.0","@material/shape":"8.0.0-canary.d71622574.0","@material/theme":"8.0.0-canary.d71622574.0","@material/animation":"8.0.0-canary.d71622574.0","@material/typography":"8.0.0-canary.d71622574.0","@material/feature-targeting":"8.0.0-canary.d71622574.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.d71622574.0_1602261170567_0.34717456401016444","host":"s3://npm-registry-packages"}},"8.0.0-canary.7a9afaf4b.0":{"name":"@material/tooltip","version":"8.0.0-canary.7a9afaf4b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.7a9afaf4b.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4de798643e62319b18bd12c118ace3c4b95d3479","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.7a9afaf4b.0.tgz","fileCount":46,"integrity":"sha512-zXVf75zpsiWwvWz1W9SCqqo5HG4m0yF3+lT0ZuJN23dJQrV9zHlVYZ9E1WK+xreRZQ6XquVEefuG6sPxXfwBfA==","signatures":[{"sig":"MEUCIQCzpqjimjj8ulIlFFI7aFaHPnGPnTbXtInfru0zUCIcuAIgO0loKvIGaLCCqvRIhLDArViMtxEinRymmfg4SevZnBg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgOpHCRA9TVsSAnZWagAAiqUQAJb+ZM4CPtXjQoOWChYd\nZco+0rb5b9luxcPyn/QlrhwSu5zT7QAcuStPT0kbtcu96VbiRQki/vNXfu/n\nur0X09CaA0pERWAyj4Ta4PpwcmywYqX78R+xR50MJWsqo2VDZKZ0kVhVMUdu\nlhQJQ1IkRk4gX3kH2GksGHT+Ol9OLMxJoMLBvyt/51OvxJoNPrMgolKh0Bac\nahoNWFkmR06b+vqEbbspukdUsR8SvzeJylbNpJog0qp4Y33yi04eXE3m/DJT\nppevx0nOHYgTXUbTv1N10R/DKJElQeNQwh4geJCOSgPIXRbj4+QV6TJRJUOE\nKI8e6ZQ0FiIz9gisX+lyXrtMEFelJCx84loB38JkPnbGQcolZjfDfqwBbUSw\nbqkx14XJ3Vegp7vJYxUlLCpmw+tViLwWWeU0wVPuCnLfPjWcbA1JNU3nHRLg\nbB9XlsP7RTPse+Xn0oa1ArenC9H7VwQ0AYDkPsK1TLUFVdnJa0jlDr3ogYvw\npf5S0CKwpiEkzZXLIccBlrsveNcmHLkXHhrL/XHb4PYcyVuHOOScEAxuhQIy\nRSvM+YEq0eKpBbYuXBVuArkEtApaWQ7Lm3Vjvy8R8ptCv8Knb2lJNJCceWeI\ni0F1xGwlWgGutowMSOuP61P1+AZ5fqS5a8pSaS8An08oDOXDVTos+Icu29Qo\nsDEW\r\n=n8Hp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"137d6fb8ed93c50312981c75fb37199ad460dcf2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.7a9afaf4b.0","@material/rtl":"8.0.0-canary.7a9afaf4b.0","@material/base":"8.0.0-canary.7a9afaf4b.0","@material/shape":"8.0.0-canary.7a9afaf4b.0","@material/theme":"8.0.0-canary.7a9afaf4b.0","@material/animation":"8.0.0-canary.7a9afaf4b.0","@material/typography":"8.0.0-canary.7a9afaf4b.0","@material/feature-targeting":"8.0.0-canary.7a9afaf4b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.7a9afaf4b.0_1602284103118_0.8157989865218385","host":"s3://npm-registry-packages"}},"8.0.0-canary.8a39352c8.0":{"name":"@material/tooltip","version":"8.0.0-canary.8a39352c8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.8a39352c8.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e329c1b1ccd7bc2b45a587efddb50168b260354","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.8a39352c8.0.tgz","fileCount":46,"integrity":"sha512-G+H0CsN+TiMlQ4r6+vYsGvkc/62hvmHKMLb2eoxFdFQ51SyjT5aoIxQxSzEPERo37uCfiGvF08sYimD1ZoW0zA==","signatures":[{"sig":"MEUCIFRfb7kPcMzyaTGxFioEotQcc1KHWKnSM+OTr3qKfrTzAiEAwB3mn9IrnpbihwII2qkYcw+d5SgpgPEW2Tz5AWvvZsY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhJatCRA9TVsSAnZWagAAQcAP/R+y91kgmD2yp0c1FIsd\nQxCSv7I2kYzK4EODUbxEaIshl5ca363lFPFt8AnTEShsnMyZ8nx3GjIqi4wK\n1xmnIGfZO8g1NQ6LzgJMHOgPYcwOiF5+/Zr4YnhbY4XB6PY6LZhrJo97HTMN\nUIGfEM7fAEWCtQadkkx10xPy5IpR/k2qkwxXQUMX/JHEPBLfU2S+2IxzIprz\njP390Aj3roeg1t0ieSLCtv1U3EWFHjdm5f19Z4X+hTF9gcSz57mUkqjCGhvw\nSD1SQOxPi8kbeBH/nseKa2RlIxDcZ4W+gkyOheQ4Hop31vx46CNKLI6x3iGX\nUbf6fMg4iKAIIbmXBquAvB54UJLGMlBMOmwD3kFkjvIPs5vzjsgppjkPwUkv\nVHhRV7VoxSoQGs0c5d1VZczwBmeTB5pdM4ywahaJzn6qOgd8UJ5gI/AYRthS\nStetcNE41AHX1URUs0/GvRD0vFt1cvXoFEGyF7Pssdwt2YZ4l8fg+7rkmZib\nAkZDOUf72wnhopPqjD04V/T5dkCq4WcZ/gngB91vIAEnJF3yGsivEVPo75Ll\nfgbR7QNXt+5BuxcDadSMENGqnqZcUuH/R8Jz+LWg3nn/FPhO9l/tG84uBb70\nVW7hxQxqlbcJrl4L8JAc5d1rM7kOHOZy3TbTLnKgrulZR04WEEhIE/0cBAMU\nHOUO\r\n=hxPM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"cedb8cd906516b8d460c813039351e951b960c50","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.8a39352c8.0","@material/rtl":"8.0.0-canary.8a39352c8.0","@material/base":"8.0.0-canary.8a39352c8.0","@material/shape":"8.0.0-canary.8a39352c8.0","@material/theme":"8.0.0-canary.8a39352c8.0","@material/animation":"8.0.0-canary.8a39352c8.0","@material/typography":"8.0.0-canary.8a39352c8.0","@material/feature-targeting":"8.0.0-canary.8a39352c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.8a39352c8.0_1602524845350_0.6551215818930534","host":"s3://npm-registry-packages"}},"8.0.0-canary.790ca85fd.0":{"name":"@material/tooltip","version":"8.0.0-canary.790ca85fd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.790ca85fd.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9005ce641cc393dc81ecea1b71d19e212a50e40b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.790ca85fd.0.tgz","fileCount":46,"integrity":"sha512-vP6Yn+gEQMJe98P38fABUQfl0c8+YbG6Y2ZG1THQ7UuFzvI1t98rzIAiBZ8Qj2xxw4oBWO26tw5ewworlwhKDA==","signatures":[{"sig":"MEYCIQDlIjx5eh2GMK+63SeD+8kbN3fQTj7aZ9BBX6J7XzNtygIhAM6SOMafMZXo1XtHfGjxs1BBAlOMn/MafDV92WWYg2qT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhNFXCRA9TVsSAnZWagAAmtEP/jqTM+FsqtnYXiNiek0I\nbJr9CNqXfHtlJpTf6rtTGSNLy5GOqVAJyf3vPhPMoiROq5TRDVi1izCJ2TMy\nE0HHH/G3E4RWvbxr1M+Iys57q12LedHAQUbJDyYKuoUpdjRpbA9llP4kAj2e\nvhjmw2UtzRNefDnJzib53inPGLINotyowI5V2tXLPrhMZcneId6Mjr1dcgoI\neNl/6HD3nvXGyoeEEH8rrmhoBVtKCdxwATTia1/ovlWvboapE9NN3EluuHrD\nRD1dEIb3gNRHBFNADLGD0/qL0FUaGan0cAdBp0VROfXlk5icKnESDPnLVdDU\nnfQT18nWNK9aClXwac2Oe+3wLvM3703QWzsXagzhHDeI+GRE42vHRlLt3DiO\nxoAMqiwOtdqeVEDCV8b/GjGoyRryEQrkpKqbl/Bn4Wb01JTt90QPm79bVayB\n4ulPtYWtTh4Vm7ECxjThCYxQf61OM87La6HxpFpgWNLWAdKWK0V5z6GD1tmP\n9DGg8JC9eqJbhhq6mMp9hdUNVueU9OCqQzi5dwjve8DxxuPd3enxhWlEEt0Y\neFdzuXL9dJzTMAD5HSIXmZltEVljsAOr6UfI5oOxlfS6onDfhADdCSPOAp4k\nyzXTmBbSLw1kirsntChREOSaZnFklpGwu8GYdb6Dw9aGQo4LAOB758M3iBGd\n9+hl\r\n=zrJr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8971e891898c4a8ca082beda756a7b93097f858e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.790ca85fd.0","@material/rtl":"8.0.0-canary.790ca85fd.0","@material/base":"8.0.0-canary.790ca85fd.0","@material/shape":"8.0.0-canary.790ca85fd.0","@material/theme":"8.0.0-canary.790ca85fd.0","@material/animation":"8.0.0-canary.790ca85fd.0","@material/typography":"8.0.0-canary.790ca85fd.0","@material/feature-targeting":"8.0.0-canary.790ca85fd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.790ca85fd.0_1602539862971_0.5271206699200988","host":"s3://npm-registry-packages"}},"8.0.0-canary.174c0becf.0":{"name":"@material/tooltip","version":"8.0.0-canary.174c0becf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.174c0becf.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"869146899844e2b9d9369a370bf3afa73d6915fb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.174c0becf.0.tgz","fileCount":46,"integrity":"sha512-LsbezxCuT4sNpf7+zB46g4P6BMToAKsMHADV/KHnUyw54QUoXfzydaAVa04xi94YsnKk/S3arlyIIRl8qWKejQ==","signatures":[{"sig":"MEQCIDnx0Is5nTYiuH1t7gb8c6KN2c1tzv/JY1zAxYDfwwPgAiBs6SjoloSheY0zgtrrE22HQWWabeQ/+rcjlpSfyYkYtQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhl+HCRA9TVsSAnZWagAAawEP/RJnbNHXRc2OTNek9H28\nnvStdRSHeyXmKnm4XpooTUMxB7wXZxNufq4DzoGEpKGuQ86kCr6tD/9Gq/Yf\nY+2npiW7kK7M4a7p+RC4SPjcx2T7upb6QN6YBwSraFpX9PZR8CkJYz7MHoXG\nNq5iyxcbAi21nBZ11N8RQDSjsdb81uWGLTVwVa7oPkPEzugTBQUFz6oxqgQV\nWPIcNDGzMUWQ5PF/LEas30zrMJ47QZcXY8+uraDqtbdBdFohbnyRUNjdRZ6N\nnR2Dqvgs5OsoCPiFsd4PR3xJn3UxHHZsAzi/1WjPAGTF/ZEtFMdu+ffSrrd/\n2EY4sEa/1q9kOijLW/6UKV+eyE8fkwMMCWiSnQFeE+5yvaIg4S4wGZmMh1rU\n8FmzS9A6bUj+eFfbJPJOW7XFa+DIdp8RhAeuvRJ1kW/Yh0/cKJBRbNK+CYC7\n/DYT8jyyUTt9u4jVwcRW/sgmA52LoFGwlrmVeZEoKin+wlhtFAu3KhPf1iNk\nC919JXxqS0YQx9I4zU30iEaSNxDTTv4s5zi+lxIMd6M6Yt3sDofdgNZe7ow1\nozeSdV6WQxlVfr8ufxaFi4jJ+Gtr08C0WaZNaVhU8K6QATZG63JqYA7OtVKv\niuRPmEfsfL36wHBD6+ulHJdPoSAXWzfSfnV/UXwbZgdmKZv4uwn+bXJ9eSgB\n37s+\r\n=Hn8E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6dc7561b8695889178b3e884e84f5d9c3d59e100","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.174c0becf.0","@material/rtl":"8.0.0-canary.174c0becf.0","@material/base":"8.0.0-canary.174c0becf.0","@material/shape":"8.0.0-canary.174c0becf.0","@material/theme":"8.0.0-canary.174c0becf.0","@material/animation":"8.0.0-canary.174c0becf.0","@material/typography":"8.0.0-canary.174c0becf.0","@material/feature-targeting":"8.0.0-canary.174c0becf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.174c0becf.0_1602641799106_0.4755962051589271","host":"s3://npm-registry-packages"}},"8.0.0-canary.c71ebfa02.0":{"name":"@material/tooltip","version":"8.0.0-canary.c71ebfa02.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.c71ebfa02.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b644040868273036407d87dfbbb66204a17d7cd4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.c71ebfa02.0.tgz","fileCount":46,"integrity":"sha512-5l2h4cyuPKmgERDHoTRuIgTI7MSBjCNP/vVs8CDEZfGyJSbDWY8ZAVag0WhEXrhx9z3KiRYWWLL4/uDbLR+yog==","signatures":[{"sig":"MEUCIQD/tDcdJg7dV1OgzBz2GRlbiZf139sNVDvISnz7YdUgJwIgfjKjr8EF/RRxk52mCNTjWJBGyItDYTsBBhqfY0b7zas=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhnwhCRA9TVsSAnZWagAAC7sP/1hl/X40VShH5U4/w6ap\n5k4DSpn/4Xk4uyisNIPORpwVLbLViaz8sAJ9e+HGncP1J4C4fieIZQXHg6Rq\nNPejxHJ4OoxFrZ1w01xIZ2MHvEi0TT+bsZvfHqtsrBnaKeO9iDepJxJJktzn\nGSAIUz8hzrjSKnL9whP+93EB10f5A6xJnsO8Xud5j8a992VORCsVhi/PqFCz\nKuHvspuxk01H3BmD7rbI3WC5Lz1sMPQJS6HMGs9GXa1J2DJoYbH1j8ecmz/Z\nx00saU2CQcGsGvQyNpjZMt9X21LGIvess7jVmjHQreH6DmHVajSVzg9uALzZ\ngjo5tb0Xx5wEwx4Ynrn/4iWgcltfYf5w3lES7Z8lg57PcOCxmV6TJtd+Q+2L\nfTr/DBa3nuM4/MvYN2IQG4EMQSrRf1sJkctRKdqhlMtN56yqrpcThi59goxf\nADDHRwsmeFPR4Kw1cHjS2lD8BQM8nVTyGzpsQ2Du3Ia46qxZaKRBdgeoPg+l\na++83OAIqnYpy5ZZgNUnhjCvqtDWa0Ak5xGTyE/fJF5J+xatInHL91a8wD7s\nFFdDuKp8Rf5NyOR50/k+qay2sKSjDY+K+/rPsu0wjJf0PXTW5GBvQm7Dn+Un\n6vt1HHbk+nxlp1ZLyQHwITJIwZcq4caqWGc8XFUfYhaL5m31ylKKP27GPLg4\nExtY\r\n=7DBN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d1158a184d234471c81501e838b409c54f591268","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c71ebfa02.0","@material/rtl":"8.0.0-canary.c71ebfa02.0","@material/base":"8.0.0-canary.c71ebfa02.0","@material/shape":"8.0.0-canary.c71ebfa02.0","@material/theme":"8.0.0-canary.c71ebfa02.0","@material/animation":"8.0.0-canary.c71ebfa02.0","@material/typography":"8.0.0-canary.c71ebfa02.0","@material/feature-targeting":"8.0.0-canary.c71ebfa02.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.c71ebfa02.0_1602649121158_0.2329255015834064","host":"s3://npm-registry-packages"}},"8.0.0-canary.2ab716cbd.0":{"name":"@material/tooltip","version":"8.0.0-canary.2ab716cbd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.2ab716cbd.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1a6cc118174f7b4c603c0a2607d087793e50b4ee","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.2ab716cbd.0.tgz","fileCount":46,"integrity":"sha512-PW4C5eBVsIA0Qswc/zbipMosDc3c7bUIdo7MrnxNl9r0b/jCJN+TZDF8MopNWW4v8Wh5TCj/t4xLdVFGxOZcHQ==","signatures":[{"sig":"MEUCIQCA7L55iUckZUCwRX3BzJvSlzo0B6DDEgJr1pYN/4EwYwIgQ2hGtTUStV/ptETZbSPxlg1m50nR9F1y6e0kDt0mB9o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiOO9CRA9TVsSAnZWagAAtiIP/AiWgFRZaMAfWg97PcRh\nbmJ7NBC3wZ+OpdMMv+9b0iwCZMjmeL+kq+bck7Z1Q4li/iYfjAeJtphE/v1Q\n/Scy+e5lpQpJnj+beVWh+Rnxc4Zz7ib2Z8kgEilHqA44D7MS4fgjE77baUvh\n+QSYotK2H0zZrbGUECSZfodwyp/wThuTYfFHfdUydT0IuEgF2iY3hptvv9ps\n5WiUQ6UI03V8cGJtzQf/QBlC8ymdQ1cyHvVm6MCwPyCYu3TiJsiCB9Jn7QsM\nNvZRBGkkrtX7cupK6jNlhAhyvdYua2lx0ZwO3H0ipIphKEcuK3HAp+/YUeEN\n/kYKkNcDrnZYgSqMpbR86JdmTX53fpJmr4eWAkbg29in5Wl9RKAKZURvXrk2\nCmTu/xiXyi8YYrRuHJ98PotRrmlNoLrCjvoKwNR67mao15vJ+nTzZuYv1UMo\n1w1hZlaaXwCrWMs4MDzqoI6Ay5DHaeJ6oTQRmBe/p6IN7tBtjM8Dw3YUwo4O\nMAHqEUONsfmvuwFWIYscLHWC8xza+usGzmeJomD2ve1QYcKnYVuSZ74XoUwQ\nsafFXnBEBToaAlVsaZSR8WAntkfK5lsGyUV3z+NWN5o2c9tno4Zj87v4hlXV\ndEx45hWWRXWC1w1aMy+JoyB6LaqeP2wLAt0b+hj3dfAhJPH3Ej/KJx6pgFMK\nKtmB\r\n=rx6y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a3f41127e9d90f7e393ee6fa5e01829e52160131","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.2ab716cbd.0","@material/rtl":"8.0.0-canary.2ab716cbd.0","@material/base":"8.0.0-canary.2ab716cbd.0","@material/shape":"8.0.0-canary.2ab716cbd.0","@material/theme":"8.0.0-canary.2ab716cbd.0","@material/animation":"8.0.0-canary.2ab716cbd.0","@material/typography":"8.0.0-canary.2ab716cbd.0","@material/feature-targeting":"8.0.0-canary.2ab716cbd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.2ab716cbd.0_1602806717486_0.5007377702105325","host":"s3://npm-registry-packages"}},"8.0.0-canary.43c1c5e2f.0":{"name":"@material/tooltip","version":"8.0.0-canary.43c1c5e2f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.43c1c5e2f.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"45ffc523e0f43cfef40c2f875f208514d1c9a699","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.43c1c5e2f.0.tgz","fileCount":46,"integrity":"sha512-P6husXEOzMdpPuqbKWuIacTvDkaGiidoeWFyusqYSYZQUF8hdLFnvbKcEDOEtCoEpTKIlkaP/GurExfSiQD6+w==","signatures":[{"sig":"MEQCIAMTjz15Ja0L5/cFkOpb/DnLveQJDJCaCij/Exm71YPkAiBGxrVI+GIQA/qe9GlbRoezgp057BiqpvJ7qModzAB0Hw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjZ4GCRA9TVsSAnZWagAA3OYP/1LTEYy+29KsktK0a0IY\nwqJQmuD+0e2De6wKBhU7VliEMegFBQxzvt7HOAX0puEiYURHog+5crVjWOeq\nQICe99HAKXVlBf6DTbNq3uvTgWgOzYxQuE+cpH4yUxD55An13NN5sdN+dX2p\njQDER24P92VS8GB7+i2xVK3e7aXZtAHo85fZfvVM9bcTMRUvvTY8G1CAAufX\n24JEEtlD7SrFbDZWCL0Xj2BZ0MuYfxkyDYmak1iRpJUrCkHkqMDljwEi+gR/\nJ4XSKCvir4edJFX3+7oFMLXEDUOBl8kdmdQdmGv8/cglxG190mm54o0/oKJj\nka8rCfdfr47GT1qMCbIHnPohFcUVdM5crbBIKPgYHxHHi8SqlMMvc86lMWNF\na7VC1JO4A1tQrIAfHiJlxrc/lsCKFZjo+Es2dsYlzsGAMfQxHT1aWQImbuTO\nXo6M1DUaDxjTylR+5m7XAXBXg4/ur5dhoC9G4Dn5tQCj76clWNDtjw8duPM6\nMxJ2Ut63cU2vLU0aCz1h32ZUCoZ5GByxZD2Hs3pMJR9z9KMgwHSv1soKJgmU\nHwO5N40V03+dVkKKBtwofaiQRsQ9QJ3qLHWxz2ehx6M+tdGumNIvqFa1n+s6\nh2O9GiG1+ezQ1kXXe++syiCKEZeXaDcDvDZVwjUANsDb8VX+NvOKqWp4uNuQ\nNOip\r\n=fzR6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bae89543d5336b4583fd1519cb63078d2a5c39f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.43c1c5e2f.0","@material/rtl":"8.0.0-canary.43c1c5e2f.0","@material/base":"8.0.0-canary.43c1c5e2f.0","@material/shape":"8.0.0-canary.43c1c5e2f.0","@material/theme":"8.0.0-canary.43c1c5e2f.0","@material/animation":"8.0.0-canary.43c1c5e2f.0","@material/typography":"8.0.0-canary.43c1c5e2f.0","@material/feature-targeting":"8.0.0-canary.43c1c5e2f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.43c1c5e2f.0_1603116550264_0.280980500579209","host":"s3://npm-registry-packages"}},"8.0.0-canary.ccc64eea3.0":{"name":"@material/tooltip","version":"8.0.0-canary.ccc64eea3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.ccc64eea3.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"81d39197260a3a9f94360502eed9310b21bb83a6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.ccc64eea3.0.tgz","fileCount":46,"integrity":"sha512-cbBI1OVXYvOCRMFDyDS+jG/ODm6Q8NstN/rlICF5SovekS5IUwddFFE9cBKtpaPXDO7hCu0pzJlQSD/ZXVc1bg==","signatures":[{"sig":"MEYCIQDY9NqEK/BRH4q6XfY6UwnUQ7qtFSoSIqXSB19xCdUbSQIhAJDDda0xo4Frhz0n64dZcwTD8IenGeblA1UR123yQ1Ft","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfl1MyCRA9TVsSAnZWagAA0xEQAIga8dthgTZxyPulGnJ8\n66Kpzm4DwIY7lc04DIJD2xHkPUumdwNpVobR2XDKXxKZhmZ80NmlSVYcoFVr\nEIv5nlSLJMRRRwGySybcfLn0WOWYXD7rVpc0psF+DqmRPYwn69KWo6ffS6pF\nF3cwExEOXonPZcxfbKRcm+MSU0fQdi8T6uY4OgisnYFg5VEkLNJ6FQy4mt2P\nGTD86T6o/yLNEh4Y7Jz6Th8gTV+DhUE73Uhlf5jBT+SVX90OXHkYhW3YcsT0\n7+tIkXVGcxFHioqT5RVtCiCxPNF6kYKJvoEyZWqKwuq5Qc32vIwGm8PwzoGR\nxhHZRChpn1IEPumZs5gWRqVz8Pu4wo6g0S4JDE6g7kHAcekZOb68z07iLWgw\ncKDoVuwSCBCyE5Z8oZDHn0YHTTIePFXhmLkSUwBzZO4f4pVSIR1LGotW4Pfu\nNYdL3VBYJNrSriX2AounwCak4y8hQPvGi+xThHOiSwMDe6yJRsL+tTfgSD/7\nd6qvD5WCs3FBH+jnCzj+8Tm0cuFl9ziJBMA3k8xXiVRzSc3dICfnYluWbIlX\nAGKC9QN9Q/nHUmarwF3/eY3zCr4tNhNlHxGQy69B/EaAW7E6h7DJ80isS1Gx\n5cA5c5g7DKDdT50W2YRfPSD7bwdjgsjSBaLQFp0e96vhGk0hSPfNZQ/z4pzC\n/khu\r\n=2c88\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"26df299f75c86dada6da463cae5df1b0277d5c7f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.ccc64eea3.0","@material/rtl":"8.0.0-canary.ccc64eea3.0","@material/base":"8.0.0-canary.ccc64eea3.0","@material/shape":"8.0.0-canary.ccc64eea3.0","@material/theme":"8.0.0-canary.ccc64eea3.0","@material/animation":"8.0.0-canary.ccc64eea3.0","@material/typography":"8.0.0-canary.ccc64eea3.0","@material/feature-targeting":"8.0.0-canary.ccc64eea3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.ccc64eea3.0_1603752754110_0.6493652676272057","host":"s3://npm-registry-packages"}},"8.0.0-canary.a79cdd019.0":{"name":"@material/tooltip","version":"8.0.0-canary.a79cdd019.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.a79cdd019.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5c30e63882cac3be1796f5b8b451343593c6a365","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.a79cdd019.0.tgz","fileCount":46,"integrity":"sha512-FNs+/i+7UMZns7iHtWIFcNZLXdaLrdfzIGARakxmHIqK5tOjth52VHEPm+1mM1j7qDd3XTX1dImNYIMiQ8ImEA==","signatures":[{"sig":"MEYCIQDdJ6J4D/6mz4E1LGyjFlJfEbOSHOKoae2YM/hEQ+L50QIhAOsBf+7SkPXmmKm/LXi632fvZojCKUimMixlPJxyqCAi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmEunCRA9TVsSAnZWagAA6MQP+QEWNVM2gWXH+g0gpRMW\nlyFkLGCunHxp5ubVQ906NIkseRKk+szoRuEpwh2SvXGycpgqwh2P5IhV1rr5\no2Wrw4PiCxxQHcX+JdsY0bgg67stH7uNDzpjDohTq7tFF/cfvQy/nIQMn8J0\nnCx15ykSfeQobBRokjCkwNy8Z5x4Gw0f1tKnUVHS7NQESQ7BIgwZPQyveXvw\nssfzVJmE0+LCdfmjKTpGDwv0sZ61F3DRvfuPq/u82Jm7LebK3Hcxh4B0dHM6\n08b1Wmq+fQtwF6XKwpV8DcwwJ7IGeewC5Gi0+oVv1DhXtXZ9qLslPTccNUCY\nMy0FRV3ohqm1QqX/Fl5pNHX4FpcyKuLElvG2dl79PXqjM0qarRjrHZZfjvrN\nhYbKTMNGeEQN3x5j+r41S4n6k+LeCosCoPf16FWpCY76jZQXJQMV+y+egpEk\nUVwtB2KfKqsp6dDnnZZGAJnag8O1wR+r/CeRAWPqrMo2VExe8FjnFgT1bLAk\n5191S5Qs1CbHAQJgsmyXaO0yjING9Q2LFEbxZsfvzw6luSm3gjW+J99QajkO\n/aBDCK8X+wUBigZjiLgawh+/8EhkJB8ddregXxdKeoIwa4iWg4hrfTyZjQpC\nnOS1GqOcZAAi+o0Mf7n0a88sFpb47NRL7IuQ6UndemYzDBUOiC+7TqZETMto\ndIQZ\r\n=/MVj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c54ccf71e4018e84948fec32678595d974f80c67","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.a79cdd019.0","@material/rtl":"8.0.0-canary.a79cdd019.0","@material/base":"8.0.0-canary.a79cdd019.0","@material/shape":"8.0.0-canary.a79cdd019.0","@material/theme":"8.0.0-canary.a79cdd019.0","@material/animation":"8.0.0-canary.a79cdd019.0","@material/typography":"8.0.0-canary.a79cdd019.0","@material/feature-targeting":"8.0.0-canary.a79cdd019.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.a79cdd019.0_1603816359490_0.8148097801000294","host":"s3://npm-registry-packages"}},"8.0.0-canary.596e98424.0":{"name":"@material/tooltip","version":"8.0.0-canary.596e98424.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.596e98424.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"72c8cdf91a0309e67845aa981e1c061c4f905c5b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.596e98424.0.tgz","fileCount":46,"integrity":"sha512-B90DpSVlxV98QXrfTuXZSPmD8ks7Of6cdgfi3bA7XiS3XmhKQT0cfhZMAwY2pYYIldQXqXMVvPuITxir+GwxbA==","signatures":[{"sig":"MEQCIEf0sgGSp6jqv5ns4c2kUaSd4vdtAVVmwHfrKcCFXMJ0AiBQIAVJVlq45pIyeHlIVctl83KDImsDzullm196A/dhJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmZacCRA9TVsSAnZWagAAVCwP/itdj8Qzg7ANi1c5jJVZ\nB/OPoLZqxOv2fY0ka9G3q5i/EMX3HhFqoXmqrSjxMhHe1xWKwKl/SntD7DmF\nN9nST+63AgKrWW9G1n3WVgA9IJewS5sqldeURCud7a+KQxRiAl3ESsxrA+D7\nOwsSrlCJn0/nlT9LX4Bvshr996farW5lV2yhb23eY1/fFmhjWirmK+Od5ADs\n4OzaaDOyTDnlOVMzHR/xiFH4xPo81EUZ3KdOLwfkt9T+gXiZE+uPDwOo4S4v\nIAsuMJTtEHW2IRUe3tT97cz6iBLoBzB7WWN0h3ScP9LS+WEla+b0/KzpjIeG\nHDe0osnvamkj8MDhE0zq1XRpvpgF7SSWB06hKWebOdkfhqPDTkKNo+TEEebF\nliyDg39EeEWY1TOCpisQn0ku4/e22Yewde0WB/R4Wz6+at+5lYuIgIIUorQz\nJlV1whQ3xhBw3/gsCfYs6LkwgZ245hvAdzx8b/GzxylHNML//KV03GF6JIsm\nGPRzV8Vl99YUfqDVD6Y3w1bcz3fbVuOVKF8UTNQD41KCXdQm+Wpuj0FswBUT\nZfv0vyyTd3mEfPfrtcdZ5YbkKmzSwHP678n4sXn59uc9nO5DC7EwGYC9Xter\nkXYJNb/wwihItJm7GZmmDagAYH1Wfw5ejtLfvE+Qu9C9H+O9UEhRwNVNojZY\ndsEv\r\n=ER3b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8fdc1f444b4540a876847c7c3fb4a934e75fee2c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.596e98424.0","@material/rtl":"8.0.0-canary.596e98424.0","@material/base":"8.0.0-canary.596e98424.0","@material/shape":"8.0.0-canary.596e98424.0","@material/theme":"8.0.0-canary.596e98424.0","@material/animation":"8.0.0-canary.596e98424.0","@material/typography":"8.0.0-canary.596e98424.0","@material/feature-targeting":"8.0.0-canary.596e98424.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.596e98424.0_1603901083879_0.43999832670683925","host":"s3://npm-registry-packages"}},"8.0.0-canary.05d5facc2.0":{"name":"@material/tooltip","version":"8.0.0-canary.05d5facc2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.05d5facc2.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cd0a8c1a55a1eb4e2103acc2cbaaf9dc77589276","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.05d5facc2.0.tgz","fileCount":46,"integrity":"sha512-lb1cvb3UksQIydkL3XtP8429iASX9czdd40z9XBQsQxEet4CZ9lGQ8XYJkebmuWyqJUkSZm0ND1JA4/jhv1yHg==","signatures":[{"sig":"MEUCIFWdpVYkx7y8IA60NYqcALLgxeUi3lSh4UFuAP7ykUO0AiEA027L7y4JROW04N0Cfd74/Z8EbiJTzC3a+tzrod2Er6E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmZilCRA9TVsSAnZWagAAuXkP/3hZ1PlAlI2JPMaD9fkg\naw09EOmevCrcn+d95GMXEWX1sb9xNtRTYaYPFnQLQ1C0yQNLYolqPqzZjOgi\nbnr7JArFQ+sjoabfbXsKYBg34GTtRYA63zX9T4HOkdLyCfTKn1mtgOdKcnlm\nKGKkyp5Bn0OY/uOzM5pO4anmfrL4X9wC+BUkc4cT0DIy/6Nd/PuoDSImoQaC\nOGjrvxXggc4xKB+uIdhfXkoBVSlGrpXYNGyBqvll4Y2sdmakpOxyAZRcpMuA\nXBrHJfU8qkMOPKp+V2+nxSqXQCqd9I3TPubPOvusbMFsDNBlRjdIKr+JGVP8\nZTDgP45B+FOInfY4UnRUM2jyGfuSfp6JPlfleV3DqerdBG9ZvzGabMLd5P6/\not66o0tv6U6x0F2gA2dkbMJbPDCZmBpx7g+HU6sUtpGNAKflvSzspkAn7AIJ\nvsxo0rrzdSuegQVQSZaW9COALv++JNLwgZSXxlUhlKU+zOIGCV/IwTHjlBQE\ndm0291WvrFGJ5x96+MwZd5d3+LeUINF9oFFblu2XDyIt2G84DZiDPq/mYM4g\nAI3WpDfAu/wt7IXk8RPV42zUI5ZkwXEPActSsYqGeOST5YYlC7gzspVsc0it\njQVzgB156Yf8JWeNCev0SoZeQnE12G3ObXfkST5Y0GGb2s++AwbwgBXAEmXm\nZcRl\r\n=58aT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"db17092b19dabd6628edec5bf226f0b6a48e4f95","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.05d5facc2.0","@material/rtl":"8.0.0-canary.05d5facc2.0","@material/base":"8.0.0-canary.05d5facc2.0","@material/shape":"8.0.0-canary.05d5facc2.0","@material/theme":"8.0.0-canary.05d5facc2.0","@material/animation":"8.0.0-canary.05d5facc2.0","@material/typography":"8.0.0-canary.05d5facc2.0","@material/feature-targeting":"8.0.0-canary.05d5facc2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.05d5facc2.0_1603901605030_0.6715801588164265","host":"s3://npm-registry-packages"}},"8.0.0-canary.291b3553d.0":{"name":"@material/tooltip","version":"8.0.0-canary.291b3553d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.291b3553d.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fde1807e52e0926f1444fe429a7b8d290794906b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.291b3553d.0.tgz","fileCount":46,"integrity":"sha512-QBaH0cJCXiKAOYQhqriLxWoq+YtATmNouPfK2PRsRz6dj7qxMoZ7XT+K0sW9gC6Tl9q2k85rWoGoOKYELjOtNw==","signatures":[{"sig":"MEUCIGb/coKfkoKa5eNyVUm3K0cJESJO73HUTed0dvOHzQifAiEA2215DMbhl7W02xdnhnBpNdiRk2iymTjoS/U/yw4y1pM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfma5dCRA9TVsSAnZWagAA19gQAJMMozgS2Bto3ETYphtA\nZdQqnLQFjzByM2O78MO5ZGqXcSj5f1+noWzElQxPNMTNdeU3/id9g4+UoX2f\nlk/I0qFOvyNPTniKdU2T22VVb22rqDTqoyNSiLnPdgYNq5NbtpyZUh9DOoFh\nQCE5fVnBSUBSsTyzdepRlvm+H36aIexzT3VZLmwm6630j/rduLEQXeHgp2DF\nBn6con7B2+2v4pKVwTlT16hi8WKALsRi9ad6u7RN1dnVU7T+sfm3FGmPLP/0\ntqJffTu89k2prDJV9T2j9LctKTIWt7ndPpIvDBGnS7ASAFWEVrig1EHfHjeE\nJ6Aq+QSPr7Sri/AQOew1jB3vxy/2bBqzbxNT+a84l223grlW1Lj/EtwajeNW\nmBBBQjilWFAkmN6z62QEHHm+BV+A7YfuP3SH1ga3wZLgEIGCYGINhIeNoqKB\neUVAKd/n/23/Ea7dJvrGTV1AIxvKCycsDBrz1Rnfcc37beAU2SQZj/lSoH2i\n78IokSCWp1O4X7C4TcPHBvS3Y0o4Cw0E+bbfuX9MgK2nUuMQpuT3sj69UceI\nSQV3RngMXodVx/jPhBJGSQr5NLpKDzJu1VDP9mFqD4mdwG/3DT9xsD/sgW85\n/hYrr6u5xEItIvBu77yie2ZYa8nE0+hXfrRneK8nqJNxs7yGUn7BELsCvrpj\n96Rc\r\n=/3Bw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bbd141e6c5168a84cdf50ef1302c9f705f0eb283","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.291b3553d.0","@material/rtl":"8.0.0-canary.291b3553d.0","@material/base":"8.0.0-canary.291b3553d.0","@material/shape":"8.0.0-canary.291b3553d.0","@material/theme":"8.0.0-canary.291b3553d.0","@material/animation":"8.0.0-canary.291b3553d.0","@material/typography":"8.0.0-canary.291b3553d.0","@material/feature-targeting":"8.0.0-canary.291b3553d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.291b3553d.0_1603907165013_0.9452527379044424","host":"s3://npm-registry-packages"}},"8.0.0-canary.dbc449b09.0":{"name":"@material/tooltip","version":"8.0.0-canary.dbc449b09.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.dbc449b09.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e8ad9aab893c177ab3feeb775c1b9c0e678b435f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.dbc449b09.0.tgz","fileCount":46,"integrity":"sha512-VybAUEm11cmt21Fef0st6EwvQn9SmLM1m/C10ZXRAiVw9xh4+hY5Zat1l3GEIVqqQAFsqH+p4k9/8fXcFc5Rtw==","signatures":[{"sig":"MEUCIBelbsF7ZJXLUEYEYsnKXUqxVhCGGGQANJyl3f/VUaGNAiEAr1nTDafeZkbqoZ6XQ+gSeEX6PAnzSG+kFtupYvsFM6c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmbTfCRA9TVsSAnZWagAAsIsP/0Kjyyv6ely46kqnPun1\nzYE25i879zVYaT14k8oale5M8iW4PJPEjjdPBn9vxxGnWYFKHnSZTHi4JtbL\nBCW3SE589tUk1NCWjwer0JHE53js3Bl+14VVN4tD06Ey2hVji4NqWoMj6tVu\ngfVyoVKk65DMMrTD/kxiHeJq4MEb6iJJjmuw6FcsNr870ToRaYy/2BTzNxtZ\naAeu7SXYRRZJ3Q+QQBtjtL1N7eW5KdQqpp3larqecW52rk8kvIsO8ob3UA58\n+2HoNa/icbDcFLAUSi66SdgWI9d61cSeSmGf1epyDxtWhmp3Mp9ARYHiUc/K\n0bDz8khsqEKOSe8IJIRJfKvbNNe9516UYX+r4MswxzCR8CAvgICep7ztE6So\nyauq+G3WDTXCvelv5Ha1O6PD/+DarHENIqijytPim0PAosWuCMNhOyN0skWs\nfZy84JXrh9QnUvL1X82JsoNtagdjazgYCf6/UK06+MPoKekpN5nxdnmWwFA8\ncZPJgxDYdWpiuLDYc4j04d/Os69W4FWb2I2TnonUg6k1OY00lQ9Qvwl6hWXU\nNX0e0I/40FOuXpiVBGEWJtzo4fRQAhOieGorPud8VPzZILF6pN3P14Y6F4W1\nNLgH29dukioeuJnzCCraIR085GIvmATGLf0X5qGqBo9wPsQka/LkXkVzlVVa\nBJtC\r\n=sC6o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7888f3b13baccffea8b2b02ef5c25e264ae321e4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.dbc449b09.0","@material/rtl":"8.0.0-canary.dbc449b09.0","@material/base":"8.0.0-canary.dbc449b09.0","@material/shape":"8.0.0-canary.dbc449b09.0","@material/theme":"8.0.0-canary.dbc449b09.0","@material/animation":"8.0.0-canary.dbc449b09.0","@material/typography":"8.0.0-canary.dbc449b09.0","@material/feature-targeting":"8.0.0-canary.dbc449b09.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.dbc449b09.0_1603908830778_0.28958452551141","host":"s3://npm-registry-packages"}},"8.0.0-canary.4794b25da.0":{"name":"@material/tooltip","version":"8.0.0-canary.4794b25da.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.4794b25da.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ea82c21650d2ed334f7381f49fbd2fe80dcd35cd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.4794b25da.0.tgz","fileCount":46,"integrity":"sha512-016OSPWJrcHz2m3l8YOGXMG/lOIbEBwx/+P5K3u3sdk0V8nOWnfAZGpy0EUBD0gptbXetlrNvl80wqW7QdL/sg==","signatures":[{"sig":"MEUCIQCo3LmdNiSncFvaJdVADJAGzevuvl+E/Dh9AuZEVjl8TQIgfaGijILlM881KDf5HtcxneUroI8SDcgG8C/uuf4p5bE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmbuLCRA9TVsSAnZWagAA6DwP/jcVWZ1V/7J6tZEqVviT\nOkT8vOLCMGbSlPIcBzrYgTLYCz6kkx8TOoVnH699SP6763X+E+JSIi9AQIn8\nIrGYL+8bt6JRu6OCkbZgqnGlzyzUvhIHdvXNGE1bnlAsdSrTZt2yoYORoipp\nScrl5iaK8FgCJykF/20GfLeE6bFbf6VI9vH7QLfkDzTXvSHWOd6Tb8NgFGPf\nwmUYHzBnkJBECF+G0sz2TbhxTUPBdRFl9pBf3l6Wja+dhwcESV2kgUqCuSJk\n0cfZXsRZ8zzf2uOLLvtU61tjAjsNu2+af7ze9z+WXFzr9Zrp7N/+rOWoyDO0\nhX4QsZ0xN/9cVWePnWcj0EOmNyiunWnwmJvL10auaf/fF58B2+um4DTGw0fp\n4X3BV7UKxi9MV9nI5/3q9t0tbG3fMLZ11gMl9zysIeikGfaZ70f+s6T2230Y\nQBRmsP81zkdlbJDBatO/WTh3HBisUkYbuc9m90UmJ6sRkqj2QLOIfsSwVfLm\nn/Zx2M7vTLZxZU5gIu4xf/VEKYIMTXGmN29CHmvBI6+CwnY5L54Xeh6F60+x\nSlfgvlQstWQU90ZdUvY5+ZCTYcdu9Nh+rmxuGi/7yAiXy4xbYnYp80ihoeHx\nLvn5OJXB+vDz2gkzCMUfmARgOI9HNiTZZJQGtA+sn2w4n/MI8qkDaMOAMrvt\nVtNX\r\n=jE+Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0c2eec6be7b76adae9376847043bcde093f59d3d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.4794b25da.0","@material/rtl":"8.0.0-canary.4794b25da.0","@material/base":"8.0.0-canary.4794b25da.0","@material/shape":"8.0.0-canary.4794b25da.0","@material/theme":"8.0.0-canary.4794b25da.0","@material/animation":"8.0.0-canary.4794b25da.0","@material/typography":"8.0.0-canary.4794b25da.0","@material/feature-targeting":"8.0.0-canary.4794b25da.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.4794b25da.0_1603910538747_0.4024071354520591","host":"s3://npm-registry-packages"}},"8.0.0-canary.c61db90a5.0":{"name":"@material/tooltip","version":"8.0.0-canary.c61db90a5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.c61db90a5.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"673c6450792af1da633f21ef7d1875118248428e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.c61db90a5.0.tgz","fileCount":46,"integrity":"sha512-HGF8vKgdiCOfAg4NhAYP2naqTvG91Ob/ZHnFvRWnImVwFiHfJhKrmzRJbsJbJNops94Q3ueI276SQJMDDXuC7g==","signatures":[{"sig":"MEUCIQD7ITArnLuiON0K/YCNJmOIfQLUn2CsFTUKPgqEtDw7VQIgZBjubblXgagDfp2UiWGTeWR6gBXTqGlESFeJT0G6zMA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmb/sCRA9TVsSAnZWagAABnMP/ivenH6zP4yXskUzGlYJ\nRiRCRnu4iYMlFDe/TrhdMyLqczHb9FLbFLNWsXJvLlnNVXLtCXOieHZc5w3t\n1pfEjIa2CTPNJyepGUD73v7SI+pCD8sMSzPBy5Oau3oNcIUKKGvsyyDJcf6q\n/Ju13U+OFVnNe4YUn92AGU9fsDg/BxcA6B63xpBJzZEe3BRJcmD8d6gjVyvt\nszZUAFo9WgRWb9mZW5YF+WlJjmp30AdUh1CV/xMll/iF/6/pey2FERTB7skl\nOCe6o3P2xXsPA6egqbI04hv8v77EJD+95BzGD7j9HKTM4OYcHDHUH8nMeYI0\n3iEtX67DxC4FzyMRBqmv7QkZsPMyZ2XDcd5L+wqDgEVXKUf+7D55Pru8ULKb\nXlt76+H6WHu+3x5rRKABUpkMtSdmmTdTGbMmjOONJ80AB1Le9F6+zIW2PmIm\nqRWWIahOSn02TN69pQ2o3gx5E0myT7nZiBdRxW/433b6tNRExYRwDQ9H3XHa\n10hKugICZptz86IUy9uFu5wxDt97GxSlop4tSNOLpb8h8TcIAXc8OHFY+uD3\nCYnEglOcBrwRBnrhshOnQxZdX0GUiG3K1m+rJr0G7YNQPaJIMGVsJWFUctBr\nyWSBdwtsmcMdGvxODlRNdLX5cApWmp8/TyX9pCY9V81o1uPfawmPq+zkj9w2\ncPTV\r\n=Wzl4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"695570eb7478c283510b9174ac7c4911866e0868","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.c61db90a5.0","@material/rtl":"8.0.0-canary.c61db90a5.0","@material/base":"8.0.0-canary.c61db90a5.0","@material/shape":"8.0.0-canary.c61db90a5.0","@material/theme":"8.0.0-canary.c61db90a5.0","@material/animation":"8.0.0-canary.c61db90a5.0","@material/typography":"8.0.0-canary.c61db90a5.0","@material/feature-targeting":"8.0.0-canary.c61db90a5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.c61db90a5.0_1603911660229_0.6340493056927277","host":"s3://npm-registry-packages"}},"8.0.0-canary.6d9648ab2.0":{"name":"@material/tooltip","version":"8.0.0-canary.6d9648ab2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.6d9648ab2.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4bae69aabb7b5675bb49220021fdb6b3ace11e74","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.6d9648ab2.0.tgz","fileCount":46,"integrity":"sha512-X+rAgV6XRW9dB+3CWytTFyNSGfQ7J99a7on6UpnkO2nvjtbIpBqtZWjn3195Jw/VtoYFzyjvyKd/HvP0qVCgLw==","signatures":[{"sig":"MEUCIGg65nViIW8hRQTjJfgN3k/c4cyAjnCs+FKvB4ARcgOeAiEA9zp54I/yUfTbI6p2H9EStDptAGsDcoZg6KckkGId8CE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmyclCRA9TVsSAnZWagAApX8P/1Ip+s6/jyyhR6/aTNKU\naECZhkK8l1uO+PUB5Z6CwWmoujbSvmNkx+evUA0JE/lshCujdtHrUOBtIULF\nfFuJR2q9uw90NU5MIWPkiBmZZKYZ4fHkff0VdL1JC2S9Jyr/aYhSp2iizhmX\n3teYdw1O61nz8+IaEPflW3ZFEFYHXvnkJ8s9oy0Q+O70HGnJ3fBhuNnFzIlw\nekqRYId9bvNI+6QU0va3QBuJsikCyqk40KsOotmcPkxKEos2qIbKaql5QaBb\nA3mJq+pHPd+VFtZtPp0wEkL8vkfl2sSaHOcxbbAZWdt2M8BrLLpxw3ffoBJh\nDbNcz+YNI/778k1PxJNePf0SszmScTIWU08tmeAdKpzEMd4ORoY7G+QIcb6e\nxCVB9xK9ySIR0zDyamS1qAM3Fdo+dl4fIQxgUgZ/HVM61/+rtATvUpFA3csb\nWZjDh42eXk+tR5ZtW+kwWKLOV36TI3Dx3FmEK2jNxkBtNaH9XJzOOzfZJOp+\nGWy8eJvdTBXC+6DicPHsuuqoE0pco/MG1OAwQwSbwdn4GvGAo1MXtePKqYRv\nR/men1QaKAKWVyEF5LKqoArwNys6bgJ7BHc2ykPAXW80L1caOiI+IN6J7sEC\nsygMg7AAt5rK81HlJ9pHYRqntczQS3PDPooVHc5kmNlYpU0KU9BU+Y1gO05D\ngqUj\r\n=vuAj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5de6a39d4b70a98beb71cf8243a219f454b11aa3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.6d9648ab2.0","@material/rtl":"8.0.0-canary.6d9648ab2.0","@material/base":"8.0.0-canary.6d9648ab2.0","@material/shape":"8.0.0-canary.6d9648ab2.0","@material/theme":"8.0.0-canary.6d9648ab2.0","@material/animation":"8.0.0-canary.6d9648ab2.0","@material/typography":"8.0.0-canary.6d9648ab2.0","@material/feature-targeting":"8.0.0-canary.6d9648ab2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.6d9648ab2.0_1604003621364_0.9423034980012228","host":"s3://npm-registry-packages"}},"8.0.0-canary.5511c5254.0":{"name":"@material/tooltip","version":"8.0.0-canary.5511c5254.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.5511c5254.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"031351a6f4ad1e72a70a80d8ac0b915a2415ef65","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.5511c5254.0.tgz","fileCount":46,"integrity":"sha512-sR3FOK8h4SAhhLLikp/+vnD9hAFv2uz3p0tZS+BVGcIkzLFjL0KvUOxPLIlsx/oh8IO24HodGnCv6aTF8qf5RA==","signatures":[{"sig":"MEQCIG4n+2v2R0BYxGCkODAX85jBw2UIcOCFdYeE0uoDCg8LAiBJ1UMb6LRRkc1C7RGbUnzz0ILclbGf+O62gV7YlEwL1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnFTrCRA9TVsSAnZWagAAAw0P/1wWcTuIRyWkqQMRzs5v\nP6UprVdkelcd4RgztI8pKZJcKnokIsRdo8LwrsX1VLqffdi49Sit239cxhn6\nEY+Fdy88yTnjf+yotr++qwXGtZNh2xNCfIa+SsA5HqML2zQrRJi6VS5iBgFs\negTrIcDZvnZV24msXToyJmC8IcdWTCT7kgkpWFHtqYyd8PveuiE4IbD3GfOx\nFOY2N/Kq0FD7YPjYeL/whvjUOvSLHfdhmjDPBAF1SAlvj29y6ZPnhYOkTP0W\nlqJYipkDsCtxaClV1l4GkIjSN4BCC9GWVdabaV+ZgIueRXmOGqwRZMPq1o49\nm6/6VcfRF2Ox0nocU3ndpria0OnF6FDOWwU51rNdYVU11i9ctab9UdxyIeOS\nMupv5AdHf+CHF9ODZc9fcHzWo1EfzQc0xTMxxXUvhxHiD7vktNgJOYWtcRXq\nuBqvcCjuCnmjYkynvaKAiCh+TWaVZmrxXZ/NkyePdaPU515882EFf8iqllRT\n/XNOHtrJ4fc0FspfDP7DYAC/waCTMcJ7vGe3GgpK/adoPCwpipQSaB11aKY8\nDx5licA/FrLPVs5OBR/B2FJQlX+RC0odeAAPpPDWygcUr97qypLeQdu1NoAu\n5KCKQNBwGJhOD+e5gCE2LTWdq+GhWTU/AlLR8YhX03XSZCtk+IGrAkRLnKnC\nh8D0\r\n=pIS1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e847a627e044cecc475be1f0140e17a4e2a68dbc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.5511c5254.0","@material/rtl":"8.0.0-canary.5511c5254.0","@material/base":"8.0.0-canary.5511c5254.0","@material/shape":"8.0.0-canary.5511c5254.0","@material/theme":"8.0.0-canary.5511c5254.0","@material/animation":"8.0.0-canary.5511c5254.0","@material/typography":"8.0.0-canary.5511c5254.0","@material/feature-targeting":"8.0.0-canary.5511c5254.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.5511c5254.0_1604080874945_0.4326733773666209","host":"s3://npm-registry-packages"}},"8.0.0-canary.bd6e302a4.0":{"name":"@material/tooltip","version":"8.0.0-canary.bd6e302a4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0-canary.bd6e302a4.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b0e5969930ecd687da33a41a3cfb0c33fafa0f4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0-canary.bd6e302a4.0.tgz","fileCount":46,"integrity":"sha512-pG/IL3D1aYILgrBM4hxiUJH9011MDxtiHVHH+39hQxuMtjnXTfzE13GhhF8m6ahDniPkjywB5NWlTIWhrHrXxQ==","signatures":[{"sig":"MEUCIGm9fmro6YfCsKrYNPEKpg+pAJJhdgumuvSSmMsd6EOGAiEAv0G6QfqREaFIJPQwFMVeRHVL/CAYh/mAQVuHHFxOccg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoDx0CRA9TVsSAnZWagAAYgoP/R7iXq9qCyxvHgXzdtML\nHSRdVhiFxGyW8awNBU7YwN8vS38L+sOeFiW9UNKW1KRX+v4RTniPxWD0c31p\npv2hlaUu8+HfyouoXrz7h4c9T68xFSeZ1pvZOmX9AmnxkJqVJunwoYRRmGtd\nejp8a4lWb0/FC2Gynu2ThES3O65ObfDN+cTIMdEOw8bizQIGpgFwzZNicQzO\nw7P95Nxdwth8ZdB5HOSsS/xVY9fIpGQaPv84C5VxF8j1bBJiY7xP7b3WDYjM\nAeyYhvHlN+r05fDKiMKjq/5+YPtYopQX9wtO2be9Qvv5mVWPVnq5YtSV+CN8\ngtX003riXolLnFar0SMftec3EjhS8M3cem12d2LXPFPAmfN7bPkWUkwkmb5Z\n5XrrTcGFcsKsAyMJAi3f01FBaR5vlS/rzKGL4boOIghgPasClp61VBsB7sUq\n1qELNdWk619N0uvp5BPToHbABVZsgN+XH4Y3HGTI2FSzljKWN6dzGzkRvzIU\nNDCUaxOBpADcUglsMYbckGwM+a8Gi/nhYPUjd/L5EAsHaYu7uUc2Dva1a2CX\nHGlDHW6eDc8z+IKtVOhSW6BL1jKSP39eHigOxfWewlTJMvbatZFeIpJyUF6f\nEDAIAVQuz+IAM2mtM1OQ7x5auvG8uxnJUIfHt151dH+x2lvgXp3Pht5ZeEtB\nGAlY\r\n=fT81\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b48f791b92804fe77eeba96f057b1baa89c48e3f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"8.0.0-canary.bd6e302a4.0","@material/rtl":"8.0.0-canary.bd6e302a4.0","@material/base":"8.0.0-canary.bd6e302a4.0","@material/shape":"8.0.0-canary.bd6e302a4.0","@material/theme":"8.0.0-canary.bd6e302a4.0","@material/animation":"8.0.0-canary.bd6e302a4.0","@material/typography":"8.0.0-canary.bd6e302a4.0","@material/feature-targeting":"8.0.0-canary.bd6e302a4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0-canary.bd6e302a4.0_1604336756216_0.7068853796658086","host":"s3://npm-registry-packages"}},"9.0.0-canary.d6b5cd418.0":{"name":"@material/tooltip","version":"9.0.0-canary.d6b5cd418.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.d6b5cd418.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8288460fe915177fe95a85e65989765b0c0434ab","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.d6b5cd418.0.tgz","fileCount":46,"integrity":"sha512-dbMEddqBWgAOmymENbPOM2radBNs+KTkgJ95JOqpKZQj/ObT75bLVOg26uzuLmTSC66shXivq0Fu7y0u4q7pbg==","signatures":[{"sig":"MEUCIH6pz6SYqKt0t+H2J6u8ZATazpjGKESoYuvOYjbIOrIPAiEA+vix3q2AWh82HGNxvEwqJTBonhdgfjC+T14DsrxZEek=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoI+JCRA9TVsSAnZWagAAr2MP/31bgYiQFTBNkWM2gXBD\n6Ec8KD4Pe6IrjIzQPpeqaxBhAeB2AFUFYcwAzDx0aWSCJaVbW9v0ZVOME3B3\nJVDh+n0IvRy4ct1i52QmPB7WB5s8cwYmsvLdpgc2XBpVZHYU8oOrgVJBQyVo\n1eb//xZ0NlkeoPAHkuX/Cf/J0i3ZJfjeVOjEKRmdtdzgo/YRdad0KITyG7Wl\nC02TlWxmorEyJS+kMeOzx65/hcqYbol/Ye1xmwMUzsAFmfGvLDvdmVNNfQM7\n267V+Sg/+cnKD2f3yWJKDJ7yZv93UzxffgHfa+OH4rjNXyFPv7auqrwiSa4k\n08Pu97DymR4wRpbvBAu0tb2AAmShwnofP/NQVPsfvvHapMCCNNbQpbQSunVM\npTqQgCcG2q9lS8YmIAnCaZMbxpyQRfhZs6Evm5BXdo4otfS20nOP9JO6aOP1\nn5KNtrf01R0l0DWeFcZc/zEqk1rHNOQs7GuKGpLUh9Thjj2l4qixVql7vEbD\nYWtGSa5dWK/Vqhmij6UAUXAbDBVrtK3BrbN0AxPkgsoHpRtRB9qy9aG3Vln6\nzNJIMXdwqqZOWwc0hjLn6YHyiHuP+qGiEwLNyXZ62Y1oYctzDtHFT4UqBf+S\nPdLPL5KkazPqGJLT9TRfhDhgQJMqeL5IEk7UYSdPKmnse+3V58QwoC8sNokc\n3ghg\r\n=WpTA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4fd5e4f9dda92417995fcc822b1d02016642b511","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.d6b5cd418.0","@material/rtl":"9.0.0-canary.d6b5cd418.0","@material/base":"9.0.0-canary.d6b5cd418.0","@material/shape":"9.0.0-canary.d6b5cd418.0","@material/theme":"9.0.0-canary.d6b5cd418.0","@material/animation":"9.0.0-canary.d6b5cd418.0","@material/typography":"9.0.0-canary.d6b5cd418.0","@material/feature-targeting":"9.0.0-canary.d6b5cd418.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.d6b5cd418.0_1604358024614_0.9721540553748584","host":"s3://npm-registry-packages"}},"8.0.0":{"name":"@material/tooltip","version":"8.0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@8.0.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"41c0d25051e201ffbc89b5de12fc347382285847","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-8.0.0.tgz","fileCount":45,"integrity":"sha512-z0SgL6CWp59V2AnTLbmfzxKCXIo/fWQejiu6FNFnovjX9BMiQNoWd+BsNFdxZb8PZhSuTwToVG1CSHHKGrLLdw==","signatures":[{"sig":"MEYCIQCQ/pC0w8s18yXNlB8A/yeQ0U4jpgwjfF2w8nKjaehJjgIhAM9DHY6IvJ+FMZXmlGXIHzqyDTm1jjp/2hHUwTzorlFC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":437549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoI+bCRA9TVsSAnZWagAATPkP/iTZm2P/6/MmYAdWhG9W\nAkomDp9DtRfO+x+/Y9ZFahwkvF9werpzloP9hK0BN2Jm2sisj+351fs1CAor\n2rYYDeW1rwi59I7x8/wpMMSqEqOGJywMPAIIY7UcGGyPwjewdb+bYZxpz79g\njcMcW1nqDdN5cOCWm7DK6PiPglXGfuoL0sCwmYiwK2uiEBmvWGXrAhYpCNi9\nQycz7cALHFBW4+/gbjiNdHgvhn8Jz4EmgVZTpOQ2ASbpKXOMCrpktVPsT58f\n0wZtG5POHoSQJ35JlfNxgXVfONk+eFPdsJ5KeQ9pFEvtwoarhct7W/F1RBp+\nE6u/J/GCKq4e8g1Ms4rQlgrSPN+XZwR2pyG+zEyMLczEp8TRX3LY0vCwXQBR\n60pWiX6gYt61RIExeWCG83BeDXrA4UaURxDYZj+zaRk0o6Zl1ow8gUR0KsJj\nXJfu6lS6f3xWOL9TxkxcVd+qY1ar32EiHMElNmD5HuB3Qut2IRkuRy+XklmZ\nFBuPzX8SsFwgIXjstZyXULQtw9lzJkk9RQbrdCREQiE1RMwaQtF6THeqj1fA\nBR+dyGP/SdZz0X1SNp6mhz8SSsZ04Wfb/MsQU2rpSiOoAwOa8ck8golS4PDd\nJ42/X2PXF1JAU67CsxCktWhpYvbAROEwRjn2fWSL5NLi9ngiSk99Cs8rvPIp\nWBSD\r\n=8OKB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","gitHead":"d6b5cd4181d0bf11b598b5ca142343fbc87976b9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"^8.0.0","@material/rtl":"^8.0.0","@material/base":"^8.0.0","@material/shape":"^8.0.0","@material/theme":"^8.0.0","@material/animation":"^8.0.0","@material/typography":"^8.0.0","@material/feature-targeting":"^8.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tooltip_8.0.0_1604358042739_0.5761736334642373","host":"s3://npm-registry-packages"}},"9.0.0-canary.fdf9a2634.0":{"name":"@material/tooltip","version":"9.0.0-canary.fdf9a2634.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.fdf9a2634.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8f4b3a5f7a28baf22e31c1137cd85e8e944f57e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.fdf9a2634.0.tgz","fileCount":46,"integrity":"sha512-12QNb2s7lFgrLMSIYcoJ3If5dKwPZHythUVYcl+Z5NFWnXB9lkv6TfGlr5ePXzsNfajvC9t21DgUocHzww+eFg==","signatures":[{"sig":"MEUCIQC2MnuRm4S9PCY6mGBiDIjuNVzH5MNcchDJEyMswsgOXQIgGds1UgnnZFGML7egy5ALLhYwrOwr+4XLDBszoneINPQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoeY2CRA9TVsSAnZWagAAwdYQAJOCGnEWzi5apIxTkepU\nkFAwHZE7p+WJBgViVdiE2BLvAuAdPq6OC54NR8L6yXN+ePXH/zczDKbanPKO\nLg0CirZk98B1Tp/M/xhAyMGHhN3yH546MbjfcqGWEv5w0yw2R6fm2N8f47+U\nlWECk54n6zj0vMDd1nptiRlCfjF4TTIKOr8ukQDPu06bH7ry6K8ShDG5W5Z7\n2/3alC9LZ0y8eFrpuvd3lBaxzZEimwfs4w363Q24IWgR2nvNVUZjTB8ze6iM\nz69wYCaChR0YJRetdJVqkkDxapHpeA7n/GDli6LuJETR+VG3DoFcVmaDVfoo\nL20D5hafKz/94bnPs/OzhjB3k0ItiezlTCzdK83n1mxkY56+Mg19+uikRnWv\nReyFfrKy6CKOQkQthkaql7LCD1TVIxIyPFs2szTuu1UiLVnfTcPQ4KP/IFJw\nYBCW0pfAYv1+V2iD1QHGlgf+/J1w2QSa3XHYWGXnDWrfNcBFoCyW3Nlxe5cx\no4++YXsmhgelI8nhTxHNUTlxd+RoQpgJh47EgCv6RD5E6vqY9/f0VFpzLzNp\naR3zN0uJn4hUQ0U5AqCfN7BdD+YHvEjobH28GyF/ZRLakdxjI4bnPTTruKPf\n/eJoAHxnryqUkvPaUQJ6TVXHTnJgO1FEbGeQ3KBUjMNQ+Q9S8rYugc88g7vs\ntuV/\r\n=ljzh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7d38b3b1a677a24d709697b68fb697f1367fb5d0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fdf9a2634.0","@material/rtl":"9.0.0-canary.fdf9a2634.0","@material/base":"9.0.0-canary.fdf9a2634.0","@material/shape":"9.0.0-canary.fdf9a2634.0","@material/theme":"9.0.0-canary.fdf9a2634.0","@material/animation":"9.0.0-canary.fdf9a2634.0","@material/typography":"9.0.0-canary.fdf9a2634.0","@material/feature-targeting":"9.0.0-canary.fdf9a2634.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.fdf9a2634.0_1604445750122_0.5273232844452724","host":"s3://npm-registry-packages"}},"9.0.0-canary.4a86f30a0.0":{"name":"@material/tooltip","version":"9.0.0-canary.4a86f30a0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.4a86f30a0.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"83c3d46783d452d711577a4391b6feebc5ab867f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.4a86f30a0.0.tgz","fileCount":46,"integrity":"sha512-n+BGhffriVQj3l27Sx+Y99dlfhnC0AJ/Pm+3wVYKrKYmhSpYzwz4PmqR5HPzxuVAAdCMYniapeGVX3gRGsE4wA==","signatures":[{"sig":"MEUCIQCuJSWdxHCFwksQsYbPVrdjpqt5/cpS0hLJ1Ui0P4KWcQIgciOl0GtdyyPj4Vu51rSnznR+BghS4DoYlOp2UPybnGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoefICRA9TVsSAnZWagAAvjQP/02tNz1OuS3e8EadA4Uh\nNSej8uAiYCWnp49bM5J9QF5Oij4D+AhaugeHCahTL8sr1lo5sztqsH8RLkAA\n16V0n7LmcPAYJehO+7vN9+wmibdOoiVsi6uGaWaEXQ65VqtHEuxvf3m4W3Qw\ncdz5eqsg0wy1QQfEa0D1N1FNJoVarQFPBH6bf09rSae974lG1pGdgsVURY77\n9hW5tXDVBZjAjRiOmaenouliRpfYohbkfbXo8EMmly9hUBXMvvx0Ri6GSSQa\n47Ali8jkspdfZAvzGpOM+l+CA7lL7CpIPxTch1I4aIzO80qo2m0xc692ztAe\nVjxj9lOziWKNwEgvjheCbiUBURRNIv7k4Sh6caOmV1IKjUglB2sIj2bW8nfL\nNnpobOiFjp70byyJYTb5yuuAq+oUpmZjZcNX9ZQdNRZy3eaklB9WrqSjre1t\naTyVEaR44zNQlHxpv/iKwBr4cn2N463wrW1+VoIOJjTKY8xqqTvexo+oZf8S\ntDlTlzhc/NA2gfFkxI757DsFRFB+WP3ZaRl91khGEQFMWeoX9RcqPDmx+87Z\n6uJh/kZUFXK7ap1CAVSZVHodPontxlOihEN3h/lisCaqGphlGlqZa2gFiSB9\nQQ7dnRkL+43rQ2nsnXJiQVxc8oYYn6p5SxlXgF2eEFFJUZ6LNp8t1PuYMBId\n2sEk\r\n=kbjV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ae1cc15cda11f90ef629a1f536e69a9648db906a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4a86f30a0.0","@material/rtl":"9.0.0-canary.4a86f30a0.0","@material/base":"9.0.0-canary.4a86f30a0.0","@material/shape":"9.0.0-canary.4a86f30a0.0","@material/theme":"9.0.0-canary.4a86f30a0.0","@material/animation":"9.0.0-canary.4a86f30a0.0","@material/typography":"9.0.0-canary.4a86f30a0.0","@material/feature-targeting":"9.0.0-canary.4a86f30a0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.4a86f30a0.0_1604446152471_0.5373779371904597","host":"s3://npm-registry-packages"}},"9.0.0-canary.fc8b045f1.0":{"name":"@material/tooltip","version":"9.0.0-canary.fc8b045f1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.fc8b045f1.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a7ada23b826ec35e5e192be093f3a61f524d5df2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.fc8b045f1.0.tgz","fileCount":46,"integrity":"sha512-fQ6+bSuM2+93ls02oqC0uLq1lfiRLeVsvAKUGWTt4arERsCxbZxuMWZiwHhr1Jjw49Azh1XR11isy/W1tINrBg==","signatures":[{"sig":"MEYCIQCIFGNiYPBpoIZMaoVEIVwdp7zlxX9dk9WZRk4mKFWWnwIhAL7iorm5rhL3f0KI0TMFxsaEyPquSStlBwXfFYZOk4mT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoengCRA9TVsSAnZWagAAsm4P/iUrqcmaMTf6gfxTZE1A\n0BVNbYfXWhgtleAGbrzkZDtuIArqOFVuTjlhASJ0p2XX1Nn7gE3COqPITmUS\nTmjkO9N3N85Pdcxx/2k4meqSru15nybphmNSehuqcCgsCXhH3p/HIKUVInqR\n4PB0QALLj0VJtJeCZhgCkuLEE2j22EUnPxiNezmgJcOEb6PapemACAp5SnzK\nOS4vQCV3cuHDP1Xf1SXk61Cwc48YRTS0CHYCg0VEknrbMdEgE3HPtuoRHnRZ\nzFplNZlMRdOZyh0j0ascbmtR5+m666MipZOrxwkdypgX5ZP9sItAU2LJobf7\nlfWUwu0S5H+CVMz4I/1w5BwttO8CVMkBj/vw6yY8PAhVg36ABxozXrebDXjn\nqUePJeB6SFxqecJ7pSHBkDZtvqwGijDGzrJC9ObFRA/Q6Pg263nTdK0g4YDy\nGwB2PNYPTbQfxRjSvZAdXHC2i60OUHsvfS7fyfSs6hRbtWRj7gfZGy3H7xvX\n8tBxZ4JK27Lce9RZxRuwNIZ+n1iurumlvF9kalH+WKJRjSLV9kXGYuE2U0uD\nMySbTvDGNPMS72bDPNXmLpYxk6JSbXZ2tjN98LnBzADOs6YkkrAdsaU1jqSr\nfEuoh2UO2l17wz4QrNmWjvWwnettYpLnEW2DkiDhsskOhKNTXiCRL+J1187m\n0/ju\r\n=c1p8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7df7659dcee84f0af6a1e7d8617abb4056acceb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fc8b045f1.0","@material/rtl":"9.0.0-canary.fc8b045f1.0","@material/base":"9.0.0-canary.fc8b045f1.0","@material/shape":"9.0.0-canary.fc8b045f1.0","@material/theme":"9.0.0-canary.fc8b045f1.0","@material/animation":"9.0.0-canary.fc8b045f1.0","@material/typography":"9.0.0-canary.fc8b045f1.0","@material/feature-targeting":"9.0.0-canary.fc8b045f1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.fc8b045f1.0_1604446688441_0.23028342037991134","host":"s3://npm-registry-packages"}},"9.0.0-canary.a0b2db26b.0":{"name":"@material/tooltip","version":"9.0.0-canary.a0b2db26b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.a0b2db26b.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b65db1ef9fc0dd9ae63e4bdd0e4350ce268aa7f9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.a0b2db26b.0.tgz","fileCount":46,"integrity":"sha512-tYaTYrOkIB6R6vDouFZhF/3b0OXlhke8gVxcOXfLL+LGSX6twTTs4JAMN5XfwgUKmQn1eX4GMayZieh2ecV+WQ==","signatures":[{"sig":"MEUCIFTk0ogQzP4KhfNH1Bh2zE5kpHU7Jttv/3+WWO6G81egAiEAhLA7SEElUg9RUYDxyOJYRkEooVKPlj4dVUjRVgQyyHI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfofFxCRA9TVsSAnZWagAAM7wP/RwTvmmUpDGPIeMhyseZ\nYnPBEsEqlIlfdpx2oPey/u26XGxBl82KLJdTbR5MMoQ7cyWzhSc6W8GmGhXx\nbdcho0CvMuAs+ohG/LNIG1QQEuW/IFus45b6UPOtG/m4NOsxRL342tsPz76z\nC8d7jPFyh2Kddk7KYIWLvSW/QorrvYtOqZvxsnMWMndmhElnNJs9zG0feBi7\n1zN6dAoCUwqA+zT3OJG9VxqYKgMf9+kh6Md7uJmlVZB4BAzs2RINTfxKD8O9\n3YkA/ovwhWD9RhCtBOkIUhSvc0zUDUyozg/9wsIs5Dv4uJtJLT2MthRI9/lP\nn/b/41slC+0TySd8dJHoMKqPAtRA9wt02tKUqN46zjG94XLH8sn9rAX8uF+9\nXrx8XxyLz3i4Jgimy4HEP2Mu/4X2OLtDisnRVeok9uMiQYHTMXk4bQZ65A4K\n+l9hF10C2p6HK0cSUYDo4MRVGQjKudmuyubQznc61EyDZDxmkdNS3n5+t/Eh\nPBVBlmJHWrGQVzMdzdECxgmjI757WAE0bz03Ph5llRtBO6Z6OAhAt3rxtfem\n8bMnXHVcRcf8+OBD2ZufBhYcwEX05oy6WBtB8Ig5qVfZJRUdLvSAM/tZC4mi\nSV4kjZODi0iU7EyjhgUT9Qg8p6M90+oqWGFjmbh4vh5I3rnLNx1pUcIoTc0b\nNfGT\r\n=S/1i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"885abc8ece3b0c3cab58996fab25be733f65b5c2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.a0b2db26b.0","@material/rtl":"9.0.0-canary.a0b2db26b.0","@material/base":"9.0.0-canary.a0b2db26b.0","@material/shape":"9.0.0-canary.a0b2db26b.0","@material/theme":"9.0.0-canary.a0b2db26b.0","@material/animation":"9.0.0-canary.a0b2db26b.0","@material/typography":"9.0.0-canary.a0b2db26b.0","@material/feature-targeting":"9.0.0-canary.a0b2db26b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.a0b2db26b.0_1604448624824_0.7786647587044073","host":"s3://npm-registry-packages"}},"9.0.0-canary.419e03572.0":{"name":"@material/tooltip","version":"9.0.0-canary.419e03572.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.419e03572.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de82ecb868ddbaaf33ae3eace09c92881b272c43","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.419e03572.0.tgz","fileCount":46,"integrity":"sha512-Q5aqSTG3OunalBSwAvpnmj29LKIssOXQwFsi9ZbPe6xpERDEBasAAu/6DzUEwoxb1llVEL/ErU7OwPi2NTvwIw==","signatures":[{"sig":"MEUCIBJPYcNWgZexA1SF7MMvTi1o5vgvzGtz7gGOG/P8+d3bAiEAsH79120bsLKVvEhH4RuFDdaCz1j4EX/UjEYnUyAeNfg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfogUKCRA9TVsSAnZWagAASXIP/iZOwtDsui05aehfJQGX\n2KzDHA0UuC8LSLk5wrUJQByKz4SWWc3tgEfenYv9cFTo5pNpXjyTZJ3jK9pc\niNhjLTTDeK8be2xOYAJZ51kg9Vk7KPoFAcXKohnOshGOLUnskuWP8enn3v7H\nSFOvNlcNc7plxizBL6KWQ6PYwISOV39mSTU745JHIC0Y2JSrY7wYs6DJfr9/\nq4k6Te4fuca9CTqHTLNrHisjgVCPuW43s7Y5Dq8tqRPbo9Xvyt0oY+PdqELH\nRcM3V1B8yThAUNps2bcwVy6BhTlPKVcjcdQODJUCm2FnJyrDvNryuwqYxNym\nh1NSbHaUT9fLOBp2+XOr5sBv7v4a17/otuMlfH/T+t199XDR+H6xiAg0Qilx\nvvA82/QFlGjhvfwxWFvSeJaobc8jklXqkyo+GkBRhVPXBb6EIkJjKSMEF3nt\nDwW05X4QveSbN76xa5JNwekqLzTcvtOd+/7IqgXvvVH+WnFc/bexfgcbwdi9\nVP9GNHyWB70cQe5IznwJo8fLA4myBJ+NvnDipZuKMK9d9AzHxBlla3RtZtnr\npCw77L2eCPaiEEYpJyZu2T2l9ifFB6N7TtcJxMzGAyvHZCxbCfD7CzSVoyBS\nalaGhk6pdL7AIQlA3fJaetzEJ5ZOv6Cb4oMXXijTLZDgKlNCb2A3eRVyTk4R\nxaVa\r\n=9h3D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c9528e0a61f88c4fa2a5bcc6a5e406ccf027d7d4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.22.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.22.1","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.419e03572.0","@material/rtl":"9.0.0-canary.419e03572.0","@material/base":"9.0.0-canary.419e03572.0","@material/shape":"9.0.0-canary.419e03572.0","@material/theme":"9.0.0-canary.419e03572.0","@material/animation":"9.0.0-canary.419e03572.0","@material/typography":"9.0.0-canary.419e03572.0","@material/feature-targeting":"9.0.0-canary.419e03572.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.419e03572.0_1604453642544_0.17622236276891212","host":"s3://npm-registry-packages"}},"9.0.0-canary.a432ad542.0":{"name":"@material/tooltip","version":"9.0.0-canary.a432ad542.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.a432ad542.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ae27105bf2429d4079d0e8c197584023505868b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.a432ad542.0.tgz","fileCount":46,"integrity":"sha512-KsmbLIH9KpaK0h1CvdOh0oMPXoDivsA+F4iMpVvyU0XS82JqfHo2xrmGe79cxYls3UUb0Od86ubOZOZItDKJsw==","signatures":[{"sig":"MEYCIQCN7dtsKX+QFjtPIhkWtfXAJOzac2LjUoT7I+eYAmLP4QIhAPPOCjfbPsJ2DwCX7TQOtRvimEunFEgF3pcn3LpB8xyi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpKsJCRA9TVsSAnZWagAAmxcQAJALhcJifuPRVeI8tpeU\nKn114cWVF3A7ayLGjW5kKJFbhxG7ryejwr2qFaxRpVR+GlxT5+LSRv0CuWjM\nOHqN0pQ23eeazca7rPVpOso5aDbwSXa2n3MByNwlHnZrhTNAfVuzGF8RaOlW\nz4HRrPKssAw5nY8bC+/3fyBINJxD3YhOjVto3F+mu39RYZyN8kcfx3B4GQNd\nyivhoG/Wrbc41V84MRWrkr1w8P3JGXQjt6NoSoR8Flr+tETzDwmr/TK6fNLQ\n/qMURnonpsew2vonKrPWknOe6DRCe8nQo3vRio1kfKwx4M9Thzs8Z1Nl/QBs\n8zBw+SIxr6Hjj2mQ6c5cdeBcVerfsaLDAXnPBmNDhg1PovLvwosovbBZbYAK\nNqeMok3QyPx65pbvvpr7xwbIBpnY4YBmHjeK+CotOkytZrDtTU8qHLzrSAwZ\nmUUr67dqg0lD+Ig+0bnp6HdHoPMX8JgaYTe6ivA1RrlWctPIx8OzRypGXzEM\nID9HjQjgTLWbYcBzE1g/vT5ENbjPpQqN5LY4FS5IDZ3sFWb5IY8SMQTEo5s9\n06bK7rNz+GOhYXj3KP0T1IQdZ+EvviK55U4rSfGz30xw9rV2WzsTX67H/rl7\nPh0zqdX+L+9hp4H2K6y8rREs84Ay/MN7PT61GCR8lQdtJwO5oy0v/5b5M0Yf\nuR5e\r\n=x+1w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b873a7878b871d2ced45e7f04055b3d4ef0c7af1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.a432ad542.0","@material/rtl":"9.0.0-canary.a432ad542.0","@material/base":"9.0.0-canary.a432ad542.0","@material/shape":"9.0.0-canary.a432ad542.0","@material/theme":"9.0.0-canary.a432ad542.0","@material/animation":"9.0.0-canary.a432ad542.0","@material/typography":"9.0.0-canary.a432ad542.0","@material/feature-targeting":"9.0.0-canary.a432ad542.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.a432ad542.0_1604627209162_0.791040974004537","host":"s3://npm-registry-packages"}},"9.0.0-canary.e2e8aef1e.0":{"name":"@material/tooltip","version":"9.0.0-canary.e2e8aef1e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.e2e8aef1e.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f1ba7a2a6ebba017221f4d8882ec4a730fe36ea7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.e2e8aef1e.0.tgz","fileCount":46,"integrity":"sha512-52WFSGdw1dx6LfaR3jGVyCEjTyjV2R5FJ78zjPwJb8ibvXZ5A8BoJltACtwEEjBbFgNZrazWwzzFvWoldtqmCw==","signatures":[{"sig":"MEYCIQCsh4sKm98r3bOo4IXFXAEtcYWW6tY4Ur+QhrCJEAgm0QIhANoCDPXtpdjaUZlG5vqhHkcp+ExIDQCrHpEElCuBEOii","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpK+YCRA9TVsSAnZWagAA2YkQAKCdMa4OygOM61KXOVJR\nqo2wX4RkjEeNriyCjREmH7gWKhDGpvWAZO8xAq6jZAustVaSjDl3RnQaya8F\nOuUgoRGR864FL/LstTkcUBGoNzfxL3waC/3uAw6krn9dPTXx/mgImTa+nIsQ\nz9J9hKovAmNghnlVMy5SEPyH/krDxJ6FMOhm6f502RO+bcxG5zzefG7HrbWm\nMMNUOBs0qoTcNBars4w1OHqmhtpcqROdgi7hbm3TWjbGvCeNZP8t52eMnXAO\nmWkAXY4p6A4A3q7dRVxi/z2HpSFI6xY9aX583xKfU21fQME6CqNCFAsP6pWI\nD6Fcq7cXXGaxd3Zi+QfgKBMu2sbv8nCmVhWFDzj7gDos15nkujlkUGNEnKDS\nsB5zsp7inCRuZ3Pe0Z7+mfIi2HzgW76sUrIeSyWKe3yIp2dQDyTOy/hlofOw\nOkLGTItFMrN3w82DAGyDWniPtUR+JHWp+UgpLAij2nJS+NiNZyZ4r6xiJ7E5\n+yJdh4E/86szG8PePav+rDJoonQ99SrD0EBehD8mHO6KNvLp3OU6KIqM6haq\nnxJQQIBNbWPd8pBC315uPvK7F75ZYclY/Bq3B191HLQ5WAmPaATPlFboN9J7\nDbe9o+Bo54H2Utt0WSkUIgNaTOp14yYOB63nO6kyayJ+q38TIVqsndr7x+Cb\nnpS6\r\n=aUk3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Content\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"59b208be2f946b47ab6905d82c0135e81316f2a3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.e2e8aef1e.0","@material/rtl":"9.0.0-canary.e2e8aef1e.0","@material/base":"9.0.0-canary.e2e8aef1e.0","@material/shape":"9.0.0-canary.e2e8aef1e.0","@material/theme":"9.0.0-canary.e2e8aef1e.0","@material/animation":"9.0.0-canary.e2e8aef1e.0","@material/typography":"9.0.0-canary.e2e8aef1e.0","@material/feature-targeting":"9.0.0-canary.e2e8aef1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.e2e8aef1e.0_1604628376364_0.02086682734471168","host":"s3://npm-registry-packages"}},"9.0.0-canary.ec6b68b34.0":{"name":"@material/tooltip","version":"9.0.0-canary.ec6b68b34.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.ec6b68b34.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a0bc312d511bca9894d9ee140f11be58cd0069b2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.ec6b68b34.0.tgz","fileCount":46,"integrity":"sha512-RJxkZvnRNF+ru1kbM21bQA9WhP7EE8G+QFFoGkJJWhe10ekvPUFRtnN9fRG6wrHsNI+dHvsx2JlxLX6Q9oIXCw==","signatures":[{"sig":"MEUCIC1T1NbliBJKMVfuT6q2oX59YiUZM1Pj5A7YKrw4w5/1AiEA1YAxpNYM7BBVh5IXO2THqzXNcHFUtR8bb7kMwkYkyTg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpZyiCRA9TVsSAnZWagAAYi8P/RRC1RWlEh1E9Z+oHEep\n8Y9BNGwgpHTQhZF0W3weZZgnOMTcY/mZPpTpxxHE0pjPbaFxWZ+stkXNZ2/V\nPIFAMhlaIasmV+cPycMVukXieis9OfoqkCsSmvzNx4iVGjNqAy64WIh21M5N\nHCFb/K8Wl+aWhj/sYuudI5UtkG9stVLUCXwz2aKRNJQFplMjy9oz9XKl8UGR\nxqxMShbvUtN6PzQ6k52Pji0h6Srz7ucLbVg5ZJEa9QnQtJn/TubOIwAr1zmg\nXSTwkUAvGnXs4mxGEloqeWMkPdvEf8eL1otyJULM8ibMHeUYGqCtGLnj3cFt\nJlrLCORMxCGGkH1cGF8rQ5soMmmRcqa5ORRjFi5NxhncglPS2606nB660OL9\nSkCfCrziXb74C3qwRLrjZ/a9yTkg7uIMS6D0JLdpVdGPK/Pt5WSTDOxPKpaf\nQZ7E/DAOnxh2fthDxtRhNlyWg8S7sCOSJ69OhlRbEGcuSNTKQa+cMaUui4cL\nc3LkXUotVnToea6gQa8fNDSQ74ZdXuN9dmKAugIvGRiN1JbeMvbabNBvTv1N\nOQ0W+O0xpI0Ra1IF4rqhj3wZxeZpbIbYLSvlcpI7cZivqYP0wX16EvBxGFR6\n8FbDQLdlshnKJpY2toCUJlNiYwxSwHHSRMOeXkWOv4sb9JQW2e5B6kJjJTY4\nVB0b\r\n=Gpkx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a5005840630991931dd5d6aed79aa4986773a5a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.ec6b68b34.0","@material/rtl":"9.0.0-canary.ec6b68b34.0","@material/base":"9.0.0-canary.ec6b68b34.0","@material/shape":"9.0.0-canary.ec6b68b34.0","@material/theme":"9.0.0-canary.ec6b68b34.0","@material/animation":"9.0.0-canary.ec6b68b34.0","@material/typography":"9.0.0-canary.ec6b68b34.0","@material/feature-targeting":"9.0.0-canary.ec6b68b34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.ec6b68b34.0_1604689058453_0.627098792376942","host":"s3://npm-registry-packages"}},"9.0.0-canary.b39094d14.0":{"name":"@material/tooltip","version":"9.0.0-canary.b39094d14.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.b39094d14.0","maintainers":[{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@google.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eb086c99198f2d21777692edeb8fbb3e69f4ac0d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.b39094d14.0.tgz","fileCount":46,"integrity":"sha512-mW+ikYlaHJQoGuBuPe1sFgAdKksIO2ze5ZcfvyRFZIZANPqwZ4LVgTL/oFJbAQG0xD5s5OVIYmMYqkTs26+wjA==","signatures":[{"sig":"MEYCIQC16Lu7tEFFnM3MHubze7pu2pqFl/p8D6bSTG1ATUbBoQIhAO7YdPsgSHzsAx1EAa6N/6psZKBj7gZAtgu2E+h1DUa2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpb1PCRA9TVsSAnZWagAAOB4P/3HUZNZj82SNZMZLZozQ\nQ+OB/L3+sdqUakmcZFk86Pk1KZpjjixpV4okg0WmzpLAdnFh+retBGHAoYPn\nIIUgm8NEh6qq3A8/F50OJTOwebvBxExWFsNhpwEpDGW+hQLO1rwPiOCpEZGO\np1mzjeh8chcP0JWEmf4+d71YjtYJFJh27HHZ+3gGy1SBQBhUJTD9Syp3bIX8\nx+7tZ7C3hKEdG+NKrXWwbEx2zWMvmq9qhjFGL/gA9tGN35FfQHHpw4giCX47\n6xUNTv84XXwe+/zq8X+h+3gvEo3leiaLTmNdy/5e4EPA6Ii5sALZgn2i8QN8\nBOYkk10E6S+ioFMfJdjgu+eOB+N6jGOHegOWxXtE+Y45C8pp97vu4s7SPAEo\n4kJmW08//8C0LLp8x6mihHieM5Z284ij+/AvjVYTuOWTeDOq80s/OBv7JWfR\nW+oNNCFeDmsfD2N5F2lRuNRoeaQWCry0Sb+aJtiX6XDMYXGbQxhdBKV1qBZI\nQRtvC8R/dwPZ7ySXu9/u/6+QWYrhbBxicnbLBEOY4gI0H9b9IevZeIgm903R\nH67GlShfF9K3QQv93Xjc2DjOSywsqHHrQOQJ4NN+TDELgI2OpGvItBuKFfYV\nQ0/laWwDNnxn/Igi5shRbJDt8R47oYmjA9xChh/Nj7nrazOwJFDnV0aY7mII\nFHd7\r\n=Fk1R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f8c5ef7d8cee2d0a63421ee4afe42e4e9260cd47","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b39094d14.0","@material/rtl":"9.0.0-canary.b39094d14.0","@material/base":"9.0.0-canary.b39094d14.0","@material/shape":"9.0.0-canary.b39094d14.0","@material/theme":"9.0.0-canary.b39094d14.0","@material/animation":"9.0.0-canary.b39094d14.0","@material/typography":"9.0.0-canary.b39094d14.0","@material/feature-targeting":"9.0.0-canary.b39094d14.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.b39094d14.0_1604697423458_0.46153415110822227","host":"s3://npm-registry-packages"}},"9.0.0-canary.8648b8258.0":{"name":"@material/tooltip","version":"9.0.0-canary.8648b8258.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.8648b8258.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1c285d59aafe90d7505453842baa163ae6447125","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.8648b8258.0.tgz","fileCount":46,"integrity":"sha512-FYY3QsvoLAP1YNk/EzydlyYGdo+kfsNOhByB8XGQN5s4CeFa+PZ04+qKwgxaLTtgpJldQMqCAEOjibrxyXrN/g==","signatures":[{"sig":"MEUCIE1f/V+y9Yom/RcZGhDQaadUzxyS8UvWM8mfyrVNUkp4AiEAgzsAxg8SBuqilj+NeWXAOEZX1cMf506OC4DRf2NduRY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrRJbCRA9TVsSAnZWagAAPecQAIG88BMloM8qNPc0NeNY\nqdvAqaJnTJOHPHWUkoLuI2P3UPuKx1HzEYqWNj8ZkRnAEQbgRxUzJ57dtJPt\nEycFNLEqlrD3fC9Tws76YSkAS6kA3iYfZ+r9gFlWMu5s5oBAuluu5wACtjOB\nzdoP+R5kZULUgYje1gR/vEVeNTSpvrksGSHWIExIFfWcJjq/0ifnzR5fRe2g\nknM5oHNwiBg9Zs9xwb7LlUxcCJTjfWJ6rfkUg6VexX8f2yCd+W2ejxQ0e25p\noOScsAngAZNEBE40BXv/rCq07YQuq06xhVJJ69RdbsGKI1dsD5RsP7IRT279\nHbIlut6JGz/KRBTaBrkA2ALr9imxRadUXXXatJxObHOCuwHdH94pxuS/5xcS\nK3Aqou/bb20NXWzSFg93xs6L7HU+2QY43CqYSCZJkHTH8OI4bjlTd/Grd/n2\nMT2Rar8H9GUWlob1arl8/IvStg+wrKaoEEG0vDqMCBxmjK99eXrRNfMynqx3\nlGlrTDjL/uTpIU1KLXU4m1yI5pWMJhrcnj8T5laKxysqJilRegTRm8W7gpoi\nenczjZHdx4WhY9KJ2BQ6ztBoOCv2hE5N/DfN4Iu+F9d1lW/j04aRS8fltAwl\nZx/7GKO0P/R1bt5jZKX2Ytop8+PnZ0qPIDQSg9T1sT+0TQ8eMHxbOqpe4XFO\n/Mqb\r\n=iVjK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d98de60dd3d91dc14a84abb664678188ae936030","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.8648b8258.0","@material/rtl":"9.0.0-canary.8648b8258.0","@material/base":"9.0.0-canary.8648b8258.0","@material/shape":"9.0.0-canary.8648b8258.0","@material/theme":"9.0.0-canary.8648b8258.0","@material/animation":"9.0.0-canary.8648b8258.0","@material/typography":"9.0.0-canary.8648b8258.0","@material/feature-targeting":"9.0.0-canary.8648b8258.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.8648b8258.0_1605177946821_0.13419047850258603","host":"s3://npm-registry-packages"}},"9.0.0-canary.240c5f74f.0":{"name":"@material/tooltip","version":"9.0.0-canary.240c5f74f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.240c5f74f.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b9981c82bb890010e5b0bbbef27e5ea1732d73b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.240c5f74f.0.tgz","fileCount":46,"integrity":"sha512-8FZHbkwPnTNjWaFnEp9tIEGfNynzIEwcye6FLI8jU1MDpfpmiSFMQ/VTB40XOoVoGemmqbs9D07eSmr1LnECww==","signatures":[{"sig":"MEUCIQDsQE5dnumoDaFQDGRsYmIsJvg6QL454kb4HVXbgg4yQgIgaXmRCtcrRqncL1e1FIQVeP78l82oUn0Hc5oB51Vrb+4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrZlkCRA9TVsSAnZWagAARGkP/3wT7jXH9knvWN/FFR8m\nhFoiyUUsvYWEUxlxHMqsfR/Ht0OLUYbIuHZnM9l+SNo94Zt9E4d32vFSGKz7\nqMH7wXm6uw5l20GSHadzqYoWpDWfQWHitwZXM3mwXw1KQhyqJmtAQjP5U2xA\nh1kyi27xs7XRjydixOeJfIcQFhJsmJHHEVXp6yl7P9oVDu973XRz/WgYLCvX\nBj7Uw0Qn9LjqJZEaDwfbo/DQKCyWfGTnA+FKkKFnepLovslato8ncOiEqan1\n2qVUdYbfPQrMS6i/vvWZgG9zhdLxzpZ1gcAAGifWEu4Dl17eETo6/nu3jqjh\nEg2QXsc1Nurj5TGs3KKK4ySzTydAw7YdbrWWhVvsbtKq+fgrOY/4A9n3vyn2\ntTw8VYAGdtUY+HQjd/NUxe41u6AhZuj5yH1k1LFeKOrqv+OBjfLhNnD4zMhP\n4CTB2rDgynNjnaZNG8hriCX1Ul3L2txrZwojqxdgUz9W2o/NUNTzAEuc2WVy\nHDHpsOgmrj8guPESdV1jRr7g3lzBzJdFvghZABaXid/r8BBvJeAZx6eOjYWJ\n+sdvsZ1PFMxKDP6Tv/5IeeWxsf46poyFe+Gbf+bJFtkKkljqRa7V7PenOFYn\nJ6e+uvTIMgF0DqJHhhU5dcpwDqyIhBqfO08Ys9L7bAPf7wj1gY8lAnk+5RPm\nYlAX\r\n=D9P4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"33b77622681b24909d892ec906f608e75f5e9809","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.240c5f74f.0","@material/rtl":"9.0.0-canary.240c5f74f.0","@material/base":"9.0.0-canary.240c5f74f.0","@material/shape":"9.0.0-canary.240c5f74f.0","@material/theme":"9.0.0-canary.240c5f74f.0","@material/animation":"9.0.0-canary.240c5f74f.0","@material/typography":"9.0.0-canary.240c5f74f.0","@material/feature-targeting":"9.0.0-canary.240c5f74f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.240c5f74f.0_1605212515516_0.8249387898610421","host":"s3://npm-registry-packages"}},"9.0.0-canary.6cf6ba4f4.0":{"name":"@material/tooltip","version":"9.0.0-canary.6cf6ba4f4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.6cf6ba4f4.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5667613fe7b45949d2b3199358316ea36be7ddd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.6cf6ba4f4.0.tgz","fileCount":46,"integrity":"sha512-ad40O10YA+qHFG7nLOXYicNZ7td8qr9Ufv+ymx1J/a2LR/eS+2UyfPzhWrCFVcJzDGi2zTeUClFyK8nEhQ7jCg==","signatures":[{"sig":"MEUCIQDOLFFPCRuxyv0pqcpeEw1lruLFJ6p2JG0umUlJfvidBAIgAwTzKG5acxurKJs/cgD55mBiMIM1IfAO0LOSbJzfRhk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfssoNCRA9TVsSAnZWagAA/U4P/3o9UqTq57tVESVf5WtH\n55JLv3qse7nV8YFxkt2dNejM4NpIVRI45XXfqPsrMYZxc9prn87ofWdN9APd\natq6sKr5Qsf0susW38mGP1oyBQ4vYJGunUR4YqKrDIWlbvzHXZQmrD9o7Ald\n8G8vcRDA84Z/ftC7T83X3u21lf43hZ9iwpJhnkkvcTQ7qWnD7DbjMbqrtHcP\niw/3JVmyZzaEJIUfEDWWZA05s5lDozNYCT1VebxYQMeG2YCqOv0CqS9kHwm6\nzaBSa5xMZq1+xknQ7NRubzHQ9Kiau0j/n/4+T/9JwkDBuPrUHWfj3TIH84Ba\n/VNufawpqHC2TGcv/CCvBXy2Y99GAO3CdhKmk2dTQ2NAPhSDwKP2tz69zH5x\nrhp3SPspbfEYVabCUn/lIWonwqQJDL1VsbpzbjrEqgpwlJqTyB8EhXgjssnR\nE5l98vR4RwtsCmChv5NHIHkWyyrQL5qRRei7kWZR9YSz/PXbzIG59GWW/qKK\n+Cy/VZgKf5KbYTTIWLFXzuu6+62NnAgWXsg3CivRnNV8FaIPBqucTAMFSB6s\nQ4UKpW45i9p4W51sttMC6JbE3Ybf/v/yOpEVvix1NhWFAs6/5njHp4uOlkyq\nnWFfoY9Y6Ir0NM+Xs/tzRY2W/xAUcSHKwuHajcmSnzcsAmE2mDOvj5pg/M3m\nUHAs\r\n=J7Wo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d2d4890ac5812ec797b5f621137f4e8a077c3c0c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.6cf6ba4f4.0","@material/rtl":"9.0.0-canary.6cf6ba4f4.0","@material/base":"9.0.0-canary.6cf6ba4f4.0","@material/shape":"9.0.0-canary.6cf6ba4f4.0","@material/theme":"9.0.0-canary.6cf6ba4f4.0","@material/animation":"9.0.0-canary.6cf6ba4f4.0","@material/typography":"9.0.0-canary.6cf6ba4f4.0","@material/feature-targeting":"9.0.0-canary.6cf6ba4f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.6cf6ba4f4.0_1605552653296_0.4711156355586159","host":"s3://npm-registry-packages"}},"9.0.0-canary.07f3e01b7.0":{"name":"@material/tooltip","version":"9.0.0-canary.07f3e01b7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.07f3e01b7.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fda6d7498d40592c8ce9496d738e540179fbe14c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.07f3e01b7.0.tgz","fileCount":46,"integrity":"sha512-ixz3nplOIvSC+5Uk+BbXZAV8n06Mf9TuXDxmtBkITo5QxUkU7D2zj+B4aI1NebeLxGG1p+5HhuX7qx/ksaU3fQ==","signatures":[{"sig":"MEYCIQCikjGC6S7gyU8Fd2g3S8lr/CZiYIq1Neft3LmEBassxQIhAJ/SmJgMfObNOoWxzpd+dq2hAtm4cMZ1Yr8UgmgzxV8/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsvNECRA9TVsSAnZWagAAElEP+wXAbIpNz7ayfs2VZW7/\n7UnTH96ycshcNb1Qz3WiORW6H5dvzL+01dC2YMheFbWc+jOnwjaf5/yQMZKy\nqQtf5dj2BMaI+bevLiymQzqhu99rRbrjqEx5M7BZ5D6adpwOHz4ZkJ03fvH8\n+IdMQd0cXxzaoUyPVIvZEsTCJENdkq52kPVGc/VlsvAiWWAl3a5kHFQt8wWn\ni1ajCsXefrgH9CxL01ZYpOMDFERRn7I/iCz2z4MdeV4KzEI9KDsDvSkObYlf\nEqGSl5060IjkNm3xALA6aGpFonJYU03+M8L7ItaynlAaGTFgJD0govd3Hb7R\nozn4mhKU6q0+jGZD1g6+ZrRI3WFnMJYoEMWgwnsCxnnuXQBnn+xoflb3Otyu\n5StaIkWRc4hSRB9NSutcn8fsTIr9qmo1AUciCX00s4OvMincMmzlsPAMVRt7\nU4TlLf+tPubIKEopC1zfgAzBfhXEFNlhFHxZs+JsYs55xFx5CaGeQcQ3vAgl\nW2CUyRhjsjbJ3cjVM0aaAhL7kpbrBa3Jv3NAz+DTLfoubJ4mhVGfwctobInb\nd9zYCEY6miSdGKeCtBE3sNQASJ+BSXwW2sllN5y2Wm2DLEvUrSVwHLd1gKDf\nJMp/TyCcrGsu/CaizPTiEtEX5JRlYqnCPPGSpOmlSVAOG4oQHN1yCveYTZUm\n2nU/\r\n=Jo5w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"39f1e043d0db0c6881d84b3d7b54423f64cc8c0b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.07f3e01b7.0","@material/rtl":"9.0.0-canary.07f3e01b7.0","@material/base":"9.0.0-canary.07f3e01b7.0","@material/shape":"9.0.0-canary.07f3e01b7.0","@material/theme":"9.0.0-canary.07f3e01b7.0","@material/animation":"9.0.0-canary.07f3e01b7.0","@material/typography":"9.0.0-canary.07f3e01b7.0","@material/feature-targeting":"9.0.0-canary.07f3e01b7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.07f3e01b7.0_1605563203679_0.012571020259707799","host":"s3://npm-registry-packages"}},"9.0.0-canary.23491cf85.0":{"name":"@material/tooltip","version":"9.0.0-canary.23491cf85.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.23491cf85.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"50448898c07917786d7d96713a938e18792a3b04","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.23491cf85.0.tgz","fileCount":46,"integrity":"sha512-aIWzic4xs5VXcBa0l81nt4oa84PFGvzaLLSh8Z/OtDqXLGe/hFVbUjVdATTH6IoT6NF16aeGYhkAvYebTjVEmA==","signatures":[{"sig":"MEUCIEEWaop5Sg6ZU5uMwRJDmuoblkU/i9cVTO+bA6z7UnFyAiEA2NOzAK2fAGdipOaqX+WJH6hI03KV08BVmpTM7QfP1bM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsxbECRA9TVsSAnZWagAAWEQP+wfbutMK0c3hwLIwH38y\n205v/doi39Rh5JExWDi+/JqKro4OZIv9xiGhj+NPmoVbEQaJCBDqDBYH+WTD\niED5PwDXhj1v7QCF0UE7B8MQMFCZlBoe1AcD9e0AlJ4HKNQIoVXDoy8tUIkz\nuUNPRUhlNcgHBIJHLq4qQP2ZU00rPnXc90GW9G2ffL7eGW2UiA5asbVnIl8V\ndpCqJSJfnIwU2QJOB4qYgeRGl4pEvulW5bIh0+dTBZQaqFtwigRxU29JQo93\ng4G0s/B4p/rdmHgVxGpkEm2h9RCIvgPogzRtNVt248EK70njR9ZOqcHUBUEK\ne1glHADRuDeIdMKLMND5/7U1jG+HlQzhmj8v/w9rU3eemz/E8+rST8oU/JKM\nTmV70uynUwuhxQctdflcYdJ2PR+GfOyba67kQITviIOUM/N36Hchs4OiwZRW\nUGRnpqjtp60muAF2gTyUqklrLWcwz18QlIOTtozKfjwNUW1PfEgtXlXtcAa1\nQTpMGcPbtqPR6hZP9++M3M8xC42NiGMdZ4gB961I33GYvjRjkI6QvEn2d0Yn\n9xO5KjsUsx+kMaeP2TbE8lQJjdbfwuTtNKCz51zorc274AeMwWOLe9mKnfCO\nTGwZEjLYkn+cNvEkb2gTXFHTqTUQBLBbnHE/Fy/DhcLbe/4Qeeai6A+0VEIG\nCEA4\r\n=6CL8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"cc2535ba5f66f73426d236b8a85291d7395ce589","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.23491cf85.0","@material/rtl":"9.0.0-canary.23491cf85.0","@material/base":"9.0.0-canary.23491cf85.0","@material/shape":"9.0.0-canary.23491cf85.0","@material/theme":"9.0.0-canary.23491cf85.0","@material/animation":"9.0.0-canary.23491cf85.0","@material/typography":"9.0.0-canary.23491cf85.0","@material/feature-targeting":"9.0.0-canary.23491cf85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.23491cf85.0_1605572292388_0.3756385120321766","host":"s3://npm-registry-packages"}},"9.0.0-canary.b659d4fc3.0":{"name":"@material/tooltip","version":"9.0.0-canary.b659d4fc3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.b659d4fc3.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"17cd844a79796e8cd73bcae20868119274b99e87","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.b659d4fc3.0.tgz","fileCount":46,"integrity":"sha512-yjDgBkjOqKM124xW7FsBEV2JjkbTqSmbGCkkjQI6mrnOcAtdxiWgngJkJPCWpNer8DOT1kELx20oxZNq85APpA==","signatures":[{"sig":"MEYCIQCpVR5c4kBm2JWZ0ab/fQ4hLO8eHVZ74BhjA1dITUkqwQIhAJlzyFwyo/oKBr9wq4YD4vfEVpa/c6WzzUH7PJVDuRX5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsxibCRA9TVsSAnZWagAA8EMP/jmHSSlXZ1NIAdsi1tgr\n0TLitr5fhJYllkOF4ouI3gaLUZYsuxEQ+gZA/DyFoFi+uwt8ivENFs8CSPdb\nKBSsIS2kh6lkogQCPX0MAE91QCV8QovGU9q+0yhymGXnHlL1sak+q0ku0HM7\n+DVDdIUwF46Cq8ocqw1lmd9t1sgDyLbo6VMQU3RbpjQnK/FEN4hS49NTj8gx\nNy0TG6AgBtUUwJocCaf/eWchcnZTzUmrxS8eeV5fqcMH4MP+PSdKXQB0dPVs\nSciTc1Tuzngf2bViTd+NIbZ7cC0b513qdfXBqbjC6kNPwNX6qZCSXQu0xI1p\nSRfbXSkOIoI7Uem+V8k6w27qBi6iA430zGHJytv2i83yF+qfmvFj+YMNjj3c\nMx37PmrEzrSQ8DIrqqbkuvvrAMv64jnDRxsC3MKvDLM/x2olUiiindlibmEH\nfr5Ar42ZUBeZTxfe45gA1BFux8knNAH+hiHb7ZKC2jzIgfCfVO75JKebqIEp\nFWOCXvCb0mn11rckWCMjDyQxB/U/zKZRKcd1akVm9rh4CfdODN6oPAdXM64l\n7LlFmJIk9tnADb2q5U6xXgNo7QmTwNlYJ/SXfMj6D0vJn29rw6VfswPXKFZd\nOHx32GnYwWwFYpmUQgXg2NljMSjbl8SthF1aPpDUTvxzsO0IUSNm/LbyTJ8f\nRyHy\r\n=OU+d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"da948526208886bd05bb015d249db8d19d4b3f05","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b659d4fc3.0","@material/rtl":"9.0.0-canary.b659d4fc3.0","@material/base":"9.0.0-canary.b659d4fc3.0","@material/shape":"9.0.0-canary.b659d4fc3.0","@material/theme":"9.0.0-canary.b659d4fc3.0","@material/animation":"9.0.0-canary.b659d4fc3.0","@material/typography":"9.0.0-canary.b659d4fc3.0","@material/feature-targeting":"9.0.0-canary.b659d4fc3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.b659d4fc3.0_1605572763180_0.17554158455190705","host":"s3://npm-registry-packages"}},"9.0.0-canary.d8a3aed67.0":{"name":"@material/tooltip","version":"9.0.0-canary.d8a3aed67.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.d8a3aed67.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5c3754eca577ef164137e0bed9a978fc5fdd25da","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.d8a3aed67.0.tgz","fileCount":46,"integrity":"sha512-TAuixR92+DnnrDBhzi+0cwLq001yKuau3O7yqb7ZuSpQz8ejYXa7Neethd0C88/vsxXWX/BP0uA4slU2TvB9Lg==","signatures":[{"sig":"MEUCIHgj1XNwIH24EYgCRZa2hyweoa3PBCZ7rlhnu+w2SYW2AiEA0ikLQE0FWrwOXn8TQk3C2/OWyG6j+2a18Gnz2UPWb8c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":438262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfs+wiCRA9TVsSAnZWagAAejIP/20Ky7dEzz4YgH0e5PYQ\n1vsq279nuwV22V7W4F1sHbS3ZCNy+0Lyn9bqHDmT7Moff0DMBdiiaUYBBAWt\n1Sp+iuBBZr5lgbOZIDPYDe8NnuAbfQLevx8pQvndUBI+aSs5yasyZWIzlof1\ndrQRurVBugDt3gqg3rzTr24si/wW+/327+1PM5qX50LFOaYPF3hpZMeUwjnk\nPyuO8ZkvpjY53mXLKFomgyFrLNQaF1icQ5x90T9kUjEkH6883yeZZYe7524o\nET9rkukpPFA0AXnjzuQA83KP+q3vTo/mt+adHdMVCXQEQwaUYQ02M9rbvpo9\n/+TbUtkG+Icp4EnwfUv44XvXpcMGLuSfi3N+DIyen9/KiskqVgzv9z+o0Mo3\nijOJURObRnuXxuxLQNNwAWd5Y3IrD6++1k9/HocEBRCLXnRz8wh96bIW+com\nau4WnVCl+oszRFXa/hqteQfLIqPXDhyUb8XyZ75Vde+CzRDZ4qXh37drC/ak\n6oLEjGOpj7IqY/JAKtcjhdtYKqIK2F44j5U5GY5FIOPmaip9pv7s2pfIdsvT\nXiiYJW+JQ2H6T2GT1nzFhAbxlqRoKGYNzHv053CLPSPYUnHevZBjor2LJiYO\njtFLE8Nh+ma0j41h1EihQ80FlVi3jep1mWR1BFyXoJopy5PRJujNz1GpYE55\nTZKf\r\n=Ejye\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e70765503f122fcb3d748ffd41882655d9d4035e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.d8a3aed67.0","@material/rtl":"9.0.0-canary.d8a3aed67.0","@material/base":"9.0.0-canary.d8a3aed67.0","@material/shape":"9.0.0-canary.d8a3aed67.0","@material/theme":"9.0.0-canary.d8a3aed67.0","@material/animation":"9.0.0-canary.d8a3aed67.0","@material/typography":"9.0.0-canary.d8a3aed67.0","@material/feature-targeting":"9.0.0-canary.d8a3aed67.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.d8a3aed67.0_1605626914006_0.4381572195740524","host":"s3://npm-registry-packages"}},"9.0.0-canary.482ff9091.0":{"name":"@material/tooltip","version":"9.0.0-canary.482ff9091.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.482ff9091.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b0a8bd8c7d6515a8b4b8c7074b0bf120e7dd27b0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.482ff9091.0.tgz","fileCount":46,"integrity":"sha512-nCmAUnD0OcyfDjcVFLrq8fm93LFhzSzXZfacN5RdrshFph/UT7VAOZbJNEU7DlYxibKTzh2w208y4cCMmrpK1w==","signatures":[{"sig":"MEUCIQDAGk6LDkaZQaTRKwin5ac012eAFehR/5U+Gwb7yH0V0gIgeHu6+wRl/FZ8Q52yvsEn6ZSTap7YwyBWdNZ0c0JD+5E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftA9qCRA9TVsSAnZWagAA9qgP/iQ8auIPvXYvQMQuPFfE\nb6vySBunOsfGQj3vyqSEuU8GWY1cF6KIb3Yy2ySlsxvmphYpgI6QuOCxCzpt\nSiwb/rVAz+GaqadUdWJyTLVZfGEu7sCahivOAmotCIEa75gVgvvxzu5mUchA\nE8jIiQ0zkZ+RUVLA9dH2nl/twXHh7S5Sr4mQ8WIyoXdFaDKzTf1hSa8ZM0Gq\nm+6U3R1ttq+MuIyQ1qstGkcuTr6H1ENgkb+Hk7BES0pDI1Tdw3+6iG/2tFJS\n3m3Zmgcoc4BXlzxtQv2t2WAKGmjzXEd4IApzGpkU5MIZOPlM7+2bvnNvTPiM\nKWnm78L0UVCEteo/yoGdXF+m5XyCFlK94SV4vp7uG9s8f1ZbUtD8Cj7JGMsd\nkO1alpm2BBsZyAmcC0EEGCplYpEmLRdf0y3M8pHOjWkcLUChs9brRvkHPHRu\nHvSq32cFzEn1fDicg+l2WaPFZHYmfmffzkWL5VpUzFl+UQTPp6097XFL7QV2\nrIFZmXKfasCuRUkGDHJLRKM38yYKiFmgHWRAhohB92swwiS+LY6951UZmXAx\niTJA/U5qHqFPCe5JK5yewoOzD+x1MX6HDRH0MaVxfRuQOQefhHTD+8At9uTq\nIUz5YpHfuqYaa3t3tnzTnLa6Td3xgSWXfZG84nXLv3TJWrINa668J+MTan7B\nloQi\r\n=Muor\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5b4b306ef0e5d1d3654252169bb9fb9d75490dc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.482ff9091.0","@material/rtl":"9.0.0-canary.482ff9091.0","@material/base":"9.0.0-canary.482ff9091.0","@material/shape":"9.0.0-canary.482ff9091.0","@material/theme":"9.0.0-canary.482ff9091.0","@material/animation":"9.0.0-canary.482ff9091.0","@material/typography":"9.0.0-canary.482ff9091.0","@material/feature-targeting":"9.0.0-canary.482ff9091.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.482ff9091.0_1605635946166_0.4557495587586591","host":"s3://npm-registry-packages"}},"9.0.0-canary.99cfb6bd5.0":{"name":"@material/tooltip","version":"9.0.0-canary.99cfb6bd5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.99cfb6bd5.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1634b5a23fabba4604a82ef6d8c7d1a38c3d21d3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.99cfb6bd5.0.tgz","fileCount":46,"integrity":"sha512-kAE6TX9XaIt2UT03rgvo6FUD8fWfqtoWt9LWhBgM0eAXaMpx4+ogwS+hY6NlF09PLkoThlk514rgMwD+h+TfBw==","signatures":[{"sig":"MEUCIGDNWWxiA2xz2AcUyia03pPyM3U2u/YoI1ZBnsy9jUgeAiEAyv3sDUa9W83Zf/xID/8Vlbb4DJHeKdg1VEPJi5R3hLY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftWuuCRA9TVsSAnZWagAAyvUQAIoK13IGdBITWIDfYmMm\nOrJHK7bw/BIWPkVx+qqUniP9lNLnzSwBqO21Ar6YhyfZyh5vHWLN6IXE3JfH\nqnwXWvTgaSbGWCsKN4+yEGUKDLh04lBq3dtsK1BNfD9WpzBEIjS41S/PULwD\nqa1qjdw3Opn0LjjfgGmyDY7e+062dubvBHB61c81ntgv54+lLGdT/BzNWl0w\n5LrdDkzh1IsHol2NlpO1LBv9gyav2lK2ai+RNnBjerORj+Sfj2FznYIsN/li\nE3WBx32A/4RR5BnESKxJU36gVG6WApNeC/3UEfGqTTFVPCzfjiHpZKbTMOdG\nlRic3lmaZpBpSY5An4R8q2+1smPx4zWSs5BDrZRVP+jckGR0ohDWPxlLhCE6\nUb/iYTRjM81Mrj9YgPkFsyAdvwGTebEQkCwqmSZeKrnjPFQJoyqj1c9k0ViQ\nJEnPbLthJ/+XEI+aPjnaJE5ATZqDOyuoN9SeNNNaPztAQvu6jdtI5T23zUPF\nfw1BOmWxa5J2mnpdpWjxR6TfOq4YlogW7HHuBwmUddCMjzh3QvsE54H/sqP8\ncIdbqW3EcLe8xGfCXqli47FIJ1HJJqFxkOzPtAkr708nYuvcMqDpNIJvtY8r\nOO8fpiWV9U9yrb3rZYkKdaTEh3EQDv3DwzcUBOl49cd+rv0t28o4c4fm+CFg\neVIF\r\n=M8tr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"97b5b434f189a370838c9b867dfe1b766ae52fde","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.99cfb6bd5.0","@material/rtl":"9.0.0-canary.99cfb6bd5.0","@material/base":"9.0.0-canary.99cfb6bd5.0","@material/shape":"9.0.0-canary.99cfb6bd5.0","@material/theme":"9.0.0-canary.99cfb6bd5.0","@material/animation":"9.0.0-canary.99cfb6bd5.0","@material/typography":"9.0.0-canary.99cfb6bd5.0","@material/feature-targeting":"9.0.0-canary.99cfb6bd5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.99cfb6bd5.0_1605725101640_0.6584004725993413","host":"s3://npm-registry-packages"}},"9.0.0-canary.b98d15d90.0":{"name":"@material/tooltip","version":"9.0.0-canary.b98d15d90.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.b98d15d90.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"417aa98a27361e8fe312cb57373485682dcd4cf6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.b98d15d90.0.tgz","fileCount":46,"integrity":"sha512-6eW9WcxXo1stdqxKq4f+vxl8dO7wem2Cq3EgkvVyoIaxr3Z0nr1ik9ZKU+KJDmAM5f5WHDNhjPrV+IKVKOftQA==","signatures":[{"sig":"MEUCIHTkpp8RP+nYe1va/oMRYhDc5bZll+f5mQW4alSvCiw+AiEA/ESEQZ24qyVVB8xcFtkUzvln082UmYmEs2W5wBx11PA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftaHECRA9TVsSAnZWagAAjkcP/jX0VFg/l9HKDLACRrFG\nfZHnFTOy2fyWA0AvlZeyxYg6dx2HcV0s/Sf9HoQTjbD5HezbN42t1lSkpUVj\nVfeE17hY/Jw5MHV6UlC1uuGdI0k7m1wJYGfxV/EeWynhE3V8Y94laLgsi/jP\n7Hc363UF2W6efTV0+1Eppe5zbZ2oFQSiTcR7wQS0pD3z3ZHvUgjhS8agbp2x\ne5BuzeSJLSD9/82x4XCxaxOuzUgzhuGiuYz9MEKQ8frbJ2VYbz8I4uQP1s1J\nIqh1YdQGVemqV6gfPiVjjX4vOUG2M8osxnih4Y0w+KTjMuq4Kvi6ttbAmGw1\n7Ng/NRhnTMkPLUH6iMWwxGGrOYmJewpVqeqgvEZ/ez7GwiApa0JJM52zXfoV\nAYt6tL1t6jtuV9hrNwxIWgDEVKUYtIILG3wge+6V8YKt+jOGRy8lpDCP48z1\nRq0Hw5ydJ6Kxg28yuhK8ZKD1lkvxvRCKZjSkMFw6Au1Hdq3EP0B8DN5x37YD\nGYqqGIDI5q+0hYRpZ/dPM1KK81uy00HwtadaIskUx4bAcxbg2Bhpv+bf+x3C\nkJeEufTx8PF//FDD8TJy64jYvgF3XHo08cnfJ/i5ypVJM+Oex2qNtBrx376Q\n/6HhGAt8oyW9Wznq4otwd5/R54Tm4t4efKUA7MEcn1Y5i7oP0DjdueHloQ71\nFSxS\r\n=trXW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"abbd2c5bad9fedd634d7a0c98bb8e4a8b0bf3439","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b98d15d90.0","@material/rtl":"9.0.0-canary.b98d15d90.0","@material/base":"9.0.0-canary.b98d15d90.0","@material/shape":"9.0.0-canary.b98d15d90.0","@material/theme":"9.0.0-canary.b98d15d90.0","@material/animation":"9.0.0-canary.b98d15d90.0","@material/typography":"9.0.0-canary.b98d15d90.0","@material/feature-targeting":"9.0.0-canary.b98d15d90.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.b98d15d90.0_1605738947642_0.2540626022164112","host":"s3://npm-registry-packages"}},"9.0.0-canary.30c11bfc2.0":{"name":"@material/tooltip","version":"9.0.0-canary.30c11bfc2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.30c11bfc2.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5252bade6af42554e665a1cac1cd84f4f9032fac","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.30c11bfc2.0.tgz","fileCount":46,"integrity":"sha512-5fcCa4uLv2YFCgPTWxOddC+Qe1bK3sBpj4qru+9ALgJSFRMsYCcA7zjxlZi59BEL5XG7Y9kJTju4vfY1xeca3A==","signatures":[{"sig":"MEYCIQDyRBu3VHHADS2hfnkDsEQS3frD/DcNuM2uXm2Z1JJ3PQIhAIc/RiFwZvkhUloTcy2T7eOSsVW+wPvalwyUSlOX3Twr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftcnnCRA9TVsSAnZWagAAPkgP/j7NGCiP8K9GPwI072u/\nXBgjvkgTxeQUBgbzth4YM4qWGoxZx3Q7ZNlpZtWINi7uHJQfkT52EvdcmECq\nYP4OmHSlo58R7uTjsTNqa+iJS8XVX9weJmsKWRnDWwBXg9q8ObvYshNmfWQA\nH2Xdz1My4QrtEEmmPKIkbVZa+Hp96QXl/gzSCp98Swdl+z240puTFFPLdZhu\nsPkE/HpOM37O5N0njC3bG6HpKO6OQzGIYQapxuGnvTh2BR4FAYs5aiS30XkB\nHhmBt13WH1S5YfWJaffXIQTL2h7pwyV8y1UC3MTrwTKtnihEeAp+lSWSW/6f\nyY+0v6ofLYY/wzqw4v6uwwKKt2KWJoZ+GnCARcsW5QbQ3QRe/NZ1Xwbqi4cP\n+VK2TwJKSwh4acTfOspsuTefIp4CKMkQlF/Rq3XAwWzQI/FtS+xaUvZ+Rg5p\nMLe1+AWLDjCv6XxmPs4wkJ56U3961f7V2fnLscH+//LfGlb5dbffSSFMoCO7\nswbf1rzWqBSRswwUytWb8RehLDtUYC6CvP9RZN0fue1AhQBkretJ6OZAVg+B\nRsZGAhtPymf1ENUt+aAy0l2vNoLeuOVVYZ8KXQbeDnVYmgZfS7V2pnmFTJf5\nywbxcz0zy8+WAOiUsz4gstCPgfYfKZRrT7zNKQ7UPdC0MH95bXEPbd7ZaXsR\njgmv\r\n=RfOV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bde404a844a4528a097cb2c90d03c4ce8bba9d74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.30c11bfc2.0","@material/rtl":"9.0.0-canary.30c11bfc2.0","@material/base":"9.0.0-canary.30c11bfc2.0","@material/shape":"9.0.0-canary.30c11bfc2.0","@material/theme":"9.0.0-canary.30c11bfc2.0","@material/animation":"9.0.0-canary.30c11bfc2.0","@material/typography":"9.0.0-canary.30c11bfc2.0","@material/feature-targeting":"9.0.0-canary.30c11bfc2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.30c11bfc2.0_1605749222849_0.20967553164644626","host":"s3://npm-registry-packages"}},"9.0.0-canary.1b731d51b.0":{"name":"@material/tooltip","version":"9.0.0-canary.1b731d51b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.1b731d51b.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7bfbfe75300ed84bb3b97c3f3c354a8ca39fa590","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.1b731d51b.0.tgz","fileCount":36,"integrity":"sha512-MekWGR/3xudLln2JL+Sn2MCvoeUVOk/MQkKAwaQ7iTdGKGJ86LMIYCeQM95UUDdL+pFz6jzBgOKisbI/vfWRdg==","signatures":[{"sig":"MEYCIQC7jL8Giu4KmDFHAnj6a5C7AqJ6xttdbTMKi2cPG/qRywIhAPcitIWDT8ctgXIRjERqpxLBds1juJK4jyZt/YNQShO9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":362605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftr8gCRA9TVsSAnZWagAAGCIP/jfkQXptk2ifphMAYf03\nUqE3O99Bc3CX86v2Oep4+CEfHUGeIiYjoniqtfc8oBdYdnyMyxTqFvYhdRbB\nbhMFU6yhtE1erbr2KoK9B0UQD8TsV4KasmRLZnH3Z+iMxhghHs9iJvB3jgBe\nrbmHZkqpNwnjKDKMCnwOA085SB254s/dDbDJ0DlTdlwAXryv16UOHtN8x4ID\nmxqwBXFISvLVl+xS+px4z6k+p9cdcyaJp6r6atCIDdqpWvLJVCwxSb6gIMcH\nSxQZbygyBgJUXa/yhYMA+ubm78366B5NYG7411zaI8Gd0IbvEZXzDk1y6Lrd\nDom6k6LOCrcjeRjmucjIb+sGG4z175YSLUI/2qVJZ7s0F2kUF3c3uzrNOQXv\nVTdXfTmXPharrZztR0yyis7cEVtzMYE4KTIzK4nwrPZTN7wp5P/TeyA+rWqs\nxjLOBrJexIMkMEjArM6IS6sWgAiltdHNLafixn83s8ZFtd7M6jhMFWE14elG\nNLiHnAyCWnsTyiXAlhTnwmoWlhXiGwumZrqUrd83R5W45lXJK4n976sPKRmK\nWwu00J0zAQc1CLm03yH/38hl2Sv5BwanrX9ZtmEjCgg537U9DEwavx7Meo5i\nXtNuW2iJhLW5NEbMY/Un3iMChqHbup/i7OyRtchw1MChSDvSkrmeU3XGpRqu\ntjce\r\n=l/xX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"22fd036a79b754fbad742c64041cedbac73ce410","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.1b731d51b.0","@material/rtl":"9.0.0-canary.1b731d51b.0","@material/base":"9.0.0-canary.1b731d51b.0","@material/shape":"9.0.0-canary.1b731d51b.0","@material/theme":"9.0.0-canary.1b731d51b.0","@material/animation":"9.0.0-canary.1b731d51b.0","@material/typography":"9.0.0-canary.1b731d51b.0","@material/feature-targeting":"9.0.0-canary.1b731d51b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.1b731d51b.0_1605811999937_0.4658824344058763","host":"s3://npm-registry-packages"}},"9.0.0-canary.4ae94ff78.0":{"name":"@material/tooltip","version":"9.0.0-canary.4ae94ff78.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.4ae94ff78.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02eb8b9d562fc768a33c65516b48df3a054dc5ae","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.4ae94ff78.0.tgz","fileCount":36,"integrity":"sha512-gSUJwAQaCfEICOgntGS+ioZecjtUzYqSNfpQwSpJycAsUssbYYj9moiCFkr5zrpV2bez5GkN5nke7YJCMT6s1Q==","signatures":[{"sig":"MEQCIFC5BMP9BgiX1Y723i5Uq0JVwa0xkalqx+oiTl2ylD0nAiBLMyLznYiW6UEKfil/IQoYIzirnpPhs+mpab1cAGzcXA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":384783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftr/VCRA9TVsSAnZWagAAGUQQAJ2brqXYxfOpFwNXXJmt\nsnshbuwYPvxauMeS7XICTxP7kafhPW0NixCuzPFxEhOIrU38Wm23Mq5Rtz0/\n4Vvogio71wnJRZ8FuO2Bs4Lh6iXRXeQUhLoIyv6kEhy8NCwoziTW15sCPqEZ\niJYPRqcRMMRw2PrMNCTBz8BBj4MqBuk0LL9BGYWr/Rwcs7otFq3VPXPUEYBc\nTMGY7O/CMxdDNdy/5eshdPe9RSLyRQKsRpqHttU9Y4Kpj4wSFA0hhFZRuP5I\nVAwBK5WaSA+YBSoP1oedzGNFUhF38loDIdEvM6QGrdgXjiIx7xzEVyNG6BJ8\nplmjdgbE3xZhb8CdoOLhSLs0FB3NXq0QdO98+qkAYzO6HefeML0LOAtkrHal\nR/icET0GkyQ/M1oWbd0G7NFwTjNZm7T3iQIBkNASZmyMhTJ8JebP8ImKUaMv\nqyHc96OjkwVAMzqw7wzo8oal2PSmHlx1oq9ZUFsYaIp036zg/TKCi0mphccL\n8giXzfF/ZaJPLZPSIgbPPc0F3InV6p+4ZIPnxpHw+2nsakieaf4V/+6vrd02\n7U29nBfgxAisl3A1Ylk8AD4uRVgdcAeJJUx7+fpkEaYhM385f5VsGdMVNl4T\nxCjtndT53xmpNM9ugknkrnn91OE8AvagTrDLS143clqwn6KySzHRtvwGE2I2\nrbpC\r\n=r4QR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"34c69ebecd44026cff9ea0d681fc2be3de9900b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4ae94ff78.0","@material/rtl":"9.0.0-canary.4ae94ff78.0","@material/base":"9.0.0-canary.4ae94ff78.0","@material/shape":"9.0.0-canary.4ae94ff78.0","@material/theme":"9.0.0-canary.4ae94ff78.0","@material/animation":"9.0.0-canary.4ae94ff78.0","@material/elevation":"9.0.0-canary.4ae94ff78.0","@material/typography":"9.0.0-canary.4ae94ff78.0","@material/feature-targeting":"9.0.0-canary.4ae94ff78.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.4ae94ff78.0_1605812181208_0.3492031107649043","host":"s3://npm-registry-packages"}},"9.0.0-canary.7ad038e1d.0":{"name":"@material/tooltip","version":"9.0.0-canary.7ad038e1d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.7ad038e1d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f64fa5b7ae35aa9ca85c1f2b1846db4727a8019b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.7ad038e1d.0.tgz","fileCount":36,"integrity":"sha512-cwAcHx04GuYYxXsH0UAa3Fw96XOLM4pTvltyw3Xq8ic4E8me71eKTDBZ+smL7hvSY26uqfPPFRp/wgzhpfCpfw==","signatures":[{"sig":"MEUCIQCyfdBMe5wr6MjFRf4HxY+GRbRDvwZUJFUODOXBoolDmwIgHcKw8btC7TW5w2XMd34RKZPC4oLPn5OocIChg1QOUJg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":384783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftsVACRA9TVsSAnZWagAAdZkP/Rwv8TNqGIuW/7/85elN\n+IFnd4OXOBXBKzcdex1pf5JivVoWbdpNKRrsLOvSEPTOBhUv2kxIvxdwLJ4x\n+YQ7k3lnkBjKDxUeMm4ELi3N0JwzET2YgNAEMnbe3aO1RWv9/+QkVTRWuy2T\nOQ4Z6qFmAeRP2+Og2OH46lAqqbqckcS2s476ZOLhYN06TDzWOIgNx3m91gqK\nKi7CFJ0zNsyh09utiZa5C3KgOEMdAUeEzGzc6ra9SHC6mYNcg1g2KVV0Mdt6\nTfOxcnsR0UhP21xEYjGNfClf4p9kf+WAFbyocCedncpqiTj7Ah05HCyGWXt8\nnjGtDUCvQI/CNfjPEYjFUMe/Dhr78QUJVqmR+F0d+PGOXiXzU3m4FiX0yrpO\nsSrcMe56dtxHkKlLNgM6v3Hb5u3O8PJDrSKWsu1KTIUvxRdVE+UYmxKr0ifn\ni/JDjddIHdXrhsXI0SL353y4UVHvgJt0qaCv8i8mELvhRAVxT5UG1In9OjfK\n2SwJNY35qR2Ha2ZTXY0OwpcNFjIhMIdo21H10tagcphYS6JB3nhFOIWPQCo4\nuHh6KmmQhl7yo1gpeR/Wra9o7iJyWwOqlp2LfYdVpxNL7O9d++/KqS655kW/\nv47cd5EpgPI1RZtH/lGwko2mqTTtjROdnETEPTjAQKDjD1AjdLXhEB/8rrvt\nJ0vw\r\n=qpYr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ae5e88e00f948f916eeb8f578dc80b6aa2084116","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.7ad038e1d.0","@material/rtl":"9.0.0-canary.7ad038e1d.0","@material/base":"9.0.0-canary.7ad038e1d.0","@material/shape":"9.0.0-canary.7ad038e1d.0","@material/theme":"9.0.0-canary.7ad038e1d.0","@material/animation":"9.0.0-canary.7ad038e1d.0","@material/elevation":"9.0.0-canary.7ad038e1d.0","@material/typography":"9.0.0-canary.7ad038e1d.0","@material/feature-targeting":"9.0.0-canary.7ad038e1d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.7ad038e1d.0_1605813568211_0.29748089012076506","host":"s3://npm-registry-packages"}},"9.0.0-canary.a41527604.0":{"name":"@material/tooltip","version":"9.0.0-canary.a41527604.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.a41527604.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9396a24f7d4b95822995d7ace5eb50f8755648b4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.a41527604.0.tgz","fileCount":36,"integrity":"sha512-X6WpWRkv3DVB7M24VupqHoDyYWQm7kJXfEkQbmeFaCiA67V7qqHcDOC+QuiAxFIOx+7RWWZLYApINV1L9DrzxA==","signatures":[{"sig":"MEUCIQDmV2xtTybQgZErGBL4mfNaZe71BYfXy3mqYbLxR+/HQwIgIz7OkVJlUCMbsX/Wz+gPqxIPrVCO5qhGc8d5gaJpjWM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":406775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfts8ICRA9TVsSAnZWagAAsHgQAIf1oS1EKL/DhQRnvM9/\nzw9QiyRGnfujmsdMm127tgMjNaVmF+/3qH8gsBZ/moJW6rs+gcSc5qXR+q4r\nZozqUdnN39ZqHgRmfju2VxTNDafY0qG390X9UveoTVXL9mogoHeJ6UlBPAGU\nl/EmXu19/ESUBhotu1xPxOOcfUuLwAP1DyRjEjVZXKMkcIkW6/Dl072ijNOZ\nJNeS2XVDvezDSXrC1DAuI8GjrqiI+iWrvc+opz/OG6qFaDdyLmjpJE4yKwtT\nhjIJV949JwGJ/3qr2ZVumQw9HMxy4dPezquJJtqcW+YsLh6DR61MBK0+Lkpv\n5YbH7rkf6xaUGwPv3/Vwr2xZ+VAtxmTZYZdOs90ePc98GfFOrcA46lDoGdl4\nVyQgwd5bo5m8Cqry9HE5sCAxue88eCFHvCAY1Qe4zKMfDZxsTgrJlVAmQCkb\nfrA6LrAXg83FBSInfcIWqs2E+itMZEgiDWJoE1A0m7qNGwQlbtIMJdpyitlH\nLkuhNuE5BwzOHs3K7BduRmwE70c1tx7dHfcVssyUbe577bySsPSZ7e6YLy+j\nPgflYOY4RiEer5wy7rk4QPUunG+4SbBO0qOv6U3hhzkCIQbT/vl9McM3FzYn\nFwQ0yyfojsKYoFaFFkaGhJzIGu9klaeiagDPApOnKptbESeHodFhnHcFs8N3\nX6rS\r\n=5GTv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4419897c2a5ae382f471047e38ac619bef815058","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.a41527604.0","@material/rtl":"9.0.0-canary.a41527604.0","@material/base":"9.0.0-canary.a41527604.0","@material/shape":"9.0.0-canary.a41527604.0","@material/theme":"9.0.0-canary.a41527604.0","@material/animation":"9.0.0-canary.a41527604.0","@material/elevation":"9.0.0-canary.a41527604.0","@material/typography":"9.0.0-canary.a41527604.0","@material/feature-targeting":"9.0.0-canary.a41527604.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.a41527604.0_1605816071836_0.5345532708146767","host":"s3://npm-registry-packages"}},"9.0.0-canary.7b0e2b377.0":{"name":"@material/tooltip","version":"9.0.0-canary.7b0e2b377.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.7b0e2b377.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"73e4de9482d42ec4b897b733f100107f6f1813df","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.7b0e2b377.0.tgz","fileCount":36,"integrity":"sha512-CjkDYAi1eYrJUJpMGs1tXeMGUvYH5emTyovrzuvUz7B91gjicg9YqA+c0h0XVkcK4I0+wCK8BsG/g+iGXN3vFg==","signatures":[{"sig":"MEUCIBPTVN2llyTxBWF0CYRyibUqV74uZlYR3DDffm7r0AInAiEAjuJ2VdGO9eLnVKwDUg4lwFPjPFkLK+GyXd0Z1fiqOaA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":406775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuEm0CRA9TVsSAnZWagAAiWQP/3ggXPv6lYftDLV4+YTO\niP4mMI/mfNX9PNVegOI2vRR5T12UjzOUVh6KRLHLfZ4+u5XXskvj/Dd70Ttt\n6lEAhukeErwjv5fiv1IsQkkrQ5aP7r+qMDOufJKHgQfk++/yxg0pYskjqfmJ\nYq848Fftc5FVyCW16WayMPwIPmL6bbnfC5dfq0dHON6PWCFfEUApzC5n5X2U\neHy4ThovMgY0+RSdWs7EHFA4FqW90/rV04JjCr9qQB6j0YuVUvr5c9d1To1j\nSNp3r2wl6VJU/I9ukV9MTTY2A22HEf9ul2JMDHyci7Q2wlaNmxzGXSf7BBIP\nHHgHRXwmPskYmvgfl6m0suuLmWdzXTyALWRqkkncbckA+lkl3Pt+7G1xygKE\netmk7A6qsmh6cWhrSXsOpnwjmLvVTq9UMHLK4iziq6E+VsKZ8mrc+csekK/m\nG1kk/RxOq2Gq4e1H7zwxAsTtdaHz+TiE7WAx6bzx/BHuR9r2qPQ3DBu/C4eQ\nJda+YgeU2oNBC1zlv9lorNeGp9EtZ4Y33ybe/LeVfswSPFvoOduVb9Rl/7rd\ntSMKhtzakTHGV1Vjd4vC5gqDyeYo0uJU/B2FX79LqE8gfdPMv/wJN4wxtYR9\ntfXn6UXE2ZUTpIPHg0RjFRsHwI0j5YXo2jMJ0CrMwmZZkqO63on/Iiksacdf\n8YzW\r\n=t2Vg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"51086f360a63319c786c7b166e515a34aa76c112","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.7b0e2b377.0","@material/rtl":"9.0.0-canary.7b0e2b377.0","@material/base":"9.0.0-canary.7b0e2b377.0","@material/shape":"9.0.0-canary.7b0e2b377.0","@material/theme":"9.0.0-canary.7b0e2b377.0","@material/animation":"9.0.0-canary.7b0e2b377.0","@material/elevation":"9.0.0-canary.7b0e2b377.0","@material/typography":"9.0.0-canary.7b0e2b377.0","@material/feature-targeting":"9.0.0-canary.7b0e2b377.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.7b0e2b377.0_1605913012252_0.9239177075199778","host":"s3://npm-registry-packages"}},"9.0.0-canary.c927a5d05.0":{"name":"@material/tooltip","version":"9.0.0-canary.c927a5d05.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.c927a5d05.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"951937f1450ee3294d882faba652a684cd989419","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.c927a5d05.0.tgz","fileCount":36,"integrity":"sha512-O2rz+hfS+clv4CQ7LMHq7M2nI2HYFTog8r1ZLivsyGT0XQKI5z9BuX1afR9Grsk4IWUD4TTGzGx4b31iYSkd1Q==","signatures":[{"sig":"MEUCIQCqZUT+Cq+e8+kJzYTdVZr80KjPfTX4scaFkP8HzNI4WgIgXvD8XtdqBq4yyaLp0WKfdn2X5JV+PM3HurWzlM5l7Sw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":417291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvBIUCRA9TVsSAnZWagAAk2wQAKTl6VW0Ao95KXP8fHak\nh/uVw7GCNpT9k/PY0w5mP8Gy+CCmfDT/P+dKE6iHjJYZshn7RJVNDTAeNLtU\ncF9UlYd3ghaKsoFQXOGT2qpuIy5llvUpL4qDC9wkfyOSM0s6qridJk9Cj5iZ\n0cehIlhMv0TwRbXw8x6PsZeJ7ENssMV8bimpuiIk6XZyvO9YvaVluWH5kjly\nKFRNg6s24vg5WCE/z9PJMmTsLJDNwT81RtgmzE/Y03onLk+AGifsRjGs4VfK\nwAEBEbPZ9zHYCVBp8ati+4nipN7nP7wp+MC32i4XLy4Db5h71QvaFi+WfSbb\n0EykZp2KnL5Up4YwiybRSaTPACKDSbVYZf7hnSGPvGWqnNqwXNPf94X7Z8+M\n0aoUG5G8MGbknEM1n1v4rlkECJDCxac1cdbLI5xj+rp19iAAD94t0+enK/6K\nisiBW7hrfDb1omrGvIVs5xn0LxthCim2L9fnINrUSBhbJ1pT7RHApuqKxJVN\nDEh/wIoy417adBdunZSzwzym1j8yS4TPu+ow/F9BsH665Jp+pXyV3m+JjDtm\n/TAARLwftdqrHTFwdvY63f8wcyl+AM/+lSkRJ46oZx9HSLWuUG0o0hzI6Poz\n8j3NT/ljtrJbmwXe6Gz7k+O5X94d+yFg0A6ynEDjvLQYXHbrnzP/CII73QcX\nQ2as\r\n=3u8B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1e41eddb7d951c0eeca983e08e3fbb7b21cc3776","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.c927a5d05.0","@material/rtl":"9.0.0-canary.c927a5d05.0","@material/base":"9.0.0-canary.c927a5d05.0","@material/shape":"9.0.0-canary.c927a5d05.0","@material/theme":"9.0.0-canary.c927a5d05.0","@material/animation":"9.0.0-canary.c927a5d05.0","@material/elevation":"9.0.0-canary.c927a5d05.0","@material/typography":"9.0.0-canary.c927a5d05.0","@material/feature-targeting":"9.0.0-canary.c927a5d05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.c927a5d05.0_1606160915823_0.7065195568835365","host":"s3://npm-registry-packages"}},"9.0.0-canary.b349b5185.0":{"name":"@material/tooltip","version":"9.0.0-canary.b349b5185.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.b349b5185.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"46fa2ba9e1e6cb381929e8f7b2789187c38378cc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.b349b5185.0.tgz","fileCount":36,"integrity":"sha512-RGgcl5N6i/QOoeOxS3msBCbBDFBbdE3T74f5j7zO1Vr5ItEWo8Ep/br+e1dCrqW9sX6cy1+gHIPPxw+1qP9PnA==","signatures":[{"sig":"MEQCIG8fLae1/3+27e8sU6qO+AFoB/ZOlrFii+80c2MSPK5kAiBjLDXk/j7/rmaSXTIwkNGyV4KQDR7n41OdrCT3jmE7Eg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":417291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvT5pCRA9TVsSAnZWagAAL1gQAJ15KzNzIiUzht1EKfTA\nWFkYS7FrWqijFdxGFLLtIuwDVbZHUd7XREXHJ6k5HAMGjvdyvx8cQVUrnsht\nAgykKx6H5I65JePhgTltg3LwWIw8gT+MAEgoDSvae2XYGxV0oHCw7K0Yg3Ec\npQMD5bnzhTPsH83Wb4lfjAZanANreTD+L3IFvCv4SOkxEKClv9qezf9xswnu\nOlGNoD+hp07Sw+pmJImIJ2KpLYG2iw2sQzcVdwoY2xvOE/wStreszmdxB+F0\nmNJz7JmJWfCvbuxECottANuZEt02gHoj2cb9YyXve21Eeg/5U1ZKCmxUrDf5\n7u7aCLxALHoJCv7P5F/I8UtbsV4Y6GWDl1C1iEJd2tDstbJl8LuErDet0sBI\nuOmYVa2DcG+wve8fw2cWXSd5LXmxMRTu6O+o8XaNLF2+rQij1tLzBKQWeIrf\nsYTGvVVJO92oNDsLz+3gia3UZkCrwYhQmiR63gGHBgDvSlJ80VbBDK7ehRAv\nvzpV3LQRG5L89f/1bV1Dr4mwdgA4AWSUkd3cW80b4Q3XEiL9vomYa6gDVB06\np7V1FIsu/OXJXr3V8NMdbz+6fJfXDgYQmkF9vvVXHiB/UVnQgBcg2tvZCnbR\nW3Y2BcTquJiv5LqcorxHKgtO3jYhXZvIfr0xZtke0FHqtJpkmcGAuhCizUkK\neO5U\r\n=Yos+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"92e0cccba580778200706f15aef4e667fc007066","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b349b5185.0","@material/rtl":"9.0.0-canary.b349b5185.0","@material/base":"9.0.0-canary.b349b5185.0","@material/shape":"9.0.0-canary.b349b5185.0","@material/theme":"9.0.0-canary.b349b5185.0","@material/animation":"9.0.0-canary.b349b5185.0","@material/elevation":"9.0.0-canary.b349b5185.0","@material/typography":"9.0.0-canary.b349b5185.0","@material/feature-targeting":"9.0.0-canary.b349b5185.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.b349b5185.0_1606237800602_0.5689167985444714","host":"s3://npm-registry-packages"}},"9.0.0-canary.9083b7d61.0":{"name":"@material/tooltip","version":"9.0.0-canary.9083b7d61.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.9083b7d61.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b126a83aa86d62aadfd65e2b65eed814296e140c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.9083b7d61.0.tgz","fileCount":36,"integrity":"sha512-Le5Z1aMJA2k8RUxmJVjwA1nWqzWEbAOB9pgw8fvs1n5og1TNNNwRblgggI3d7+IXR7bZOEkWQvbS56VaeFYniQ==","signatures":[{"sig":"MEYCIQDjDXUzLf+ptafAqyo0hC+uccp4nu8rKsgkaolLWxoh3AIhAIl2WI6eZHb7t5iGp/r25p2jA1jA+UU6uGqgrgCM741n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":417291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvXg3CRA9TVsSAnZWagAAMpwQAJrA/Kmh+kFQco+5vBji\n/S9+40wdFe9iJ15ahfmi6tAbm2iytsfGR/LbW16Dj9oLgDDlg0KbI6knViwv\nVAUB4/5lUyUu3rMvjGGnO1C/oHO2ANdsVFfwZr7zMIAUe6lSaIE8RmAwb6y5\nzQEifQmwC4rdnjnTVg8n2mezfpPVWwsWKJgkOIkv9nZzenJQqwayKB2yGxt/\ndkF42HU72UrG/ni+Dea1/MCOWEEYAwd+R3SU+HpSOesC41Nr/kOKs9LwWkQH\nhsiJDh36gi4++dZsfO0oae2o76F+UYz1Fgn3oDNMV1h5McsaUJTIE5GNJbSy\nuKxyw/dKGPOFXoDQVCqr4f370HTq1Pkc3xdb20jA8By0jMlC1LEFIfSv9jhj\nrtDJh+6+sodF96HLP0W3usseh/O4qa9cM6vvj6hH2ETQzOt+lCOzDE6OKnh/\nld6WcraPRu7bgTUVhgKNs5/81rjIiNWYQeXnbLboCYHnkBzmlUj3nyXo0iDO\n7TwOqsW6LoU4jJcNxjYFRT0JqANfp/Do4AtmpOpWTOQz6vHG3nGA+ueq3Tc0\nGi/zNdjIhCwx35LnfPZcbAaItg9cOd9UDQoqg5Z9eFwcbdBxzbULamJg6r1w\nBGaBrhM9vKT750IJuqiJNyg8q1HGn3OZ+VXHTOvANKfgsIuJTZu8GQIlkDGV\nUcVd\r\n=jak2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c6192773b6d2ce6a74a5b464d7df3e9b57b238d4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.9083b7d61.0","@material/rtl":"9.0.0-canary.9083b7d61.0","@material/base":"9.0.0-canary.9083b7d61.0","@material/shape":"9.0.0-canary.9083b7d61.0","@material/theme":"9.0.0-canary.9083b7d61.0","@material/animation":"9.0.0-canary.9083b7d61.0","@material/elevation":"9.0.0-canary.9083b7d61.0","@material/typography":"9.0.0-canary.9083b7d61.0","@material/feature-targeting":"9.0.0-canary.9083b7d61.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.9083b7d61.0_1606252599051_0.660474921148305","host":"s3://npm-registry-packages"}},"9.0.0-canary.eff7b46ac.0":{"name":"@material/tooltip","version":"9.0.0-canary.eff7b46ac.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.eff7b46ac.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e3191272ee09e843c5543e0c2666b16f27c53c80","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.eff7b46ac.0.tgz","fileCount":36,"integrity":"sha512-dxFTeltSBKWvz+W/hRoGsxisJrq0rmCkwZMBKdDC6cQyu9dzlxqDF+fPbhfpExbpOWvY/AKvwWYQMIV4c5w7cA==","signatures":[{"sig":"MEUCIE7hk3YsPf5Dbfh6+aM7aSKHUEpwQaFrPaiMxWfzFINiAiEA3NGSM3Z4e7JiwrKR4kbn2altBSI1EOaCsNr01msPXUo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":417291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvZf4CRA9TVsSAnZWagAA+GgP/RwTDkRMPhiVm9YaRkZn\nyd+sgQAJ6JbryMPWvDXfjzVszLZ0VMVWRoys5tPAwgrJXlLld8kfJC93vO9D\nzrxiSktsFNbyjAftgNag8yoed4PitOb4nchOJoVERVrBtBj7ZBJkZxNjjHj0\nSgnpJT+zuFplM/XfkCFm+XOAehZ/RmiOgQwZQ5s/xepuoFglomusvtDGPyyu\nuKbiY8wnRkzrJDNca5DjNthaOOiO50dUiipEhAGsROAzTpyKMVp1nAO7JstL\nqE3blBD48uP6O+md5iYnkVnOhP4Qq8kDqmY3ADGq/HgSBpivBNzoJwiBDqG4\nJEgUC814ZNsH+uI4RXQXCX4TuzyzVliTcAvaE5Nj/028d4zaCjPuwl0jLfV2\n0AKCx9njIyNDuPGj9bsQJutVjkQys6uL3ry676BIIumBbuaWc19BgdTFTTYv\n2NSLVrG/HsApKoKI1QUUQfHKzgd7ny7cQj+5qH+Ed9UXtPocp05QVsL5hhOv\nuKVEApbddz6UP5pGaTY2qiBe4mG0rmlAuYYuPnGPyXCMP5Zm9A2iHXLl1bUI\nAFriIeeME06j3TMixZ4yUaclwPl+dPBckyJaRFoE9hpMxoVRW2acUtpmr3Va\nlQr8ETbP38ahEQys/BCQERcs3ApdeNM/9Xshxe88EOaCJnrJ0I4MNo9e+UYm\nI+q2\r\n=jZd9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b8790bb41654e5c7f7a7725e8e58c9dd08551129","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.eff7b46ac.0","@material/rtl":"9.0.0-canary.eff7b46ac.0","@material/base":"9.0.0-canary.eff7b46ac.0","@material/shape":"9.0.0-canary.eff7b46ac.0","@material/theme":"9.0.0-canary.eff7b46ac.0","@material/animation":"9.0.0-canary.eff7b46ac.0","@material/elevation":"9.0.0-canary.eff7b46ac.0","@material/typography":"9.0.0-canary.eff7b46ac.0","@material/feature-targeting":"9.0.0-canary.eff7b46ac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.eff7b46ac.0_1606260727806_0.18765152844020228","host":"s3://npm-registry-packages"}},"9.0.0-canary.ae27b44b0.0":{"name":"@material/tooltip","version":"9.0.0-canary.ae27b44b0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.ae27b44b0.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"63f46b0ca3025d6bde8943fc733cbeffbc555617","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.ae27b44b0.0.tgz","fileCount":36,"integrity":"sha512-+lvnsLHC6Srzpp20ej7ESx2hPI6B4pQyJaSY808sUiR8tn3KTwD+IwWDQYIppg0h1Wlom6wNlyWVpjIapR8geg==","signatures":[{"sig":"MEYCIQDvKSRGtdXyObEqBvNvxKF7yOBPO83zXMl2LPX1BZNDiAIhANXmsiOYQcM+f2k2bGJmPs+J7tXBYDKdXb9d+j88kJnH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":417291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvnm5CRA9TVsSAnZWagAAmy8P/0vS9PubELbtLLAJN0G9\nfwui26y5tSaCyYxbzrNakBzXeUYJ4grlcRjxSecn96nJwSeccl/2iN8TZ0Qc\noqZDaXrj5P9jToyXXu+ZM7oaV39tvpXXzH4sLZP5pE6dtAhrZJrjX0edIlwN\nPMQTkBobzKIB6ulhk00rWi04ctU+1ifIfeoHNldihqFZrgAKJKXBdIFwtCdQ\ns+rig2vhteNO/2fKSqalD7jhF1GsXBMJnANzvk+ujBAuSjicAJjUbLKMPPML\n6GZwDIQV93CaL8/B6H3kEp2k/WWErzsEslRrxdNzRe2R5oyD4spbdO7+6W5F\n4Gs1t5k1QpNbFzaZ2Xt0P0v+XTuoD4wnbWJvUG4fsZdd5Uz9FFUyS7KkMKGM\nAsXsE0zS+/SM3gx6g2sQ2JnIbr5se5Sa1JtANSv/how52mlA4pIVHTYRrP96\nc3Kc4MIfIIp9xmtaDw1ZG7ACdA/BpFQMm30D4kenOYQ5O7osRCaDJii+aKdO\nN7enLk1yjldzqkUpKrv0m3bhDY0qxl8EPi3QI3eCosQmSvAlPCgs4u0zt3yB\naAbKsRAm8zfVANlLUqkKILGbFT5u14A65W79ZgPdSRdaQqaRSm358f+N4UPc\nV1nL1Jr1NkvqcduoncnYdojsE+7+4FPjvG9GkoBL5Op2xV4hOfliyArzX7Bi\nZkmg\r\n=I0Et\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"eb690fa0e9558b61ded00dc6e4b467cbeaed4c4b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.ae27b44b0.0","@material/rtl":"9.0.0-canary.ae27b44b0.0","@material/base":"9.0.0-canary.ae27b44b0.0","@material/shape":"9.0.0-canary.ae27b44b0.0","@material/theme":"9.0.0-canary.ae27b44b0.0","@material/animation":"9.0.0-canary.ae27b44b0.0","@material/elevation":"9.0.0-canary.ae27b44b0.0","@material/typography":"9.0.0-canary.ae27b44b0.0","@material/feature-targeting":"9.0.0-canary.ae27b44b0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.ae27b44b0.0_1606318521305_0.3837640763649093","host":"s3://npm-registry-packages"}},"9.0.0-canary.2fbba2554.0":{"name":"@material/tooltip","version":"9.0.0-canary.2fbba2554.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.2fbba2554.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1156ae50fa1f410d7b9493c94733dc77acf49c6c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.2fbba2554.0.tgz","fileCount":36,"integrity":"sha512-HqNgRq9Kpz7QxHYycyCDz8c/lXnCJ/iXUA+vvYxlSjK3KM6FK25WIlL59RKS0HpH7GB+cSyjicGDwHkQl/dWXA==","signatures":[{"sig":"MEUCIQC2i7WSMSLlh8Wjj0eNo17qVeUSlm2lCtnz/QeuGmETBQIgUvjD3EXNRBzUshzT1pISjVV1ZpYvPYkHB7bSeUgrZnU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":417291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxS6/CRA9TVsSAnZWagAAcpQP/0xzVBRWTCppqx4h/2Dh\nkDOClir3Tf7TY88yVjY329SEvdAJIbuVymPQLIKHYGJYgH6Zy+wAsQiKevd0\nlSJ+1dX98UdFoEVBgipbw+2ejTd6nDL943T5xJluZZkD0yHVfFxAfNkDnOW+\nfGybLc1qhZzjEdGOLOcK+JpvQVs0XYxfxxtUU9cspMozLlmG2WZxRg2uc8Xj\nYHx9VhIBr4UPSVn0OBlAeBypJ3r1aTu4FTdVyKtTbESPpzeEzH1m5yphb+Mu\ndJjZwZ45A62m5hCUdXHaMD+GzH0N7jqTogjUML+YAKT6RZVqus101zIC5pEv\n1SC3spKJKrUbVdz/xwCh6YcmKzv4lo0+8xBB1odzvO0JPlZDcW4uQJ/iuDq1\n44rrkbr/Rt3MRaEmaq/ZIRppyuq9I74BQRi+dC8q5kXCM6nEfdVhkUKJvsoG\n7LdxR5JWbNk4Ij3z06+H1JJf0BKsrS0wdQkHNsWI2dO322SKaHafhJw+An42\nqkhb3T56JWwWDXvKK/b8x2bEJ/N1kc1IGX+rLpH4xPytlO+DaF4iiQZjySvg\ndHr34k05Bp2MwZWwEIN/LVVxvLgkTVilDDEHucmENPH+2xyveZGaHWyoivt4\nfAmmJ3W9vJG0pHPx82i5yPNpCQR7VmqIh7OR0nQ4gpnWLclxQBlgdLnCA2lW\nXC77\r\n=IzF5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"93356628825eb23bea706adfd527933f0c5e430d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.2fbba2554.0","@material/rtl":"9.0.0-canary.2fbba2554.0","@material/base":"9.0.0-canary.2fbba2554.0","@material/shape":"9.0.0-canary.2fbba2554.0","@material/theme":"9.0.0-canary.2fbba2554.0","@material/animation":"9.0.0-canary.2fbba2554.0","@material/elevation":"9.0.0-canary.2fbba2554.0","@material/typography":"9.0.0-canary.2fbba2554.0","@material/feature-targeting":"9.0.0-canary.2fbba2554.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.2fbba2554.0_1606758078750_0.15744330536425233","host":"s3://npm-registry-packages"}},"9.0.0-canary.6d8574fe1.0":{"name":"@material/tooltip","version":"9.0.0-canary.6d8574fe1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.6d8574fe1.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"08699c053b47d0368798ba7f6167b539768e2b70","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.6d8574fe1.0.tgz","fileCount":36,"integrity":"sha512-QNQKn4QYgKa6IysqU5oE87GuesXTFw8UqiMcN2vqeovxtQ/wGvEeZR1FgEr4kkkR+zEOm5hWk+Qje1PrKWlY/Q==","signatures":[{"sig":"MEUCIC0nLlclmqghAY/WANE5gHDm0BUr1qQfNgJoaQdRen3CAiEA4KmqiMKg5OzdAIdNlHB+D818t67qRV0spZ+Nj4QhbIQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxTFRCRA9TVsSAnZWagAA9S8P/0MsJaeqb1CZJyvJboBR\nSiABOLjz4RVJzg4glhtOh0KKT9bJYPTp1tj7lC2dIcxX9fAYX9RXwxE/KTvp\nYxj1Lq6JMBbbQJu3lEglOE3aGX8Xi10tUZeJVOcfAJnM+ecfT7EZcc/9yKnN\nQsd9U5e/CnhD7Unqk6ugaDTvPOKlFlCAyL/yTs0gU8loe2zHz6qxUFlXI0dA\nyDPT0Oo+ARg6bC3tpr2ss5h6ciKjUKd1rNz6MvSLCd7bKILiQ+PINASu2Ysk\nPVJWuSXUYa9fAyMId8A0oZ/YnHVuela52Zv1buoJmfojapoUJXYzfxJewMwW\nTTdWQXojzQLI9HZnqUdPlZvWKkwXsGsajdgRA+RJzEmlPwa2zDpLd9CWYfx9\n48UJsC/sf7wLLXgQmZBUGZyh2xAhAfzC9qpFn7DSqplVuMT70m+jBYSA8iZG\nBXRKPq5WP9qnhlg8ePPlB2Sgjaj+bUt7v+MRhw+xMtSrgwb8BWwTi5S43hth\nFIxUaVkZowkWmEZFr68QWLYTm7B65HsqrK+uaqd+l2hVQFvbibSdV9rVGOZb\nZBfWMoNYUF5Q8llfVKU7Ulh/JcTjEINCdE/C7wITanF68HGEIM6HKmPvV+le\ni6QmV6Nd/sVo6xdqfnhgyEBbEGvhATcAb1oxtf4NDTICsgZhxJ/Yt4f9k9YF\niZgB\r\n=j0Ow\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b98a165c81d2497f6c0e8e5652743d71d87029e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.6d8574fe1.0","@material/rtl":"9.0.0-canary.6d8574fe1.0","@material/base":"9.0.0-canary.6d8574fe1.0","@material/shape":"9.0.0-canary.6d8574fe1.0","@material/theme":"9.0.0-canary.6d8574fe1.0","@material/animation":"9.0.0-canary.6d8574fe1.0","@material/elevation":"9.0.0-canary.6d8574fe1.0","@material/typography":"9.0.0-canary.6d8574fe1.0","@material/feature-targeting":"9.0.0-canary.6d8574fe1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.6d8574fe1.0_1606758736767_0.1335259959619195","host":"s3://npm-registry-packages"}},"9.0.0-canary.fd22355f7.0":{"name":"@material/tooltip","version":"9.0.0-canary.fd22355f7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.fd22355f7.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c2f39946d85c38b6252cb017e33aca16300f2678","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.fd22355f7.0.tgz","fileCount":36,"integrity":"sha512-SwTvSzMa4p6B/ZojYzztt3mTZ7xgu5FT8Ez/CCe6ZBuIifPqfC02udbq7+ddHsjBuqbBWZ9CQa50PCmUlQtEhQ==","signatures":[{"sig":"MEYCIQCJCV+g14jY8OUL+8EiF0goY3tIuBYKUiyJ1Ye91Up6wQIhAIxbfkMsxIJ3yiy5t48+9CyrVVa1UQDFkmmqnr6YuLGe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxXmSCRA9TVsSAnZWagAAbpUP/jzwDp83SkWGj3OFjkMp\ncsSeNOzw1Xit0hTtsg/c2z8vPyeW/39EBNJJFrfjIxiW10Fdjb1CfYhfUxvt\nLU5VgRJc7AgKtmJaV4ZKY3VqGGXP+Ic+JZbDj0v1otdz0TcqHG5VSk4U0jzX\noDYR7fH0MLIAAhA1GFPLImQIomLC82Gb+Ol5D/1vorSQ43UNJrK8Y8JIBBoT\nGtRsryJ9SrfITqUnbERR42OUFtEFLzfTjTMepRzMkqVRH1dbrHnHF34sGbjp\nqQTxoAkgTNjhUNNdQquEHh2i079kTYTBJUYYOBP/YdSXa6J87YhfsfBglj9R\n201zQCZmBEq7pmmSZi/mQOSosjlGce7Z2u2Zk2XHcckykx6XfzQsj4VUBQjn\nYzdFM1B74SUjnGdsn//EBgL520YoGJjPgtqei6ivjkVhcic+4L0WX1mPWS2f\nznFDiD0ChZVC5jCSgI+kHGezrY6s0fsWCkWYaDqLudkVKekdeVsr5mqCrmAQ\n/iZA7eOJw4qDhe74vj/7lTa+PXUrr2QJ7i/TiE2DJjjSxwpH3PWjj2HVK/fZ\nnXIOdJ5TiSsOkj9e9W+ba3eDVAOsCadH0NMqmyDMowOht3/Fx/vxfC3Dl7IB\nMEyMvnrGr2DjVkXUMyxxj5NVF59oYvSHZYOYmvWRSlkVqIdM3MBTHEdFZzYk\nXzM+\r\n=+GJj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"86a40292baea3adb58a6c26ed8c68a9a425cef18","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fd22355f7.0","@material/rtl":"9.0.0-canary.fd22355f7.0","@material/base":"9.0.0-canary.fd22355f7.0","@material/shape":"9.0.0-canary.fd22355f7.0","@material/theme":"9.0.0-canary.fd22355f7.0","@material/animation":"9.0.0-canary.fd22355f7.0","@material/elevation":"9.0.0-canary.fd22355f7.0","@material/typography":"9.0.0-canary.fd22355f7.0","@material/feature-targeting":"9.0.0-canary.fd22355f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.fd22355f7.0_1606777233751_0.6423221480596935","host":"s3://npm-registry-packages"}},"9.0.0-canary.c4ab98722.0":{"name":"@material/tooltip","version":"9.0.0-canary.c4ab98722.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.c4ab98722.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"70644008a37cbcd3f5c075117283ab90d3a642a6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.c4ab98722.0.tgz","fileCount":36,"integrity":"sha512-iuwQFXqTHJ0d76+wa8ovYiQ4j9xr/DlOWDZ+sccQLGBJ9/48nhXjjioduGlr+GiVNPkV1ZgtPegcfLY+AWtSUg==","signatures":[{"sig":"MEUCIQDxq+nBv/ByWXMlu9oXyPc/uLuJi9pCms94b+PfwIXgmwIgD+tRgblDCNDevULn9jA/VIOo2DsAYQ7oKi4h0o4jIO0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxuaNCRA9TVsSAnZWagAA+yoP/35ryBoA4yB3fIx4cf2r\nY150jtLtEqorV/oGW4G3nFe4aypmsPzVgVPvU4hNcC5FccORVQvrTL/dMUUE\nUaEYkt8yCVdI4gyA+N0IYhxC1BBfIN8aMd+HkeObxVsufCvdxDB6wORw1Z2A\nr4hVrV/f+pXrmqO4asg5+0pk86E79sdAX8GDod5oFUidEG/NJZPvm+GxC2Fx\nslZebkJkKbs04+RARnbJj9TpOHwyqoCArU55VtVKX0urFlJZXAu4u2l8byYn\nmySH60RneoxBnxux4qd/qo5h3DbRyxpqikW36es4apPW/TOqUrgvQ3d36yfS\nlfIWLnER6m+VJ1lBbROP/IA4vSOiuKNWXciP857s/nlQsqKMSIHFBKj1atTV\nMyvPon7h5bMeZVZwUnibKYuerN4z0iwVBpRLMLHnmL6rPJ89iq6wtvuBdkyr\nr54rMH+TBLUD6aVCCrIX59n6npP4/c8dCDwvHcu/gr4zE1FZhbiMk2ve7Zys\n2s0OZnjm5jGvlxyEI0aa93FNaLkbxsM/Q8ixVJ7gQYg7RHF21EsvLJkeVwy3\nwsfdxfUx/MyEF6wPqAc6wKsDJO6+6N/i0hN8Luok2DsyFnLlJQqnZs3HIfYW\nYoowTtTPlKq1AJreX2semWSYqcgAg5EUE4pN8yv/1S5rZabnkt+KT4OG4ebM\nAY5r\r\n=MOAL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e6187eb74996c124e1abdcea72dfb697bdb1820f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.c4ab98722.0","@material/rtl":"9.0.0-canary.c4ab98722.0","@material/base":"9.0.0-canary.c4ab98722.0","@material/shape":"9.0.0-canary.c4ab98722.0","@material/theme":"9.0.0-canary.c4ab98722.0","@material/animation":"9.0.0-canary.c4ab98722.0","@material/elevation":"9.0.0-canary.c4ab98722.0","@material/typography":"9.0.0-canary.c4ab98722.0","@material/feature-targeting":"9.0.0-canary.c4ab98722.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.c4ab98722.0_1606870668757_0.13975384502446375","host":"s3://npm-registry-packages"}},"9.0.0-canary.977585650.0":{"name":"@material/tooltip","version":"9.0.0-canary.977585650.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.977585650.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c3fc6d871c15ccde38b7f1c81e9fde43a5f8bf06","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.977585650.0.tgz","fileCount":36,"integrity":"sha512-T9eOsRwkm2PfWgF7466suR/paL6cyYjuMtTwYUtHOYiXJkFz/WNZyqsxWKXfTCeK/PR0ty8I67lr9g3QE413JQ==","signatures":[{"sig":"MEQCIEhNR4mFqCbgoetLAC5z3a3eQMhtylt7+sYkTwGVgmP0AiBtjfqZSn3d4EYOGuLFX3La7IbGdbFGulH9RKpzJu99yA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":432458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx6gKCRA9TVsSAnZWagAAZ+0P/jewDchrPnU+lL0NMljW\nfgTuNOYmvyR/cLb0kXK21OJDHjTNjeKIIPJli2sgFfSUj5XSIdIdPBV2R2bh\nkwA/ImPcUo3jNfDWVO3YaO31rFcelTldcKmrs1Zks3SwjJGeetuocmM0DGYE\nb1CNX7h0lBiTRW6SH98qH1AMcmkGf6gnxETXI7PrTL4/xVdYERYBSOFtgUHg\ng7nCmM1PUKJS8s0MfhLd7rfE3rRcrh7zU39Pv1tF0kGl6vhKFKd3o3tCftHv\nvqt0D2ZSmZ5TcWKNOD5mHJhbVuMAXB7nIQ6Ai+NfF/TV4zbrC8fIZgGmPLUP\nyITQcfjVBhMrFXvE2dZAS/GKtroBe3yfyHHQfMomS5tdBSv1NlAt4rswxTfo\nrd3WnKWsrWI0FBipEufmUveGPVcRzMyN8DmcgPvob/0aLEzvleOyDBzg5f7E\nbot1MPhEzu7HO8QU1wHJikxeg8gbfopJYOyvSeZcCExQB/R29R6n6Ag1JHT0\nIF4gWfWfxr4VoTIE4tdD3toMw2/1rkhS8b7J0S4PUwrBeYB2GY5eXiMfDwKy\n4uoZSm3JylO4fRGPqcJUsLWbGVJaLunSlponeF3J4i9PLkhXKVSubM5XLIW2\nM9R5R+EJqBfe+e6QO9ZT3Vsh1ZBYYqVF9aIqV58HMCJxYIpjmYdpa8N4P2Lo\nUdJt\r\n=LLvp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b008ede8c0d581314d3b967bd295990ca8eee38e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.977585650.0","@material/rtl":"9.0.0-canary.977585650.0","@material/base":"9.0.0-canary.977585650.0","@material/shape":"9.0.0-canary.977585650.0","@material/theme":"9.0.0-canary.977585650.0","@material/animation":"9.0.0-canary.977585650.0","@material/elevation":"9.0.0-canary.977585650.0","@material/typography":"9.0.0-canary.977585650.0","@material/feature-targeting":"9.0.0-canary.977585650.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.977585650.0_1606920201879_0.5958653431202434","host":"s3://npm-registry-packages"}},"9.0.0-canary.c7edfc7b6.0":{"name":"@material/tooltip","version":"9.0.0-canary.c7edfc7b6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.c7edfc7b6.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f12721ca3178d7e830acb3e76d4f39ba8b713969","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.c7edfc7b6.0.tgz","fileCount":36,"integrity":"sha512-Jky5pTI2ZF0QY3g/tHu2rWMcbHuZ/M8njwMEaxS71tBJj4MhDmudDHUz3wnx/HGunIXHj59/UAoSmyOn/rF/tQ==","signatures":[{"sig":"MEQCIEMq3tChclO7Ztl8rcfkYwnI0+e1a5N9OOJF2AW+kFIOAiBCpJ5mbxfUCgEnCTfa82AzBKTEocXq3eqOG7tMilbd8g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":432458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx6m5CRA9TVsSAnZWagAAbE4P/iG6xq/tsQqrQoMvoMDg\nB/ldmnZX2xV7gbJQdaqx+h5lvcTP5+XR8exo0CbZ0PD7/U0cLI18B6xnnK4S\nhTjO2rkmJZkExPBK/d4MD/VMObOphH6k0I63y576aZYoPPoQYH4347A7a+zV\nGND8ZHOsSUG4beqp2jkf9JDa5thfNbkRw4TxdL1rqoh4Vu3fxLbDtH1LKRz5\n3ZlCtPQDHqnPm1nVeqkKyT6UnXFrq5OK/VQYoos8dVaEgW2uiZAi46x74qxv\nA4L2WH4cY9D2aFvMntegt362wD738rv6NCd1oscOl944c8fOa8xAYDm/ScS5\n5xGIdhxd7dCvRhfbe1JRD//bApTSlCQuvtcZPS1YECwvyF84LFv5zMsJ40Fc\nC7wFjlta4+FzcdISLr9kaoe0bCcUcaA3pzjvVOCySXMazCHWpN3bvLyZfgcU\nKfcFRGSmB3FI/UwFKMi6B2KVbh5EK2lmI3NzueZ9N6avF8MgUbWfCjJZSf2B\nJS4JCdqqHcd2PycZAA+NB12lJVgD8yQBU6HEMdnLKS3w+WOo6pnZ6IsVU5Rm\nsSWCK+Vcw3BgyjP4FUTERoL4Q+XHFhSNg/jyRJeb4TH3BdlY+aF/GSNU5Hxg\nCEDDWZlaTus/JR7R+VCYdsehr6z2AKrF911ioyPPT6XQJSAvtB88kbyGHm0h\n//L0\r\n=75Lj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"791973660a1d63a77aa10d2bd0df7c0e6ea94698","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.c7edfc7b6.0","@material/rtl":"9.0.0-canary.c7edfc7b6.0","@material/base":"9.0.0-canary.c7edfc7b6.0","@material/shape":"9.0.0-canary.c7edfc7b6.0","@material/theme":"9.0.0-canary.c7edfc7b6.0","@material/animation":"9.0.0-canary.c7edfc7b6.0","@material/elevation":"9.0.0-canary.c7edfc7b6.0","@material/typography":"9.0.0-canary.c7edfc7b6.0","@material/feature-targeting":"9.0.0-canary.c7edfc7b6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.c7edfc7b6.0_1606920632935_0.3031507278058867","host":"s3://npm-registry-packages"}},"9.0.0-canary.4f3347306.0":{"name":"@material/tooltip","version":"9.0.0-canary.4f3347306.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.4f3347306.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c6c472498ae1ce38b413139227a1ed9ff36d3608","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.4f3347306.0.tgz","fileCount":36,"integrity":"sha512-FyGmhrnIuUt7fvK0NjLIkm9WUI0VLzuZFC4b0OPQB8d9SP05+qiAEw4JVsvsUNrHD6PWHldr0izbW5IdoNLO0A==","signatures":[{"sig":"MEQCIBedPE8uSEK2iAFM6SzBQIXY2Hdz+FsiU3iffvXcXHW5AiAxJPAiufUfEAaivba0tELSXenY1caEUICe+4z46eRy1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":435813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx63vCRA9TVsSAnZWagAA8YgP/30nPkDqfFuwfKEUJ/cH\n+5pHRxARRGoJ90P1VZCw4zAMO8wW/VQSt87A+eP3NNcAhZN3pji0PmbD8VZA\npq/+oZacuVR4NwsA0LJirrv2b2hXrUGMKDjIrpB/5UZRzsgR06qvpp5AO7lH\nHHw1sTKunpQzkLMXbgNX80WCY2QyA7rhImJ7osFU+qeOlv7Nt69kpInCbwbz\nWjiHOXn7bDOQOWHil+twfwmnKrvAuVUB31uNOq7XI1S8xro+ocMws6zAPRL6\nbjkGG+2je46WqPmwJgPJVg7eSFfYMof9GJDfhMGEsnYYwyQkCx5FhANAlVwQ\nGVVltxhmApe+PQMMGG32V0n5XAbJX1yI0uXKmymLd4Q+buwFPtBgEhAZhDbC\nW+BN2jLD8NNx1340lfDT1IXIq8WA5HB7KmF2sbdIvcm1U0QypPLxc6qMWe22\nfOlB/3wc91dbO7uN9/dw6M4ckVEsuiY/sOipcBN4IqPOuo3VoB9L+c0ba/AJ\nbQeYyjNK1jYKbkcrTn+mxNF7mr5/UHKMEkqIaxIlQkD8HSivx4DoWuCdhztF\n3NFTN/VuPnXHhk9aPtYzU7h46G1bSMqRAFrUaEHviSSpYgfv1aJ1UBMzSkJ7\ngNXlvMKgbEgZ/GzBauRdpfmDxr+pCvIge7OvcW2vG+RlwQ1xQcqfQ6X1JtbT\nAy9O\r\n=fFSX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"31d08595c0470096709a4d5518ba7444313882e7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4f3347306.0","@material/rtl":"9.0.0-canary.4f3347306.0","@material/base":"9.0.0-canary.4f3347306.0","@material/shape":"9.0.0-canary.4f3347306.0","@material/theme":"9.0.0-canary.4f3347306.0","@material/animation":"9.0.0-canary.4f3347306.0","@material/elevation":"9.0.0-canary.4f3347306.0","@material/typography":"9.0.0-canary.4f3347306.0","@material/feature-targeting":"9.0.0-canary.4f3347306.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.4f3347306.0_1606921710639_0.009099282667156317","host":"s3://npm-registry-packages"}},"9.0.0-canary.37fbae10d.0":{"name":"@material/tooltip","version":"9.0.0-canary.37fbae10d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.37fbae10d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ec7394a1119e3bf3645dd8965b15330ce726b83","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.37fbae10d.0.tgz","fileCount":36,"integrity":"sha512-YvMp6j9YHsKIT5UcaM9g8Jp17Jkb2cK42zum3OGdmkURhqszAQaHG9nqNrLEb4aaqyBMVzFdBFaxpFjeX+IsQQ==","signatures":[{"sig":"MEYCIQCFQUA21BzRqOfwF9O4MMRVchUp/1IzNAVstm+30HvC6AIhAMgUlOFeo4vB3fl6qGVku2Kc0rAPorsy/3iAWPcznxWb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":435813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx9o1CRA9TVsSAnZWagAAQ2EP/2en3Cqq3eBtufgS3b/G\nkn4Ueu2QzVDQpuISkBSIY2qIwI0a4D6PCUL3dfSWjOfYj4Us8te1fmdqdPpY\noIUW1MLu1Emz/ikDW+WHon6QqS52hAGL7gOHFLB/vQWrmeBkR3eFKSzbbUB4\nrYO/CdwudAgDOxaqtYz4uUuRkd+TVHN3XLmBBGMusPqkDvNKbw3eYlntuHl6\nYVrnydKyKjxhRsQLCgMgeUFn5ivReRK09d7eFA6f+fZsVBMS1eDVVAH5JIPo\n9JwtiWBfCBN96+5+YmPlwkTBVPGvFYpw2VVeV/vGfrdD8KCfuQR+S+06ZuyB\nYir7e0ZX5RJFNfrWiICTa5jYizWbp8a6Qc72FVf/wwoDzxdgvf+bPDrcXkud\nWMbV3mxLGgeTilOWPCKNDFUbfa6WW63iPji2heO0XoXCp6DxTJLNvItY9C+Y\ntriA0I5ZKO07K5LvlvOMXykaD3CDTMYtzuF/l7wgA66G91kGnYkcAsamg/0U\n7HuayRtJe1Q2ssNU/YPoAjXCEErfbRoUBoLvOA4suveZy+ZWfYwROEUpHwZo\nO4UPvfJo+/ljiwf4voH5JrqB2DmpBRHlWBf4ZAy1UO/WsLXDf6gT20bj1h1H\nZAS6NsohVFpU/7yZ2LxMMn3Ja8aMg2se7JBvw1h3iBebaMRzPI9xFM1xIfgU\nIn9s\r\n=3W3e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"104ddf5dd99e7bc09a57e2cae74614b7726fa235","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.37fbae10d.0","@material/rtl":"9.0.0-canary.37fbae10d.0","@material/base":"9.0.0-canary.37fbae10d.0","@material/shape":"9.0.0-canary.37fbae10d.0","@material/theme":"9.0.0-canary.37fbae10d.0","@material/animation":"9.0.0-canary.37fbae10d.0","@material/elevation":"9.0.0-canary.37fbae10d.0","@material/typography":"9.0.0-canary.37fbae10d.0","@material/feature-targeting":"9.0.0-canary.37fbae10d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.37fbae10d.0_1606933044675_0.5626733430154811","host":"s3://npm-registry-packages"}},"9.0.0-canary.11da3c0db.0":{"name":"@material/tooltip","version":"9.0.0-canary.11da3c0db.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.11da3c0db.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d6226c5c58c63ab0045caa460a8b1904f75da08e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.11da3c0db.0.tgz","fileCount":36,"integrity":"sha512-OcbxsbhE3UX/MayPp2EM+UcTh/9nwuRe2RrR4sSorK2xH9XcTYiXgsPIRVtkU79Uu0QZqjkZCTJvdF/DviPDjQ==","signatures":[{"sig":"MEQCICB7M/vvkHuC8Hu1TUYoYE63l7g+ql/OQsOLn984dFrYAiAENs4qsWgxnasdAkLAY+oI0iVEEVyPkl1Z9nVCpvoEMw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx/e9CRA9TVsSAnZWagAAqxkP/0e7HwkMRX0LczOpOh+H\ncuzjuiOlkgts1MwQMnwk1hYOdXVlXHzqikFESloPffwWch0wHls3pb/Ww+pG\nugR3T/acfFICA5LILjrecLs+VMLmakSN0pV0H2c/cBvHqmtIAaKQ6gcgQLwX\nxd6XCG2sHEq9JVysy4mhXtLHMoPxyhuE3RsrDix9ObtOLCitNBUBMmFargqQ\n8LUHm/PWBa65L+Gtibw2dQlE0ZwgHDx+hg96gtfg3QLJ/uiKqGLBkrcgQ0YL\n6hqnaUs4hmmtYkkRK9wH6P+qfjYNUQlrbNg+kJpmv1ereHeS74TyuqZO5Yql\ngCdpEX9VVOoW2eudaPasuu9Wgv/1zSDUzPzlK2jSZYLVnNK0VL7Ty3EpwAwd\nsNXn6Lq394wFjCboOvBuEYg7M+zait5miHErRROnlAarUyTM3Gdb8jllKQP7\nTt2BahI7ECUORCKj0vsckJzwpOrd3bZXJjvTxPsNVboVUi62YlLy0GtUMUTD\nZ0bYx5JrjY5kGwvhIrRJ1UScZKV6Djb2upngoWCXAXcL1K1ILnL5aq2uC3QC\nXtac7IYOFYgfpc//sAWZM8DWjnEMhz2rp8kXsgYy6cO+EuRhLR8s1acDF7bc\nJKjfPVQJqvW0UHZHQN9HAbps7z5TglxmocTqbVkRuO9go4VqZWpZpfdg/k5/\n/3hs\r\n=I8hY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"db8b5af79bc8221682000a74eab75c30395590f1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.11da3c0db.0","@material/rtl":"9.0.0-canary.11da3c0db.0","@material/base":"9.0.0-canary.11da3c0db.0","@material/shape":"9.0.0-canary.11da3c0db.0","@material/theme":"9.0.0-canary.11da3c0db.0","@material/animation":"9.0.0-canary.11da3c0db.0","@material/elevation":"9.0.0-canary.11da3c0db.0","@material/typography":"9.0.0-canary.11da3c0db.0","@material/feature-targeting":"9.0.0-canary.11da3c0db.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.11da3c0db.0_1606940605026_0.047001404588011386","host":"s3://npm-registry-packages"}},"9.0.0-canary.489d4c219.0":{"name":"@material/tooltip","version":"9.0.0-canary.489d4c219.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.489d4c219.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6e93fea995dc2ad63ea5bdb4995feef65c5a36db","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.489d4c219.0.tgz","fileCount":36,"integrity":"sha512-f+25Z4pfCmHYn1R3LFodtil/uXK171STvyccZSNEc6fkFBl7AQMNvHWerTDpbzocuP4My8M8R+mc6/cgOgyt9Q==","signatures":[{"sig":"MEUCIHl89XAHFhBJ+AVi4JRB7gJYNemrSOgcE2synOgvEaQFAiEAuVNhQD6eWT/pphN+0rwakK7GIoznoAOHoP4QTdLLXtw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":440955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyQSjCRA9TVsSAnZWagAAliIP/07K2Goe/c7PCDkWf5vh\nRHaXO3TkndvIs8qcgKXceIV5Bn7ysMeXU9RZQqd0A2vhZq9Vn7BHCw+iciEL\n+UWm5vHbQOIIUy+75vgnaCskHGky2rXZ1u8V7jDWVvEIr8QbRHiDLHupsBrM\nO2DgoFmDkmpfxyfKIGe9gU75Ghm2HYLN6bO8wDBODMJymGy2619Ozy88v7tQ\n05E/tbWxrabB2EEitLuB6GK93L0gax8Rk+EEZm+KfC8rt7iRq6yRBciaj6B1\nJ43jsDniBEiyxIgX3jYgzWPb31pKrnEhrQ6RPddxY34EiWnzdmr3khMfYLOd\n9UPMDEhgtydw/9cKYJuWy3t2NwVW4HfncFK+WBAtDceTiTF/vH5M0No9zv4p\n8r3FUKnLgvrSccUmbf58FXAMWiL8Ad6XLFdS/YAejhz8etWhea1p8CCxcabP\nX1WTIpWOwWy5qpCqZAJ0SahKqh2xBuXWxIpBBMXBsTUD3pIQcuZWNQuBcBsO\n1ptIl4eRxXohL75eK/FBFYBVYdz6/oEaxkHPEoK562ziCKR20neggYwgMqOD\nQW9sLpsg9r8WSnNeiEar/O2cTkYxn5YjMouoYVtHPFP5W/ewLIWpBuvfPJiH\n00hJFNy16AUjlG7GUzQDxnyZKLizrIU3y7IJEOa0EJM2j0G94CG3TAzxi0Fn\nPAj2\r\n=3ujN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b1c4ecae655bd87a48f6065e7c292d4b30cda43b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.489d4c219.0","@material/rtl":"9.0.0-canary.489d4c219.0","@material/base":"9.0.0-canary.489d4c219.0","@material/shape":"9.0.0-canary.489d4c219.0","@material/theme":"9.0.0-canary.489d4c219.0","@material/animation":"9.0.0-canary.489d4c219.0","@material/elevation":"9.0.0-canary.489d4c219.0","@material/typography":"9.0.0-canary.489d4c219.0","@material/feature-targeting":"9.0.0-canary.489d4c219.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.489d4c219.0_1607009443208_0.8506558729917919","host":"s3://npm-registry-packages"}},"9.0.0-canary.6557a69d9.0":{"name":"@material/tooltip","version":"9.0.0-canary.6557a69d9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.6557a69d9.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"74b109f090158a69017009dfe24fa5d9bc43c4d5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.6557a69d9.0.tgz","fileCount":36,"integrity":"sha512-c+6k3Y468IH5XF+nmK1XDjVKoXrVnpOzEaw8BV45YZ+tLuNzoHVSzhKOQH7Wqwu4c7RIhpSpeCFE2AAk5oo51w==","signatures":[{"sig":"MEQCIG8/AQuwJNoTOMum8ZO/4/Ne5b4jWuYbNgWpJziYHmV1AiAWvpDn+C1xKsVBaILkxyOot/SKNoSjnrlu7ewyUS0Cvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":443305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyQdlCRA9TVsSAnZWagAAz/MP/0XAIudXk8RtCvd1OE5c\nYZyepET2IlbZrbd05OjKMUs/ooRPhB1GBC00uk3hbgFJ/Ww4F6xzyvvZazQF\ntUwPzM0tao0SAjVTpCxbLV8Pjro+8cE7jxzDSh30Co4daMa3/Hqv9UUQIJH8\nTBzpKpmFkqLUvRlUVJxbxocc66dwXBAyxt6MCBJ+gD2DaTA2wf7vrSK5JcrZ\nuW7OOvb3Lvbf649HBNm643O0aT1++4B9Z4ID0DIUGPQj1FyReumXfvmFDxIJ\nsZKHnq0E3pk8BTUkDlud8QyuTEI6mHZ//OYAEajwDxDiDE+Ud8WBg912WQqh\nQ1vH30sGUMltlmSd96Uo/IX4vh/BwWaIMjsU+Azf0xGTyoi4u69lQPH8nmb9\n3lNcu/BydPB2BIMhuk7nX0CZGAonY7QvQNJgFfJD/Y5Q8qLEsvH7iJ07Jezv\nQFgOpTTr0tae9UCz4OsG0vw9v+kkf3Sz0nOvwIudrs3UmxiCrG6GOnMgaNt7\nEXv+pEvXdLdAk+4EQZnoxzsAmPyza+LK+h2Fsolj+WNJxF6EPDmBAPPe0mwM\nCI4Pq0NmkkOQ2Tf4lr5977hx9acbAvYF9CVMTrx/55fDHLnmkXehtTnYclkc\n+ZPdIllQJY3xj0g6Hj59rlGpj/J635wpC5QZ6ucazHD/RpabtCDWD47kaaWx\n9ds2\r\n=U2oP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"55ff05f1fcd2efe299d07cfd81279127a6fcaa5f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.6557a69d9.0","@material/rtl":"9.0.0-canary.6557a69d9.0","@material/base":"9.0.0-canary.6557a69d9.0","@material/shape":"9.0.0-canary.6557a69d9.0","@material/theme":"9.0.0-canary.6557a69d9.0","@material/animation":"9.0.0-canary.6557a69d9.0","@material/elevation":"9.0.0-canary.6557a69d9.0","@material/typography":"9.0.0-canary.6557a69d9.0","@material/feature-targeting":"9.0.0-canary.6557a69d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.6557a69d9.0_1607010149018_0.9470209372840848","host":"s3://npm-registry-packages"}},"9.0.0-canary.4ea1b7c69.0":{"name":"@material/tooltip","version":"9.0.0-canary.4ea1b7c69.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.4ea1b7c69.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f8782fe13627dd463720a989ed582bed4b57753b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.4ea1b7c69.0.tgz","fileCount":36,"integrity":"sha512-rbjsrjKv2qye88B6mXuvCsNAAr2U4pfPt/5+GxLfFHk8yfFipVaG0/yYZZnEx4vwiIuWfF2n9fMp+rxu80qD7A==","signatures":[{"sig":"MEQCIAd0T3TLTyVc2kw39NvEcVLKsic5isnA06iFuJCQhAcAAiBbjfmVlg2Go0ywAlEVCE9Mg7X15yn4CnaJzIWygUNHPQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":444937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyQtmCRA9TVsSAnZWagAAy0cQAJcTqsNF950T/zjI6iKp\nmrOu7bGqgr+mHeJVrKJxThRSY7hBL5pftMlz8F6yFUHxNoPLz0u5PvHby7Fq\nrv+TIG9/IKsg+OPur17zxi1KLX7mkYlibX4lpJsCc3zPFoV2crJVRK0QPA+o\ny/08hSoDjXCWhsaR/2QoFcp3sUrr+irRNNlR9mdWRtuJH0ZrZjasbkTlP5Oa\nnADWoSYOlTvKao9NsdfmjpE5K0WDZdasPBQVYOY3USNFDVVPlNv2miLqah4c\nHDVka5BeIuW1iVrGvxVyf7i/VZpyh8PlO4AayDUBLGe1Fu/8O47xWO72Iw4t\nHCMfkreShRwZkGMj/MMOD5DeTMMa9OrHua4TPzOGkNWvRyuDNcTNdEq1NZ2j\niUQ1pkx5ID2gkIxTc0GjwU+4fATrIlrZ932v3m+jT5ugmRPJscUMmZSvFPsv\nqJHScrlVknTao1ODkucxh7npV04Ckk0VAMzKKb+rrfe4AeuwZgWTqhhObbM1\nI7DcGufsK13v0IolirX4HfApt8/bhkhtYoI1jOxYF1ynBHv7O+NtvdjbCOrn\nqx561QOHQZxE77b6WgcbP/pNtSP8vY6U7F5oFlzK4X0tQtEuMnClvrLf7BZz\nli7kScqaLr4k3X3m5qTh9V0bcyuwMJ42nrdtWWUr4Wi+DjBciejdFTySyOso\nj6Gs\r\n=DuR8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d7307ed831dded5d9e22a8faf595a7411258793f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4ea1b7c69.0","@material/rtl":"9.0.0-canary.4ea1b7c69.0","@material/base":"9.0.0-canary.4ea1b7c69.0","@material/shape":"9.0.0-canary.4ea1b7c69.0","@material/theme":"9.0.0-canary.4ea1b7c69.0","@material/animation":"9.0.0-canary.4ea1b7c69.0","@material/elevation":"9.0.0-canary.4ea1b7c69.0","@material/typography":"9.0.0-canary.4ea1b7c69.0","@material/feature-targeting":"9.0.0-canary.4ea1b7c69.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.4ea1b7c69.0_1607011173502_0.5671846212234397","host":"s3://npm-registry-packages"}},"9.0.0-canary.eaeb78ce3.0":{"name":"@material/tooltip","version":"9.0.0-canary.eaeb78ce3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.eaeb78ce3.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0cf7b3eda63fc3e72cdd16fd5a11d3c8f6b35f29","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.eaeb78ce3.0.tgz","fileCount":36,"integrity":"sha512-qwI+U+EyYUNLsYR/2CFtI5ZIgCyLl0uu3SNPxc55Fp5PV/pevXj6h517lbLm9OmOhs39fY9TPpx0S8m9b/eVcw==","signatures":[{"sig":"MEUCIDEkPrz1/C2VbaCfFVkGWNE6/P113Nu5dWlT6CTdf4q7AiEA4IP7M7n4ZGbtUVgz4EULI/zODFR8fb7xoHs9dEyzT8w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyRonCRA9TVsSAnZWagAAPSIP/iTdnNBwJRh0j0Zpb0mw\nA5FRWWruj9oSWAv6srsts+JGzIaGLZyZ0AbakegJ5wR+Fz7PTIwruKulkfjT\nertdQUd1506PnwqdIHxNDUngZE9hp6UtfYEy3WMRyttd1+UvCozsGMMAKXx6\nlj9m/pfNt1xCg8h8p9AGoCaAoO+0u/4Fr3wUST9UKEGjQ1qegNejD0Ot0Rar\n7PLfE77ArONuaWJMqkiiNRzwu6VuVxOesqoEGNaumEngtAlhlXpszlJ7o9yQ\nXTDYxtFu1VJV57D1VMbmXxy7j6rRqRfEt9MvJ6bM2gk0xa6WyJecZ86kb/dT\nyugf8A9OLBFwb5CNbZKIWCQWsBIl3zlZwsfI6OOKGkLPHqGNu1fYuFdiAL0w\nPeW77i+xg5MdrO+q68LC/KLxBAc9UUW4ErW/ZoTDG1zbTSx/9obW2pBwlID/\nSF/3TgosiGjaSymSy7P1QYBagWZi/mFmFva8kZL1mGkQNOJNiijjJBOkhJ7q\n+8icRophk/KIO4FzzdcyUn//tWBcCNHCgTM3aBx3U8habOpu5w0aW8uE7znP\n8A85DfzT6LbIcsepz/WfXZkznOt0SFGqjhEra5VNUE7BqKrPaf1Nh62lnXai\nQEN34OQ4ISrdf0l1EWbKP8QqzeJxQJtd1a3HAjB5Q8/bFKjklNWayth+uOAn\nd7K7\r\n=cP0V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n## Contents\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9902fe5ed18fabe2d289f92e75dbf17abebe5a80","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.eaeb78ce3.0","@material/rtl":"9.0.0-canary.eaeb78ce3.0","@material/base":"9.0.0-canary.eaeb78ce3.0","@material/shape":"9.0.0-canary.eaeb78ce3.0","@material/theme":"9.0.0-canary.eaeb78ce3.0","@material/animation":"9.0.0-canary.eaeb78ce3.0","@material/elevation":"9.0.0-canary.eaeb78ce3.0","@material/typography":"9.0.0-canary.eaeb78ce3.0","@material/feature-targeting":"9.0.0-canary.eaeb78ce3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.eaeb78ce3.0_1607014950864_0.5887343231914999","host":"s3://npm-registry-packages"}},"9.0.0-canary.1c156d69d.0":{"name":"@material/tooltip","version":"9.0.0-canary.1c156d69d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.1c156d69d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"428b4c05d3a9d05b393e067eaa669df20950b6d6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.1c156d69d.0.tgz","fileCount":36,"integrity":"sha512-OZ8HULhsPpz2Lz8rDm7ta1bbO3KPfUW5FuhZfzLOk5HqijKRv94Xk1aJQ4dvpDoJzFDx0lp0x9UI6wfIKxX3nA==","signatures":[{"sig":"MEUCIQCa/a/WYsZCq9UTTBtKFabj9dG/4hARKDu2g1Uc/u+qpQIgLMFla2JyueMSB8w/0fnDn1HHXhbL6j0lD8CIouNEH68=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyU6XCRA9TVsSAnZWagAA9RgQAJb6uKj7ga9qP5cXGVcc\nIbW2N8Z2VJRwM68hwae7+agav14wYYmleeIbYli5EXEwPbFgRRqEEXl5eONn\nAYnYX7Et1VgJ7xVczk9kGKFX8UgFpAWHQczTRveuaSYmHZ9BNrZyi505Sq6g\nd0rfubIaq70+CH/tKOUTbw+x0kzLsbfS/foKH57HhzoG/CeDWx+9BRobpOHP\n1z9bQjLHw3gN4SGsxV6yKigJQvefcpjVC+Ouw1LZyH3UyWXervrVcA48FAMb\nfIMeQSqpsANlDcVBqgVB7K5XKtWOst7MaAGWhjYOb2S+dnc2IU2/o2wTfyky\nn3ixpe3ygJrVs+k9F5MuWU0Qqq/cxeIUbtU9Zi/Soy8Qe/OS0eair/5EDxBF\n7YLPYm1jgRBQlv9aQPv+Uev8FKyrCTuEoeQ6DKpYzFLJWiitGtVSXOuAnQMv\nCd2ZkCNN68f5h5kwter84ZVhzrss2PZ5ew+0yLSg2g/4oKH9Xif1G/0cPAFz\nCzIzALkvi+fQL8WRIl6kNhm+5HXUjLRNRPLB5LyIDYuX6f+BA4tJh4qeYqC4\n3BL/C2Jrhpp/klEraEi/rsPJyxRMxAxrUFT5oZU5KRLUJ0E+5vOE47gn86KH\nX05h9Fed1mGUT0hx7zX5SR+sqS4Pe5d7lhxPQTqFtPPAcjCSSiDwF2xr03Lc\nswJE\r\n=XG9t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2239befcb4baad98eef5bd67444b0f759e58a812","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.1c156d69d.0","@material/rtl":"9.0.0-canary.1c156d69d.0","@material/base":"9.0.0-canary.1c156d69d.0","@material/shape":"9.0.0-canary.1c156d69d.0","@material/theme":"9.0.0-canary.1c156d69d.0","@material/animation":"9.0.0-canary.1c156d69d.0","@material/elevation":"9.0.0-canary.1c156d69d.0","@material/typography":"9.0.0-canary.1c156d69d.0","@material/feature-targeting":"9.0.0-canary.1c156d69d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.1c156d69d.0_1607028375132_0.680856409610608","host":"s3://npm-registry-packages"}},"9.0.0-canary.832668d33.0":{"name":"@material/tooltip","version":"9.0.0-canary.832668d33.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.832668d33.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7cef9cf10c0109ce396bd2c4790158c64513804e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.832668d33.0.tgz","fileCount":36,"integrity":"sha512-r6hW6cROgQGDWUtU8YLqhOt3dA4DMOOPr8+GmbULWBWG1NkJ0M62PHaxD4qHtpJOitA6bMrHclMR7StKrlOSQw==","signatures":[{"sig":"MEUCIHFE6yLwgcfQWyTDbu0veqQT6zE17jdw0QqLeWmku36WAiEAghWR1YgfGpQsctcJGL4wABNt7zGM8KAa8unY2Z2dIi8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfynrBCRA9TVsSAnZWagAAeb4P/Ash2rfy5Yrq1kFQfQft\n/7Ry2Do5ImoWrTMexTZ1mQVexyiK/9+DbhTZcy06GpbNiCoVr2ePZcW3jPhD\ncfusOn4xO1xYM51I+SE7OBn4yss9Nn4pnX6EDsgtpPIxdKl2GSRSdW+pkzPW\ngkzO0KDdCK31v3VmT4fAATtz5X+48nZTawIu9D8UsMXt0zKsG75kYvWvbLGw\n3qe/EAvFh/yOJg4uI7SF1Ce+oLiR1xvLvaQxcIPttvxvqJTNmzagsYig3CJ7\nGoavTPbWprpJnplDd+V9Retm35OGI2DNg7JgRw3UvvWWAebrAC8+dyQGeL/H\nitTs6p6C+FuScaWfkpeb/E7PChUXdSYfItjov+ZQDCZdloNuSMF0nnMkVLRL\njn1SZXgDdOFtUviKCiVCkFYspYJySbU1P94I/5U3UbrRpIOhM0FiL9YCoFTe\nUD38Dyd35VRFtNQcq+V6JN3WWNfsadMFQKInrlFtEPW/hRZJUtMKIUFdv3Po\nC4O/O3pP1OdABXeTGMiuptyajqUJRTL7Y/GsDK0vRTfjulC2iLwNSerZCIm9\ncsbO79Y8PMK0AnNVHrFHeiGW5C9zF/Lf+bYkScTMEVsquTW5fNFPcqQ6dJmz\ngUMrMfZch8BTq8aMcAi+6u20M8PZdGJeobMqQp/gTIHbVasOB7mcUqNCrjTE\nqzhI\r\n=mlnr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5744d71a59950726441cfb1b4e3ae33706069b94","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.832668d33.0","@material/rtl":"9.0.0-canary.832668d33.0","@material/base":"9.0.0-canary.832668d33.0","@material/shape":"9.0.0-canary.832668d33.0","@material/theme":"9.0.0-canary.832668d33.0","@material/animation":"9.0.0-canary.832668d33.0","@material/elevation":"9.0.0-canary.832668d33.0","@material/typography":"9.0.0-canary.832668d33.0","@material/feature-targeting":"9.0.0-canary.832668d33.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.832668d33.0_1607105216853_0.7318391819521122","host":"s3://npm-registry-packages"}},"9.0.0-canary.4321323e4.0":{"name":"@material/tooltip","version":"9.0.0-canary.4321323e4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.4321323e4.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e1e37a61724030e100e8e78ef6e420788ec1b585","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.4321323e4.0.tgz","fileCount":36,"integrity":"sha512-DjMFeA+vUaMRhpIne6h6OmxtiJtUA95vTEpNaj5Vz3XiE0j8Wl52FBxAWDRqQ+P5ypheBm6jBsCBtHl7hxG2UQ==","signatures":[{"sig":"MEYCIQDYO0M2jXy3AzIMANyP5gPaXalTV2+jPUdsZLEGquCJbQIhAJE1g4+YJhnN9YHQB1qoURmDLFX8pXT5YSadmthArQ8q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzhI0CRA9TVsSAnZWagAATXYQAINyi4pS9olCO6J3J1i7\nVlZOVjGZ4VTaUep7cuF02iBJHggjXtSAiX/ud3rJhlkc/RrOF8ZNKoqV1A0h\nO/2hQkKlVr1CtWJPpJMpJh7X3M/u0wj4WUd5m94Bp5wuuFPjjtAWpM6IfaKs\nY2rj1YnrL8vnF02HRYhppedTplLVC8hVC2Q/NH/5If5Zc+4TjFKXqBDHm8pW\nZmrd6l8q3wQGG2NhlIstRonAAvvDjOrWkRxRU0460QZodnQRHNDGPzBfUN5R\nqJz8cS3F0oOnM90qqpAFAAdxSbZb1mhRIjkAwVKfC5bez0u51r3egn+lxStf\nA12iYrrlJVYYA1N8dVLO88Tprd7ZXbqRhTfmbni1Zpa3rRAg+tvJCFZJ/vM9\nEg1YZNIkZ8rT696GBjLtIQ6TcuVZqloVjI5Sas+4Bd2rEKVRiH/JOH36ePrS\n/27ZQfv/COVoHWYkebrAOM9y/m80WZW4NyVYvJ9F5is7sNrzJvdzBSv+msFC\nl/fQe+76Qy8Ll25JUJ95CgAWgNpQv1tyYku9TgdGOKDRBFzOKE+TOAHDhFlb\nnST6vc5KI49ny4acNXYXWh6Jb6MfzMu2PT+DF7ldZqQhkDIzOl/1pVVNfd7Y\nwo5BKdS+yzWVNP8TQ4VV/6Msq5IJf5+9McnFVQLFTP4rbbPuvOfgMH9JBSwz\nLw+9\r\n=1k8X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a838a6bc72ee56a967d493a841d4c69ace1f3f13","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.4321323e4.0","@material/rtl":"9.0.0-canary.4321323e4.0","@material/base":"9.0.0-canary.4321323e4.0","@material/shape":"9.0.0-canary.4321323e4.0","@material/theme":"9.0.0-canary.4321323e4.0","@material/animation":"9.0.0-canary.4321323e4.0","@material/elevation":"9.0.0-canary.4321323e4.0","@material/typography":"9.0.0-canary.4321323e4.0","@material/feature-targeting":"9.0.0-canary.4321323e4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.4321323e4.0_1607340595928_0.47391047339344317","host":"s3://npm-registry-packages"}},"9.0.0-canary.2d5f32d41.0":{"name":"@material/tooltip","version":"9.0.0-canary.2d5f32d41.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.2d5f32d41.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db423880efd5b5ab6e07a83e9ed321b98fdf99e9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.2d5f32d41.0.tgz","fileCount":36,"integrity":"sha512-5H1Jf2qU7AJ8T8OLnZD673TUcDp4msXt4/yP4fiB1c9rHKduGEZR9CIuidfBnu0pPI43y1m7UdctHFKlcHDyPA==","signatures":[{"sig":"MEUCIQDCCuozCiJNMHk+2JNvmkGGWO0T1kkpfExBr4+StrGIOAIgcN2ffBFnCChSATPmLzURpHJ+bol7G6UmjPX3e28BxIQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzluTCRA9TVsSAnZWagAA/UQP/j5Id/NfTvhVktKLYvr/\n4iNvJM/2HuchqS9IsvKrUxZbNAQQrHItKVkk/b2YfVXBC/xI2GZ65AS7DHtp\nhp0B+rDenX1XLYtEiPDDPwH2EzIb/GdRLmXuvn6BoTij/qet0/9ptErywhzW\niq8Fa1rsep7YHr9W5yVojQMGzhIZ68HGWcS+6Vc3l+IS4APyOEp8/6mw/Woo\ncCbsScGHUHFtsKHQ2v5fxSa28z2xpUv1n0BQCFjihOtDJYDQ67Y4yxwIAtFN\n4Wr3lHkEhAdO0rJxgKX8onV2PtmXzHtsl0JjfPW5K3QrvrSk3kcmg6FhyQgZ\naE4Peb+iqJNfbCZq1FTaDzU8Lcxfla9Cy4m0ZLBNaRa723w+PEgdjsrinwJM\nysa3QYTKf8PtiuyYqX6Tsp7FSwCqx01itiGP16s+hu70k+vLen92WT0ozHV4\ngbWOkgzlibQcWUOBvpPxkNqtBCdzIFYg0s1SqxUq9Dn+eUlpbudSiBtjl1h+\nBjDmi+/6WnNRv87GrKw5WfJFPK3FJYOQiqWgkgXmXvrQclxZpR/tKTbdKXPs\nSnA0o6pZjX4dqnMK2AuPgowQ1IPOH5TQw03zMuO+WzA5BgejzwrrrdF8gbtJ\nLmDmnjYss0e4kurRloUlyFlV4qlx15gg8A8tt1lN4kBsU5Qp5l5i1xt30wvG\n6bXl\r\n=9z9z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2c385d3016a738d32bd3c03bcc91bccf82981fed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.2d5f32d41.0","@material/rtl":"9.0.0-canary.2d5f32d41.0","@material/base":"9.0.0-canary.2d5f32d41.0","@material/shape":"9.0.0-canary.2d5f32d41.0","@material/theme":"9.0.0-canary.2d5f32d41.0","@material/animation":"9.0.0-canary.2d5f32d41.0","@material/elevation":"9.0.0-canary.2d5f32d41.0","@material/typography":"9.0.0-canary.2d5f32d41.0","@material/feature-targeting":"9.0.0-canary.2d5f32d41.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.2d5f32d41.0_1607359379391_0.44608256612671604","host":"s3://npm-registry-packages"}},"9.0.0-canary.8239afc64.0":{"name":"@material/tooltip","version":"9.0.0-canary.8239afc64.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.8239afc64.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f681cfd9706a10309a13a035f1ec94e8e2230501","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.8239afc64.0.tgz","fileCount":36,"integrity":"sha512-ZjtQiHPWEyQ/OUEozrX8icekx1+IXodsmlC7MSp4wWI2z5mdAjSkmgEh/m2gmuUZznm5WNKtc+tANk8AH5ZVEA==","signatures":[{"sig":"MEUCIQDLGEcX0VbBeIxVfWyBL2ZzJhFu9/antiqZevgxb60bhwIgUDuEhnnLTS95dlcleVrPYbURA1MYwAqg4lVvT4fMcjk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":445646,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzoeGCRA9TVsSAnZWagAAMIMP/iRXvndsrERE0hcf1sGU\nP+n2jX0llgyf7jsBlO0RSSMWxOe2whrw7JrS33Z5/c/+4oLk5nnB3XyEcZsr\nok/cJQC5mvd3a4z16CCd0stMvMLhmpaZkQHckggJX2Tim5t6Eg9AJEbvRiBa\ncgkCl7cAQtXoceDgzlrkr/kcxuOyNBgryN1cA8ah1Aac63p3mYD8sF8j2BBT\n9n/xJxl1MSIVzXjGwBtI8dV+MvO+u+uiYQlF5F7ikoZUdp5R+QscCFP4WtoT\nomxtpgRz0Jqf0YX8opqsdUYOPx0jPgAh5Z7v/vLC3rAOG54UG8NQj9VFJmPB\n1kP9AQ//KBXST8vcaM5V2xQAGYBG0kjBB/eyR7QdkZZI9unQgjM/04PNPI46\nphzVWbiaksLmIYRqA6S5R9jHKbayc90GwuqBkvLp7MKGeTmqOqUt8X1E5D0f\nRg+hCsljc9feuHOmp8P/Gj1a484ctOWY6O4c7n+hD5rCNWdW5Vht9yGDFk/1\nQ3LK9DfKk//boxRFbGY0apSA3agQ9l6an253bPXabVCxlbVfl8lSpyRESJj/\nO+5Ed09l+5RJA9s+WZlWIyqSvdZ/+nr5Pda5vJgd51m6fEbxKncMZg05DTrR\niz6f2iR9JU4GimKW4EWtBi1bRI4wyY319w0IQEIFm642r+0my9Yug/tAGvr7\nL4+y\r\n=POTN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3ba24284e7fdc10c5aba869e2a2d3175867e0f15","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.8239afc64.0","@material/rtl":"9.0.0-canary.8239afc64.0","@material/base":"9.0.0-canary.8239afc64.0","@material/shape":"9.0.0-canary.8239afc64.0","@material/theme":"9.0.0-canary.8239afc64.0","@material/animation":"9.0.0-canary.8239afc64.0","@material/elevation":"9.0.0-canary.8239afc64.0","@material/typography":"9.0.0-canary.8239afc64.0","@material/feature-targeting":"9.0.0-canary.8239afc64.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.8239afc64.0_1607370629685_0.4005416026875481","host":"s3://npm-registry-packages"}},"9.0.0-canary.6871336f1.0":{"name":"@material/tooltip","version":"9.0.0-canary.6871336f1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.6871336f1.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b7d70131753e0ffd104a8a024b85da4c53690ff","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.6871336f1.0.tgz","fileCount":36,"integrity":"sha512-5UUjr0eqqRIyiAiILTW+VznAWn6YYBV7pt3BLfJcBZYa4B7g8KWt2UYrbsDR1/gD94ZHyLNgv64IjizoihZhCA==","signatures":[{"sig":"MEUCICbdj0llisXtREmxeSvYrfgFObXIz0/fSqPbbtt4qeGcAiEAn9rerzn7bfm3qlHfgxhjd+NWA4rGifSxyaS0o0y3Eb8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":449703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6OZCRA9TVsSAnZWagAABUMP/1Xwti9ZFQ7OffXvHVzo\nZMICpT3vKv7jryY57jxhlV9daLGO/IaHOSrmhgC5Afv/EWgLL7P8yOBfAHzh\nBrw3vSMTkqI7fM4ZGD4Hcq9cdhoxdmhkXkg9rsACxLMW9Xqr0uBaGVZkP48k\n26Q6EtRUuJzRqm7hTSvUteopDn4DVk3xNBmWtFNislZ9OL6jH6ZRkDidmYkq\nJnvA4Yv7Re/X3DkmpAUXBswImwsAESOsrUTKJcPBwQ7gHAuKkWO/4RjS4op4\nB2TC+1wVyAwe3ps3n1XV/heHm3IabKpf5bDB/VrZ486lsBwg048NRj69RVN/\nR0EgwmO+Ib9B47d2L1k7Etx4KPgLJUgPultQGa5PoJKsl9TS8cIsMa3XubI8\ndiOqFF5+o06yd/OFVQ/XIKr3YRCi90YLRz29Sk2umkvlu+FqvJbz5KvX0WJ2\nFI7/Uc4NuLUN9HS9gbiRbXKPlD4upHVjuIM+DX7grjpc+GjLVyQIx7xVoUg7\nnxgiJ4NC4gE1SoyfB54/2HirreJlWVEKCJKwAQPFPwlorv68fgp5JNPsKSnI\ntYcYZC1cLV3IkUkeA5YhffP1unMfaBA/Llk5sC450e66wOSvzeIxVWivug9M\nspK9N2X3x5A5PA6KEmeYDvQN+QAxVJAWBNZouEdgL1by2SGBCizNqVFdRnb8\nr9Z/\r\n=Dzhj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"aed20b07d4f2597c382a6ce4b7c723f6df0c3efc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.6871336f1.0","@material/rtl":"9.0.0-canary.6871336f1.0","@material/base":"9.0.0-canary.6871336f1.0","@material/shape":"9.0.0-canary.6871336f1.0","@material/theme":"9.0.0-canary.6871336f1.0","@material/animation":"9.0.0-canary.6871336f1.0","@material/elevation":"9.0.0-canary.6871336f1.0","@material/typography":"9.0.0-canary.6871336f1.0","@material/feature-targeting":"9.0.0-canary.6871336f1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.6871336f1.0_1607443352714_0.595584333344191","host":"s3://npm-registry-packages"}},"9.0.0-canary.9f718da94.0":{"name":"@material/tooltip","version":"9.0.0-canary.9f718da94.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.9f718da94.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9da480b6ace76a5e29c286a0ee15057622ce3cfe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.9f718da94.0.tgz","fileCount":36,"integrity":"sha512-iQYlW+5d53+NIXgUJr05ZVG53bo4KL8F3OIE9WDDI9G0JMLjPM3MHP5gbRRJwiwRaOCTwGAR19ksl1MrU5xMfw==","signatures":[{"sig":"MEYCIQCGJaEg5Cz/XLbTj0rJojPs4tbdtSXFbLlVmrKwbjhkYAIhAMd5yUPzxZensx582peRkjJgAB457CBRCOZTLu4tZR+t","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":449703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6ZaCRA9TVsSAnZWagAA13cP/14wOx4WZW0spR/qzgI+\n/WPqrf8vVeAaai9mhXvr4vbBSsjyqV8mhxALBsBkwiTmbsDWasyVdX4tJLTM\nguyp39AMzFq3p9RvtPmipFHZVOP7YakSe1QXS4PNgEK820T/nuWH5s6Q2qQ8\nDzQMG5rFfd15bB/Ut18KRa0llmK1+0Oe/MEgCGZe6BZjRQtoFlKJY+ulajzS\nYO3PNDf5Q64XIVosDbYxg/SCF5P6eoEyseeu/rc9Fd5iuMiqp+5eTnhheguv\nKNeAicWECbp6SfauRi+Bi64trTGUwHGCwrd+XlKeB2Sx87+pOBNJG5EWdkiY\nIG0VfI3lJyseJj5YdTe7ROYapHS2OtI5Popyut3yWDp44V20PldCE0B7Ikca\nSNajCN7oNiN2MtxsinAwXfqhB/V5B9FTxUvj93n5i14D+Z9iTmBSBAkZ+Vlc\npsrYhQPPfWB18Eo4O1LvyTqkrBz5eK5GjGg9sEzgWor20uxLhLhBGq7sY2Za\novUb5PeTME9P80/kQUAyjB38ClpgiApf4Ja0JMRue0+HuNbAwFeQJHSw2L67\nszZRkRVwfa0mAz2+lkYH4zelr8y7N35RoR3IT3iQJqQgoTClUe623sNIZ2cR\nKBpKq1srss9nac+w19l899w+UHEWWzFkNKnga3iHDYFeGHnqIidW/nOqRdD9\nAte+\r\n=tyIh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7fb6692f329c5482f22dc9fe691a20fe4c6dd38c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.9f718da94.0","@material/rtl":"9.0.0-canary.9f718da94.0","@material/base":"9.0.0-canary.9f718da94.0","@material/shape":"9.0.0-canary.9f718da94.0","@material/theme":"9.0.0-canary.9f718da94.0","@material/animation":"9.0.0-canary.9f718da94.0","@material/elevation":"9.0.0-canary.9f718da94.0","@material/typography":"9.0.0-canary.9f718da94.0","@material/feature-targeting":"9.0.0-canary.9f718da94.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.9f718da94.0_1607444057718_0.49705607136124486","host":"s3://npm-registry-packages"}},"9.0.0-canary.1fccb1418.0":{"name":"@material/tooltip","version":"9.0.0-canary.1fccb1418.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.1fccb1418.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9ed4b03a41c921605a51827fe3ca62161a9174be","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.1fccb1418.0.tgz","fileCount":36,"integrity":"sha512-Thd9gQKTOsUknncWO3XRdvpuyz78y1iZ8D8CJC9tKmMC4HknIxw4mHjPDwolDG8YteUOSv7TUJV4mUJWNnvvxw==","signatures":[{"sig":"MEUCIQD8rzL4040pCOl0vEPn7sJOcdvez2xpEJptAdiVxOGG6QIgM7+UzJCOMHAk5RJLMYdAJ0s61GuPHR+OhRLbbByviSY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":449703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6ncCRA9TVsSAnZWagAAE9oP/iun+bp3O80H9zg3xb9U\nroc+VRXpWZ8bjkWFvO1wZbatZNdLXg7zswIxHdX2veGNE23my0QbvR7Db+Mu\nJwd5HFcow6ydJ0yttv5vC+Z/FYIUtN0KYtvoHF8qlhH819IF2NFDzdiHvFHq\ngOv7IhzAVFDE3BaDxQJq9tpXK72cQK18tTXyK22L4jWkgGumhJsrgUoL7zAo\nw9W6syr4pFHIbMHz9dpnmaiRd/VZQyANfM4fBb7itrz9uC/UA3sxYn1ZWLli\ndWlaGREiDkdJmu8RNiXzxSFkz6R8weyo8hHrYeCM33Fus2BVYiJSbs2dV3fF\nc34ZrNf+OLwzArFD2ZBPmDtOLzT+qmLTuPALPnP5uZ5c73zn+CeL3UAa7MJE\naeuUNQZUY2t+1D7R1wRiCORP7GBfTu0Es10rLfhc6KeYScAz2E66wpuR+5L5\noS86vW5RhO1slNVypUUSu+YFwFLSYjkZ27hO48iuThZB5DpaqEfjB4OS/hh9\nJ0sVOyhLgJ+h3AhPrm2iOjURcjkki1k+P5CT/xjl0q0pK+fDw8s5UKY6AexG\nnYvZiH+96ZooFLKBJZ1uuUqzYF3vIg9Qo6cwcY0yg0RGMz7pMp68O3t5u5kL\nkK/dt326sp1Z8WxIWv0dPl17o5tXWAecyWFDbVVtzfqHW+Wb52zMNwIL7dAW\nI2Aa\r\n=Xa0V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f9dd96ea7afbac37dca91bc879dc44ce4523c442","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.1fccb1418.0","@material/rtl":"9.0.0-canary.1fccb1418.0","@material/base":"9.0.0-canary.1fccb1418.0","@material/shape":"9.0.0-canary.1fccb1418.0","@material/theme":"9.0.0-canary.1fccb1418.0","@material/animation":"9.0.0-canary.1fccb1418.0","@material/elevation":"9.0.0-canary.1fccb1418.0","@material/typography":"9.0.0-canary.1fccb1418.0","@material/feature-targeting":"9.0.0-canary.1fccb1418.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.1fccb1418.0_1607444955719_0.2280097874880691","host":"s3://npm-registry-packages"}},"9.0.0-canary.afb68894e.0":{"name":"@material/tooltip","version":"9.0.0-canary.afb68894e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.afb68894e.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"11e9a1f640d3cbc004ca8bb6654cb5ec08bd4a51","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.afb68894e.0.tgz","fileCount":36,"integrity":"sha512-/wkoQvRlGa6pizHXNSF7I26I3yXbt+trMrS1ziZ6muWgsosvkI+qLK4i4KdljkdcrET+2Dh4tFoqVHOFzLE8qA==","signatures":[{"sig":"MEYCIQCtyOVy3a6PqX/d5uEiH+iJZwAS/+u4OUoqoTzOmx5uvgIhANTKuDNOErk1U0OrwuAb+y0Hwjaq7QjHZt7vOX/WMt37","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":449703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz6rNCRA9TVsSAnZWagAACHUP/3PGWdu79sZPW1MH4+II\nv7v8W4KUHo48v2KrITUB+Rq4kHTBP8VaNDA3NfsClYBJ4IMPhpfd4JE8lwLL\nSWpDM1WLj7YCHP/whdFsRCHi+lFUIFSE6OC1KAKMk9BnF2drrqCcNWuFHUwf\n1YN7eEdnQo7qY5Vl4mYeEDVqZ49aJgaQO2icZsUKk4/B1kr5Bpg+tBRHsnZw\nomoahsvSLFCdbxkgDzTZfUHCNq4pBLbYe2o7nhEOHljUjxvsT0q5iajCQWxV\nyyB/eXGhymcGTr6bh9RKHazdk4RTHk8DcJsQX1gLHjC4T3HIDT1H+Pp8dntS\nVdk31XG+yVRGDqnD75ZzzxvWcGTR7exl6YrSrBZi2i7V4Z5pJGWrFcrSaOYk\nLM9/xCKsse9XzhZ7cTXHt8r2/YoVzv19hJSbKvTwDhn4AaC/tbR6P/B3w6vO\ndIpyw8rQghL8si+eiRA0ms8vHJITVjnWRBuSzKtrrLzeXycIPNEWIhOpTPo5\nr6n623rHsDdpj4N0IsZhSdF3Iw7DXsxHHTlBPYcfE8+vEq90VQZaix9dey63\nG9frUxmCLrZv2wVF/9uLXJLRshVOH/ZhzLLz4NOYPIElcs+veRD8ygdy9fZU\nH/nHMLcfNrTOS1iLLarh514+kBvEpQMp2IlLc99BfH78ZJtLotn3CoMrXSfm\nsFol\r\n=j3nP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8a3ec1a501083d67f1c342fcf5b11a765a586ca0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.afb68894e.0","@material/rtl":"9.0.0-canary.afb68894e.0","@material/base":"9.0.0-canary.afb68894e.0","@material/shape":"9.0.0-canary.afb68894e.0","@material/theme":"9.0.0-canary.afb68894e.0","@material/animation":"9.0.0-canary.afb68894e.0","@material/elevation":"9.0.0-canary.afb68894e.0","@material/typography":"9.0.0-canary.afb68894e.0","@material/feature-targeting":"9.0.0-canary.afb68894e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.afb68894e.0_1607445197323_0.2285382012967121","host":"s3://npm-registry-packages"}},"9.0.0-canary.fd88d40c2.0":{"name":"@material/tooltip","version":"9.0.0-canary.fd88d40c2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.fd88d40c2.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0d7885169a1ce835fbb2da6d6c5b66e30aa75c00","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.fd88d40c2.0.tgz","fileCount":36,"integrity":"sha512-nNPW1sHON76VMXF4M7Yp/2piG0D8YoKgSFl+JU9O8zvVNKLc39O0p9+fwna5n7UFMPnWyOxAX5jagURZDkGcQw==","signatures":[{"sig":"MEUCIQDYAwNtOW2pLPX/rL1Rn8jevSAfK/gE9qzHDZweS1cO5wIgFfnrPmfMw4tbqob3FEQ+j+dHwHlkZQbwARqX6Ud07nI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":449703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz64DCRA9TVsSAnZWagAAUTsQAIBC5So+Y3c7bgYfl7FU\nJ9OICzfkO8b8t1In5QrmOdWnxpE6Il+6kYLp0KOf24hLOF5UScacFJpdwCmA\npHa/JUg9b+23d9ZsVGbB+aGmyRj51NChS3VH6AE3QK1Mu3vy5st9hL5+DwhA\n7zuUeMckEFhehjFmRi3B+3wsS9EMW2Ko5wfqo/Jt04FIv09+42gjpaf/IbR5\nsTX33PTInBN4Y64Yq2YafSKBWyV1cAnjF4Y0ajU0NFHLCzWjFGKuMxQrKIDf\njkLM7yVdC7iosZoesPmrim+V/UlvVn/JG1Ox7i7U8xtDaR7s71IkklAgo+Og\nyM35cL6KbjllVP9C9SaCN3grxwscTLaiK3m7vE83K42iE8qFkoRc7YV+5kb3\n5OJIVstGXrBJVPJfihH9+IDtG+/5rIetMEQL11XxYhd/IXXbXQS+8nEa8uiC\n/fNjQterfaCwxInrFvayd7/+S9E0evR1Eq1BDNPXvebvZ9lJ16hU4wC0szZi\nNgAHY3HX0KPscsuANb3LdTiCQYmeB6BE4k4b2l1ni44j+MpRaUijfManslL1\njMim43Opk8qlZm+hSDgW47oL6MKiOogmW+h+/7Mail5HlOeabuoYOXim3GG4\nOMRCTiZTWdEeaRxgYDe7Yh4OBT26CpUHAVPT70ewF2dIDPmSfm4iVmk7bI4B\n+pR0\r\n=0RVA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b0f8299700bd0ac44ef5acfdd0234b464d837131","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fd88d40c2.0","@material/rtl":"9.0.0-canary.fd88d40c2.0","@material/base":"9.0.0-canary.fd88d40c2.0","@material/shape":"9.0.0-canary.fd88d40c2.0","@material/theme":"9.0.0-canary.fd88d40c2.0","@material/animation":"9.0.0-canary.fd88d40c2.0","@material/elevation":"9.0.0-canary.fd88d40c2.0","@material/typography":"9.0.0-canary.fd88d40c2.0","@material/feature-targeting":"9.0.0-canary.fd88d40c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.fd88d40c2.0_1607446019446_0.8815385023649849","host":"s3://npm-registry-packages"}},"9.0.0-canary.ba9e3109c.0":{"name":"@material/tooltip","version":"9.0.0-canary.ba9e3109c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.ba9e3109c.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4bfc88742a46c307926032ce263fbc083d88306b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.ba9e3109c.0.tgz","fileCount":36,"integrity":"sha512-4pG3xDlfwzaEJPfT5yXRgSXfrujPZET73jQOz6d1Z+EfSH9VVGHUBn+BBXeStMu7/ZJRF7NyRpSre0XTiu1cNQ==","signatures":[{"sig":"MEUCIBWfg12WR3wbEGoGsRTsrBfWxBNy3LE0mM+ABy4yE5q0AiEA07kgNFfyR0UC65kx3evMtIedakqfinVh6QNGP2TuCdE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":449703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz86uCRA9TVsSAnZWagAA1AQP/RZZYrg0xri9IKsPC6Th\nAfSbVfT5kZo2/VFIQLos0Zz8qYpudw5nzjRTbhuRo9xpyaBdio2os1souu3j\nde6vWWm7YHnEDFfAZ453RE2a0F9htVVqL8e7i83F7YkB8kfAwV5WvF4dc6RD\nuCteUWtIcV+R50/JAEBW+qIuesqBJYTJDn0Q498gcf+i6U1eBgyzpOraOg1D\nWxnFjEKMwfIX7ljHJJj7kKSLtdEIxojCqUQwjHlb+3UgV0i0Bbod1nmUBG7Q\nrPP4a//BWwMdZYfOuynFi4LPB/8C6yJRPY/dS5fwDhW9xAoDu7/hnEtivAHo\niQoi+sY9DezOvjZ/i+eHmOa4YLi3I4Pl4E5s5fd/Ebewz3NMHUQzxAxb6tUD\nOrkT7euGTbgtPWGGbFB4IRzMh6zEc+1k0ieZDiDzhtMqVU2gpC+c42TUiFBp\nwZ/VXjBscnz1oLZ8IYKc9SnOJZbOx/hRi7acAathzFIE5E9upIrssKlX3j1K\nWQCAVTfOTfpAtdpxZNQggxPbuTR3z+tlref7sE/GJgkAvc9ItVyiT4TFs/ge\nvUR9yoRh7lkfXm0WBPlX7KTsHGvTM2lgueqHjCND+cdazmSMnlhTvYntZKQs\ni+4A7gh/eXC8G3mTKmY24J+SZC/t8mAfWq6ao9dEoSlkF6gOp6KVBW36sNUC\nF6Ue\r\n=sLhy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"84bc4a2a193fb62b5721555a77b59e7bce321bd3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.ba9e3109c.0","@material/rtl":"9.0.0-canary.ba9e3109c.0","@material/base":"9.0.0-canary.ba9e3109c.0","@material/shape":"9.0.0-canary.ba9e3109c.0","@material/theme":"9.0.0-canary.ba9e3109c.0","@material/animation":"9.0.0-canary.ba9e3109c.0","@material/elevation":"9.0.0-canary.ba9e3109c.0","@material/typography":"9.0.0-canary.ba9e3109c.0","@material/feature-targeting":"9.0.0-canary.ba9e3109c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.ba9e3109c.0_1607454382523_0.7735087858203198","host":"s3://npm-registry-packages"}},"9.0.0-canary.1085c3b2d.0":{"name":"@material/tooltip","version":"9.0.0-canary.1085c3b2d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.1085c3b2d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7132be212ba0a5ba656d85e1785474e0683bb0a0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.1085c3b2d.0.tgz","fileCount":36,"integrity":"sha512-t7j4E8co2+X2fYrhA1FburTSp8ddF6eJc7Clc+Bakk/IQ3/OYTgXRN8ouZKCc6YPpa+FfdTWwSIfG0yHnsB6oA==","signatures":[{"sig":"MEUCIBXvJza05sHODLDvHwgSW7U7AlzJxzSxldkSOmfXq9quAiEAsMd8oX7zUZRAc6AZ/kgvmXdY/14rp4CDuIFSCJgk8O8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":454553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0SGDCRA9TVsSAnZWagAAENYP/isd6NN6h+mAmfXc/oXB\ngP7+4bOMEZtwXonOikCW8PXEGGd0xaHzKjJd+j2Wnq8PEc3HqV7SueKNfhGn\n3dkYzWEosshea7WJKT0TVnXxzJDwFNEnBIjFMJxHI+TSB1kpzGxHO1wGHr73\nzIXadt2/d/Iusr6fRPgcspZ166G48pWLZ8s1/cokwKRrqpgYb+vnytY4JVcz\n0qdxbI2BtXMF6cKQkDG/EBECo3NYFh62YDB3G5G5CUSlFNq60buHtlycnrbv\nklnEwSJsLKZz/+AGW7K1/RKxGA0uujgOnakwi7SPeJZzOU7Ng6Qj8ik2RL0t\ndD1UqCucooPipBMHAbh+qKm4Vm0SYQ3OM+C3n8G8xR6cOBdCHvv4t2m3HUTQ\nYH9Eh3Ry5t/fRRwuDQS1Wn3jDGAFeG1b9zVDruA55zxGkeA0HesDCMf5BlDf\n4ZgdddJlUpma2hk2LQPY8QpqY7wHGjYUhZnE1yLZ1S+XN73sd+QybqxTkhu7\nhfW8CN9fAXrAySYMoBvMo9vzBA+og4WdGki06QHTBfoReNltFNABC91LgP+2\nYyxvWYcLfRkshZnm3xG3+qqcjXdrqTYOZ8pZCRhFH6qM2vPqzzpTtl90v+4s\nvgXCwwLwPZO0neeFkoVbWl05pkCkoqGjll54i1voV1H4UQUEEPeAtIyZmE+4\nwL3T\r\n=xl0f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a223e0b83a78bac523ca498cc8389f361cd0f4e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.1085c3b2d.0","@material/rtl":"9.0.0-canary.1085c3b2d.0","@material/base":"9.0.0-canary.1085c3b2d.0","@material/shape":"9.0.0-canary.1085c3b2d.0","@material/theme":"9.0.0-canary.1085c3b2d.0","@material/animation":"9.0.0-canary.1085c3b2d.0","@material/elevation":"9.0.0-canary.1085c3b2d.0","@material/typography":"9.0.0-canary.1085c3b2d.0","@material/feature-targeting":"9.0.0-canary.1085c3b2d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.1085c3b2d.0_1607541123195_0.7872396504743406","host":"s3://npm-registry-packages"}},"9.0.0-canary.c5dda809d.0":{"name":"@material/tooltip","version":"9.0.0-canary.c5dda809d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.c5dda809d.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"587413c33b41d05de4ede9c82a90f0fa40ad11c9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.c5dda809d.0.tgz","fileCount":36,"integrity":"sha512-x7JWq60BqGeRP1lX/OK9rfrYkM353leWT9RPvNVYBRv1qnECbGFPg91AcYzkDb38EaKjlbm/hMQ/Uy5Iqoy+Ww==","signatures":[{"sig":"MEUCIETUaQCuic89podpY90CRJrLVBT3vaQkcaWxpVyqqDuFAiEAy2UJ5iRvjbCKKLNZO3fsT/ODZzsaP72pGVuAFFbboS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0Ti8CRA9TVsSAnZWagAAej0P/3sipo5gl7hvQr3lZuRd\nv73pHrF1WTd5LQxqYzYUEaK0MIGF1rQgluslW4Q7ZJ4J5/ElO0SkXb/Br2mi\nu6+tkfqjFRLtv3tpbGz2EeTzHclZahIuLdpfdV6Ul6IWr7c49yWAvcdN7Q2a\nmRbz8RjUXM02Q6tqNBjHYap9GZgpcqWz3oBNZeWvtFRU3kJl3X/yQ27BNJJQ\njd2mev4tHNW6u2moG2CuEbWSxlCBKoVLiJK/wLsQ/i2GePFl1BbT3/kQziCl\nKmo0WkvFNJK1d6fWydKTpvpI0WTE/97cb2sAh6dZ2j+Ax5hhYiqkyVgHgkAb\nvo8UzyEcplPZm5SdoMYbAVdnV4mC7+bKbOgtibtVZ8TE6dBWkvmXVFbkz9Xa\nGNm2g16C23L5EUJ/E2UczxCAicfSkTZKTLwjQ/4Efop8UpVIO4csM6NOvyps\nOZ5lVbjrInE2mPFlT97U0wB44Aj+/qKzwKdjHmzDCtUiH4a3D/xMEKf+rgss\nxh0CqypGd5gCutpjD+dZbMvOdzKib88FjYimRgWzyIa+nvUzA5jXOrlTxMcQ\nHrAu4lwQPSVN9B40h4P4UhGlyMQez+LJ6JnbcwRDl/ik0C610BvJB9CVTNYT\nGoIyC8Cs6v9Fsf4AozVhBmSLMcrRLLcnzPzxJVcY4wdWif8mHXxvwF2uS7l2\n5fbQ\r\n=38lT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c2bc7206e40f2f31377a09e53af457109018ff02","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.c5dda809d.0","@material/rtl":"9.0.0-canary.c5dda809d.0","@material/base":"9.0.0-canary.c5dda809d.0","@material/shape":"9.0.0-canary.c5dda809d.0","@material/theme":"9.0.0-canary.c5dda809d.0","@material/animation":"9.0.0-canary.c5dda809d.0","@material/elevation":"9.0.0-canary.c5dda809d.0","@material/typography":"9.0.0-canary.c5dda809d.0","@material/feature-targeting":"9.0.0-canary.c5dda809d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.c5dda809d.0_1607547067699_0.30476271106527286","host":"s3://npm-registry-packages"}},"9.0.0-canary.f5f1bd86a.0":{"name":"@material/tooltip","version":"9.0.0-canary.f5f1bd86a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.f5f1bd86a.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c25592fa889db4a39c8f233bcc42c0f86337768","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.f5f1bd86a.0.tgz","fileCount":36,"integrity":"sha512-zY64a9nYJVWmfpCA++dg1vRbA4f6ga7balM15tmBlZlYLvlpErt0qquWqtmcU8RirvL9A/GjLWOY5qjksZnXtw==","signatures":[{"sig":"MEUCIBDQcIAxfRw2xaZ0OB+YDt3hohn69FlpiRnQbRb9nAVqAiEAp6hdm9gUsTfPg8z2cDCoEFJQvA508mvJOW8n4lyN2AU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0TyvCRA9TVsSAnZWagAAXvcP/2rOUJNLBRAyr6lTsaje\nY5zLXQY+hu5S3WFzy87AKSMcEdnvoujDZxoZJ/tlFFaRA62kl/BYjQCrodkT\n5XCKfSEUe79cwAT03/nMIoJhl1RBwYSdGgQZUXjIyhfNtLgBhHYb7JskwQ67\na0srfEklvRVlCo3hFdAk1nXMrOxyRTcz+Ui0QLuTJyiGdI45LbvHN3AM4HeN\nxZGIe2fJ5NTDYiXV1BsKZc2siXwirbE1BD0mxhKTAFrjWSBxNZ0blh6XM69K\nbVpPSLZQma4fENRUQ3KRTHMnuyyOgbScFSZD+AZrAp7q6LlJqCmXz9EZTNKs\nAl3L64lUtqzBuUNxj1niWHT7MznosR/AATnZvk4lz0mX88u+WssORLHqMAAo\nPQc5tcYT+5qr6q4tDcSFlqbKkJk2LPUw9+Y6svh88WuANfWeCc1W2unHUg7s\nxYtz0EVPlyzeCNiYuxVnrs5jYRVfdjuMGMFNk8Yx1o/cDDQbCo55y9sh14wg\nE8HD40RMfevcUy/Ae8pLkfBq9ff8T9XYp92h/vcKTZ8QUsPNjpy0dbubu/LE\nvLPGcd9ZOh/gUk2lvK4VrYfYK4fD4T8bo458INRk1o55haL/REwRRQHf0g7U\nFU9r1lPj19UJrYy82ZMu5DznAzRBmSWs+hWbJ7eAMMW8IZxtArXJsrtc2cpx\nDcNF\r\n=V0rY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"86cb1fcac08fb433af0662cec8583dcdf435eede","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.f5f1bd86a.0","@material/rtl":"9.0.0-canary.f5f1bd86a.0","@material/base":"9.0.0-canary.f5f1bd86a.0","@material/shape":"9.0.0-canary.f5f1bd86a.0","@material/theme":"9.0.0-canary.f5f1bd86a.0","@material/animation":"9.0.0-canary.f5f1bd86a.0","@material/elevation":"9.0.0-canary.f5f1bd86a.0","@material/typography":"9.0.0-canary.f5f1bd86a.0","@material/feature-targeting":"9.0.0-canary.f5f1bd86a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.f5f1bd86a.0_1607548078572_0.7987412199056194","host":"s3://npm-registry-packages"}},"9.0.0-canary.00f38200f.0":{"name":"@material/tooltip","version":"9.0.0-canary.00f38200f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.00f38200f.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e7b78e8408c5628d62211cb1ea01539d83212ca","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.00f38200f.0.tgz","fileCount":36,"integrity":"sha512-Xi3PZIrK3At0ARMebGRa1LWK8/lF7Eyx8W0WGcoQLSj5PWWc1huUcl99UTUX2051cQhEJYJ2A4MjR1eOVtWIfg==","signatures":[{"sig":"MEYCIQDYtBQ2GnZNn53OR/H7WbzPJ1mQXLwR8hyD5235AcjE4AIhAJHMNme5PwhFUyxt9tgVlrjRgKsqH++Y/A81COPLpj3U","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf05R9CRA9TVsSAnZWagAAaC4P/jcTy8yNTic+A2Qo2EVI\n1wzqNJfgxn+QNCHMVaGkPqgFH6Q1r98PwPKLP3+jHCnInS4ROG2faW1P6MMO\n4ZghQ8D/cvmX9s7rm/kn9biN0HckdTg/kW5ZM0Jmo+sjwtVMatD8RXT2yiwk\nRE8pdKx9a3iKkXpYx1af+FpJC8X390kKtyRHpfIMiW7fKkxxNWf3NZdY1jSG\nYOo+bmg8inhuEAr1VgpYYF1iWuOClDLPP9fLOHrY6ySB4NI0jDYHSTUWFAGm\ntZTOKEzJgnp6kqDoKvJsyMUnqz33uwNf2ysKZTG7zTucKkvTZLvn5Fh2sSJW\nJB4zzH3GRcLm687G8Nx3Cu+tOFsxvwAlZyH4STZ4oI0QQ9NVso+ojVGtmBUs\nh8ybEa6zEQ3Zsuq0DzkAXkCFL7osCm5LVMByOeElsYvr2vYiq8z0f9IBDwta\nvncQ8GIFAvE/0TQT2JYzRJnHDHz3fYksfdFFBiG23rSUkpPcL07vFAQYLgL+\nJtw7bl0S1dLFrtiOXd66D7n4rOl5cUlXYKOoIg4Mjr3DSrVUNyaJAHmZkV20\nJIGSiuiiE7/4uOIv+2j7GsZk81j0tX+BqqGZM5Zk5RBCIBV+QMdMJdvocbBJ\nQH6gT13Z75YGbdT4JnUJWaHfQfw2WecvRRb/mi26lANaifXHJ7cl6COOEDGl\nZA3U\r\n=2AuX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2771c0048541c1dde142fd7f565741f0dbb83c20","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.00f38200f.0","@material/rtl":"9.0.0-canary.00f38200f.0","@material/base":"9.0.0-canary.00f38200f.0","@material/shape":"9.0.0-canary.00f38200f.0","@material/theme":"9.0.0-canary.00f38200f.0","@material/animation":"9.0.0-canary.00f38200f.0","@material/elevation":"9.0.0-canary.00f38200f.0","@material/typography":"9.0.0-canary.00f38200f.0","@material/feature-targeting":"9.0.0-canary.00f38200f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.00f38200f.0_1607701629168_0.8135799495902092","host":"s3://npm-registry-packages"}},"9.0.0-canary.ac41a5729.0":{"name":"@material/tooltip","version":"9.0.0-canary.ac41a5729.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.ac41a5729.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c7adf844402fa9a8616de31a5fd9f593b75faed1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.ac41a5729.0.tgz","fileCount":36,"integrity":"sha512-Ue7NbvTd36zTnM7BGpxHjEvcosLzR2HpVVh4eLOJ0nc07PWudN2IAfycc0fvuHLbYlwf2fHOvtwl4TESvVE8Lg==","signatures":[{"sig":"MEQCIGYNVyABVlNaZsJMKkggnyN97ivxLuzA2j4c1McgPEUiAiBa6eHTgJ9C5WmDSFs4AHg2RAAfcCfVwFM+h0Y7TUsp2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":459266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf055sCRA9TVsSAnZWagAAtr8P/jdTL/J189+KPKClPf4K\ntQ3cKeXnCqhqLXhHBa6A1dA9W/Oe+U2oIL/D8vZI0D2qZ/rO54mvmL2eLNpK\nzh7+uiaEkL8afHdFImB5ET6uM//4qw7n66LaJgWabm46lkkb1TfxXoPqAaWw\nK92FQ4Yw+vDry8BNmYTQMwwuYLQktldeI49ypuKNsOa4XEW8G06UKT11BC72\njmoqosvr/GSzDEONn46YTlwcQGKxJAJUe+4e3E6Za536m9KMlMlAglDbIwCo\nzdE0S4QxPnh2RQ91mGkVW4NC5+zKh3qTxp7Iqmvh5MUu0KsHU1yNLzPZxvt0\n0g+mL4q8oVNsa8sRkKeJsPYJQLGV9YBCHSLwuD/VapehA9+tVKh24Rk4sq8h\nsRsVbUCs4/MsKDFQbZXpHRxJRuvVz7qQmgOcgf3YT0YYmkdqCTf32LTQmX9i\ngKYVeAOQHNHUnvw3foRa7JLpUQAMikP/MHprNzvVSIobkR4UbTDwwAX74W5a\nIurP7nOT1srgcVf33iEWFqlqS8qxd7gGrwXkzZT8e0H6NuUFdaq6i4Fh8nEJ\nAOUx8M+a5UECR8/Z1gymTJjoKEQrxtzqb0DuT1sToDTHNfcsI2/zR7SfC7Sg\nUvsbDUdhxjQaqNVmaMw5OJV1JfsKkEysM0d/7nygFP3h4jGSjjLGr81oH+yH\n/Std\r\n=BFmx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a8313ebe32ee1c67ef38d5e9ba2b5a4ee2d08f77","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.ac41a5729.0","@material/rtl":"9.0.0-canary.ac41a5729.0","@material/base":"9.0.0-canary.ac41a5729.0","@material/shape":"9.0.0-canary.ac41a5729.0","@material/theme":"9.0.0-canary.ac41a5729.0","@material/animation":"9.0.0-canary.ac41a5729.0","@material/elevation":"9.0.0-canary.ac41a5729.0","@material/typography":"9.0.0-canary.ac41a5729.0","@material/feature-targeting":"9.0.0-canary.ac41a5729.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.ac41a5729.0_1607704171830_0.9353480715228961","host":"s3://npm-registry-packages"}},"9.0.0-canary.7fe0e4f05.0":{"name":"@material/tooltip","version":"9.0.0-canary.7fe0e4f05.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.7fe0e4f05.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1e0e9c1c60f95fb22a96dc92a746ab782ce433c6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.7fe0e4f05.0.tgz","fileCount":36,"integrity":"sha512-0Y17wC874BLFT+KdAjoWWcPmHv4nV3LprwQAfBkmem/098GSnRlEhIuIB7lXGV5qwQKIWzNVDdp+YEzbmUJecA==","signatures":[{"sig":"MEYCIQC1TG8e8xBsXRAzjqcCFqOp0Id3130YMKKMvlr6Nh0EJQIhAMfPHeHdz58vV2d9Q5wVlpsq1qi03RL87wWDBtoLDf0u","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":458566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf06ccCRA9TVsSAnZWagAAM28P/2haZnBipem+/rPpCVpr\nFzgDLpcJ6mGn3WvHK5hEhTbdsaMBAsCkLO8jKJsRLds4GhnFBTjQuvqNUHH6\nw6SNbu9QpgayWuyJ42Y8vv1LEGOv82/9qLLzRh8trVbOVinH7LcuNRAP33wk\nKJyt7QfOex/14L2rsR/VlxZ+1oojxsj3eZ4+Bwl6YLmBLCNh12y+IWym9cxh\n3Q02mOoaaHj5C/dcsXUjwBOWck2mYF9BpON8DOHacg42Evb79lmjE1Kf095E\niYHOuB/gj5Wq6cdMBLzeTzuI4aBNhsgwgEn69IL61fBZ34rJs7bJsxvGj/DO\n3CaItEXbEI2/F0u4pPtkyE5z3xMASbtX7dC9HEpEk3mmrYhl5hhnxU28H7l3\nnXzFqwN/LmqefBsUjukBOCvJl2/uxGV8/fglfqp7N++viFABlxUQkB6HAoQi\n5/MeGiBEE0ZsB2wC9mES3GFO3nR7tvaZByoCJ2ivpcDoPsXahyDXH8gzR7Tc\nioh6RreebPtdrORNYG5bLoHVEecC57+6hS2t6VUmuF+Y+gwJuS4bNseLtLWA\nQHG84v+5JkPmhwG1CyUbZWdqbKL8jA2rcw1V7WI/c/fiVjOckF5Y2a5edXQp\nMh2UW13FML5Y95quPKh/6g50RtDlNP6jk7LiU4HUc6xXqjILjGHV89OeYH4n\nB+Y6\r\n=iuiP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"174435b67952da2f175e31e1db54647a2722499a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.7fe0e4f05.0","@material/rtl":"9.0.0-canary.7fe0e4f05.0","@material/base":"9.0.0-canary.7fe0e4f05.0","@material/shape":"9.0.0-canary.7fe0e4f05.0","@material/theme":"9.0.0-canary.7fe0e4f05.0","@material/animation":"9.0.0-canary.7fe0e4f05.0","@material/elevation":"9.0.0-canary.7fe0e4f05.0","@material/typography":"9.0.0-canary.7fe0e4f05.0","@material/feature-targeting":"9.0.0-canary.7fe0e4f05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.7fe0e4f05.0_1607706396156_0.2192447415487948","host":"s3://npm-registry-packages"}},"9.0.0-canary.9244508bd.0":{"name":"@material/tooltip","version":"9.0.0-canary.9244508bd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.9244508bd.0","maintainers":[{"name":"taylorv","email":"brian.t.vann@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"25c37c4281d00b88943f1610da0eb852e5c737fb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.9244508bd.0.tgz","fileCount":36,"integrity":"sha512-3N7RJJoEE6HPiYoGO+GHsUh02+FDQl5R3As8R6Fr0mslYekRM5EhqaskMRI2/aIgAnV6/PaMD+WrSxdIF3ks2g==","signatures":[{"sig":"MEUCIQDAnMW6H9rc4Il0bgd2Gs9BdF6mEUw8e9ib/FXqHU1EjgIgPoo1otITTfH1gRbBdtCe7BrzVgfq9aOt9CZU1gvsTS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":458566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf08OnCRA9TVsSAnZWagAA7tUQAJceOkrDNtnK+H41sdWe\nLj0icQSQUafj77oMbKe26WsySVnPZ4phZeFE39J8m7qmYNohyFAso7tJy4kk\nyz8Js5+RPshw3M5KDLgR11bgAgy7JJi1t5RXrZUW6LXuvm11k1P9ghJknlah\n+BXsHjpDdQVAzjKkB4yDHKaekXui+hDqbrMHaVDBPwfHxCbXimGzLQumF2UL\nNAMstrHaelnIZonQneknM9sIprqus51qrDWevGusHWDu42EM2UegItc+0r4G\npLUNHdn6Cfu/xg16LRNLN15to1fCoNRTJwwqhmJRodEDiMkIOqryeReYmItU\n86TofywpqjeQ1SeZe4525IBpUsUpjlg9Qtl7QSMWThw5CUjuhjeYBS9GCGso\nN9evpXLaBm/zZXhSRdKep4s9TO2PRKRPL5iBmzfjh+jfndYy3Gr1hKWcEchj\negi4+ra1K+VgvnUyZQXp3BmHTq+jCgsJQUPlXqheaTVpaUZsOy0J2MsIAIyj\n8o1D2S1l/OhzghCxDDhJ2Urt8fr0uS53bjv0/MJ7prDZ3ADxuC+poib2klJc\nfuc0gl8lXYOgLXApH39Bt6uNxO5WxajlDXWLAcEzfJc7o17MMT1aBkW3Oyre\nZDptRePeKj96/pnz3AJjel8xCbAZ2w2QDI9esXVsiNaeg9n/WRGU2aXTn2cY\noCHz\r\n=jpzJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8d704729c3b4ba17ed088d900fb2ddfd57d5803b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.9244508bd.0","@material/rtl":"9.0.0-canary.9244508bd.0","@material/base":"9.0.0-canary.9244508bd.0","@material/shape":"9.0.0-canary.9244508bd.0","@material/theme":"9.0.0-canary.9244508bd.0","@material/animation":"9.0.0-canary.9244508bd.0","@material/elevation":"9.0.0-canary.9244508bd.0","@material/typography":"9.0.0-canary.9244508bd.0","@material/feature-targeting":"9.0.0-canary.9244508bd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.9244508bd.0_1607713703515_0.44195291718876306","host":"s3://npm-registry-packages"}},"9.0.0-canary.384a8eeb1.0":{"name":"@material/tooltip","version":"9.0.0-canary.384a8eeb1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.384a8eeb1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"28a303db23310fb7f7d2aec9f832f58cbcb9292c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.384a8eeb1.0.tgz","fileCount":36,"integrity":"sha512-/2VSQDlJYDov0v4rW2BLSTqJWITlLQlq3aGQEjqmNZfIo/C0xA76NZORFmhtZYLMu9tb33/90UHRQhjUYmdtfA==","signatures":[{"sig":"MEYCIQDSIP52+2HFcUBRHvwCMmV2CBRC+k85n34Nm7pk5y3/AAIhALVuAsiDSDoRurOup+kQN6aC718HTDVXmq9q35mnnv6y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2j23CRA9TVsSAnZWagAABiEP/1aUHNaKg6pmX/bgF127\nwntP5BCHLkQ7zRfYfMzf0b+0kdWlQ2PG+ygHkbHkmh+Ed0U5jdRFg8MMOJvi\nb7V6YENs93NWmePc4qTxzWGvkbha0REk6/BUlUju6EMsaNXHnJAEkJ77E08v\nh6ctulkIK2xXEN5cjxdDGsfrhzdaQfw3CewfyB4ug27+cIbP6icb+k/Y4NVR\nGtrBUPDwaD7Ml1ssH0jc3npCPPabIxm+tnU7L3EzusQPeYpxDiXc5VzCIieV\nofDb6nIQzEXjtTIoPzhDJQDFAA7CRXFElrWRubhWT8e0B++qWvE1GaaeJhL8\nQ4dZTE0c20dQHEMd1zwL4mHeVozR9WtDOnICz9LXFNviUKfK0YhZzsIwuseH\ncgfE0FgnWmfcQwriIAl4+cj6AOt8C1nAADX2PPQSc3coCjUenwYS4nOS4gog\nq3nz6ZO5sjCRAEsahRCFIPYqIqFzUyjlvtp2uIkmne75jiCpYo/lBw7whFJ1\nHgdeK5KrdBT5hgEJybwW9PDpgPFKGW8tsq6htcKStjySS1PaYqgLu+j0B4Vc\nPxAC9auvlMKecevDJrX00lq1tJJOon4xcq7CWX8HZxlal8M2CPZOtb0oW4SE\nxNR+IHfaEjlaownR4d94NfxECBxlkkaTrtC404p3XXmJtxZ3OATzgMAaJvov\nFhCh\r\n=+f70\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"21b2ddce32077f19c001df17ebc3c8ca9c48f8e5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.384a8eeb1.0","@material/rtl":"9.0.0-canary.384a8eeb1.0","@material/base":"9.0.0-canary.384a8eeb1.0","@material/shape":"9.0.0-canary.384a8eeb1.0","@material/theme":"9.0.0-canary.384a8eeb1.0","@material/animation":"9.0.0-canary.384a8eeb1.0","@material/elevation":"9.0.0-canary.384a8eeb1.0","@material/typography":"9.0.0-canary.384a8eeb1.0","@material/feature-targeting":"9.0.0-canary.384a8eeb1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.384a8eeb1.0_1608138167030_0.8215406229336104","host":"s3://npm-registry-packages"}},"9.0.0-canary.eabf9d5c2.0":{"name":"@material/tooltip","version":"9.0.0-canary.eabf9d5c2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.eabf9d5c2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"864ea2bfb7f282991430c369011be0344a9db2cf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.eabf9d5c2.0.tgz","fileCount":36,"integrity":"sha512-zPVOrrXJA9DUQqChD8effYWiiX7s6hJStVmyK7dNyQyjtoSJNZD4K7lVHOfsVlagjCcS4yX8Abf4425UlfAceg==","signatures":[{"sig":"MEUCIQCInRG3jjlMkIBpuR2kqCSdPKqz7/BJM0g/x1rN3BQGAQIgUvytDc3rELpVC6yQzrc2We8mwi+HqbfMQ5XFqOWBj2s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2lHYCRA9TVsSAnZWagAArs4P/0lFAa2jlwxKKrPJshSF\nvYQbkg2caZgio1bQZ7OQzayz7XwB/pVi+Eikj+jJQLLYBlCCom+f4S2pau7Y\nu6mRbWdRKF5+nPsZhzhdjUBI7I8bRhVB9AJWE20zBp06JrXoJH8sne30Ow7v\nCubIGysfSCwSxthPUCrrnatOrQDmD9D/G+l4gxWJaBR5uq9ACTIf/6F2hTy2\n+Zc6IBl7PLc6Xv6C4qpUIEyCSb+B/CekR4Jd+sfq7ar9X5G+hJw15D7l1I64\nv/b7D+7bsc1HqBGgOUl6tNsKqq95MoOdRTjr7vueJfBv310nNifh8bv/oDNB\n1/g29IEg5VluhE08dJ95JRgT/NWO4/p/1b6Rko9FK9+bradqo+u9nWxEFW9/\n/YuPRCRewhQD0X2OwKg2Mt1T+oVpyX26XNQIxNS+BZtWDKS2z0++9cKv91fv\n19N4Tu/12YcydDom4GLMXpFj5nRAU0LAIrS8L0FGQD0ZL3BanMZyA7CnE0Re\nW4Jq/RAWeBhJkwn3pYc6GcTpv8zB8KmzlKlpSmTtRNyu5hZN1Epw/Z9uhJZG\ntgSmg9atwgNyhB2i2UWoUtP6Mfd8UhB6/iUBBBt5sj1DagQsHvK/axrUdaKC\nxGZBssM7en3bJJkMQaRAtmli7ZOfytaGw0QfV6S76WEQOxXo8hlj015Uip+o\nXLQq\r\n=gU9M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"78b3a67c04374ddb43be73dc4daf2613746d08b1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.eabf9d5c2.0","@material/rtl":"9.0.0-canary.eabf9d5c2.0","@material/base":"9.0.0-canary.eabf9d5c2.0","@material/shape":"9.0.0-canary.eabf9d5c2.0","@material/theme":"9.0.0-canary.eabf9d5c2.0","@material/animation":"9.0.0-canary.eabf9d5c2.0","@material/elevation":"9.0.0-canary.eabf9d5c2.0","@material/typography":"9.0.0-canary.eabf9d5c2.0","@material/feature-targeting":"9.0.0-canary.eabf9d5c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.eabf9d5c2.0_1608143320565_0.9446069900265384","host":"s3://npm-registry-packages"}},"9.0.0-canary.30fdfd06e.0":{"name":"@material/tooltip","version":"9.0.0-canary.30fdfd06e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.30fdfd06e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"54ee6f31672bf0054aae09864c79d5e2c899d348","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.30fdfd06e.0.tgz","fileCount":36,"integrity":"sha512-k7bSWd1/3/G2HkAmEaCDCsxAYrPsbAi50c/Wo7yHA+RnMsNhiHFTHI8u91yGmVDynSuRg0yvFv1O+xO/fWLwGQ==","signatures":[{"sig":"MEQCIEiNPw5qWYKnNqfYIVnAC858svET0Av0wSSVD5/OAeciAiB0pSnS+JR+hBT7i/byByYjIq5z9Q74//zYPNw+FV5A9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2lsrCRA9TVsSAnZWagAAbycP/jJNKVcf02k9etB7ZM+K\nSoiZncFE/fPRHbltbf9ndHe8NZcBk++kUB2nsM4RGerRxtp5khYMLbBEY9uu\n7zn9+5zLj+gWdUtFUSSM4Yn/vJnO/HoIsnfIdLdLa18/FmvZonDGEurd4sLO\nFBPyIYYvW7nm+5Jp/X5yM2607jUK6uzeyx2NxBlG6MgAQkvCJMm2mCo8LS49\niy9T0JzqvPXYp2q19oR/9YJvQP4pG/sTbC9zjjCeIXC/ra68ZJS/KUm7UPz2\n5rEwpJFtpxD29gJ50Z2D5pbzO+7FdgzbJecyYED3zlg+bpWvVv79xxFj5kVV\nZkkzZGDjkBsOgeJPIrkpoo4vVWoAzrYf0Xi4FjqNfEDgyk+4HpBbVF7tO8mu\ntHTU8weCMfexLWeiQ+tKH2hCgHUyQAuIb4aR31ovz3Wp2XzjFFOow6uFVaeS\nlmRMnZfVRkM9RF567JyBWW9daf1dvCKDRRhscaRnNMXw/fu3+03Ml9NkDr0p\nk6HmqnxiT9GXPcLQm23VfwF0x+CL/yzTrT6CaI050N67Bedh0HFD7FLjcgh1\nldS+XB7C4h+gKc0YfsQ4zhIRCZdHQ/C7X16EAvk8PbZQymTDX4YDW0M1MY96\nTWgHv5AkeM0lOL6ptenofy7xKwHN6NVFbt1XMdF/N1/7JeXaIgNVpBgtMaup\nhXnw\r\n=m9mg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f9c9fe091a06230b038ac8a71ccd652c7c662b96","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.30fdfd06e.0","@material/rtl":"9.0.0-canary.30fdfd06e.0","@material/base":"9.0.0-canary.30fdfd06e.0","@material/shape":"9.0.0-canary.30fdfd06e.0","@material/theme":"9.0.0-canary.30fdfd06e.0","@material/animation":"9.0.0-canary.30fdfd06e.0","@material/elevation":"9.0.0-canary.30fdfd06e.0","@material/typography":"9.0.0-canary.30fdfd06e.0","@material/feature-targeting":"9.0.0-canary.30fdfd06e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.30fdfd06e.0_1608145707309_0.6678895240797591","host":"s3://npm-registry-packages"}},"9.0.0-canary.9590a8f90.0":{"name":"@material/tooltip","version":"9.0.0-canary.9590a8f90.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.9590a8f90.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7277a02a3f31e22a27df78b606119f91eb02da0e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.9590a8f90.0.tgz","fileCount":36,"integrity":"sha512-biIddL66kgKJVcQR8J7YR0b877mvCJstBeaEgJsPkUzxKjrLkpi8cmBaBubu556znOvYbonDyCyTfdaiEYIi5g==","signatures":[{"sig":"MEQCICkCKvfS1BvO73lrDJ+YaI/iDjowY1cCCBKVDI2tU+onAiBEhDjIp2vznW72+QHVKF8ketX9aiiEY1GSeUaeXfn/Sg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4jAnCRA9TVsSAnZWagAAOFAP/2TIABijjhMYP+glMXeP\nrnutD9GUSVPMhG/sO+T5a00KxbWRPGlnXX+HXN/91J0NXpfDXQf17qhGRcbq\nKeZHjTn5lTCDam/E6seEUlUUCc05K8kTkO0axqB+AEOtVpKUngZElaKw06dj\nFCVf3eVYh6Y8HPBAgxqkcTauo4+J1p4elRKqaux1q8a5z/hugdFNZ6QBGRL6\nY8Pj4e4S+nQEB+wCqo/UY3IUVDRP0oKG1YDMl6XNy1WKpDZSIPdraTJ0R8Uf\nnZRIG8kdqONlrtDAICpJktrnBWLHXVR/W/WnCoTJQ7x5ce/4GtXToJWggf9b\nts1AxATVaKuD13pZ3p0GFTQFRi/vl16xV7kBppzvfNcEwL0msABA08LT5AnD\nY8aQAGLKXC9rCHaQfqeVhc8l9Ons+63tFV6ULhLafdzqBP1cBKtAmguGrcST\nZ2LBHS90Lf1I6hWyypFY/4wrNHTpEDdz8oHDs7QGItAi6xjxD/VjqvhZ1n2n\nOCtUSEWJqCdqVreHvNd0vE63hTeYWA8uyztj1UW31aGuxzF8Nc/mlI05OFvq\nM7I+rbNDpX8WHTOZ/aRwKv8PoqMwQYtphYcCxt2Nxtd6/LrrFRc1t/+IlbUD\nZVFOZQhsLGajkXZFyPvPl51Vl+q/Psq38ZXaP7Q3ESOFNeWjGBhSQROYe+PA\nFRXk\r\n=JmnY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a592a11a03887b1e1535d4d49ea05db1b6f72789","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.9590a8f90.0","@material/rtl":"9.0.0-canary.9590a8f90.0","@material/base":"9.0.0-canary.9590a8f90.0","@material/shape":"9.0.0-canary.9590a8f90.0","@material/theme":"9.0.0-canary.9590a8f90.0","@material/animation":"9.0.0-canary.9590a8f90.0","@material/elevation":"9.0.0-canary.9590a8f90.0","@material/typography":"9.0.0-canary.9590a8f90.0","@material/feature-targeting":"9.0.0-canary.9590a8f90.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.9590a8f90.0_1608658983106_0.11505446307951805","host":"s3://npm-registry-packages"}},"9.0.0-canary.f89d8b8f2.0":{"name":"@material/tooltip","version":"9.0.0-canary.f89d8b8f2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.f89d8b8f2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"63b85d22b4fede473db8c8031b1707b8b34f79d7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.f89d8b8f2.0.tgz","fileCount":36,"integrity":"sha512-X2vxZ1TQZ46hjrUWD0q4OgpNNkO7mKp2ns2Ye7LHyZUk5/5Yges141mmm5+GEj0KXHtxzkRN1bw6X8qzURERyw==","signatures":[{"sig":"MEUCIDVKGx+SKFtqmLUXx9wDF0UoNV4ISo+nWpdSX5Wv5dT3AiEAtlNVSbo2QKKFVlbgvWwlvzaVXiH1P4UTw8unhTEk5aU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467726,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4nvdCRA9TVsSAnZWagAAbk4P/1zD0PgSi2Damiq6yUWK\nvFOJAO0KfM6Y8Sv9mWAADi4sKiKAzWij1ZpkLSHCAsHV7+DuHjkDkuvabnuC\nASm7sxyxpT8glECa+44aAHqjnknC3VtWNOo5mezWIb9qVtHWON3aUjQNEELm\nvK+lskmQi1tqsNsVmJQAnXVs7tDNvIoMyc2b9BTL1cd1aGGSas1LKV28a34K\nraiQ6ZfJjsvyZguUtH3FRbG6GQZW5+iRhG7i/AzUWO3FtVGnxOFmmyU0+saT\n7O1VVLNhWDTWS95lnaYZImnyd+vJcY74Lm5ZQB+bENwdD2QiTfGA7scgCsHU\n/rnsrHv232EA6F0uEvM0lhhCsBh4cab6bvkw/OLVepUjxZxsmtmW0tRT5O1Q\n81LNbhIQIS1mO+6X3lZmH6bipokO3Qr7tU6CwQ6CmEAJAxbQr5ywbDbXf/kE\nONke9XY4ieLztNpS2JlvehI9XTdNTbzE8xql4XssQWt5mMikbqu1Rza7w8ma\nDFtNacXLrnVxWkjZI6lm0Cei8FWTlsBlLn3A6JS+L3caF37jd5QqT71DP+5y\nazGDkFT5Y7W3nQguNtgNbPkmJFPpa6oVDlajy4sJhdACA4uk6xbXDay2ZL5B\nSwL9ABOlHCUtR1Y1HPObvoBzaopWdsqMJc/ndfUv3BJ32iS23nqveuby9bLW\n6ikZ\r\n=Gn7O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e0d61155aa611a1a8573762d75379cbb25d2e7c0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.f89d8b8f2.0","@material/rtl":"9.0.0-canary.f89d8b8f2.0","@material/base":"9.0.0-canary.f89d8b8f2.0","@material/shape":"9.0.0-canary.f89d8b8f2.0","@material/theme":"9.0.0-canary.f89d8b8f2.0","@material/animation":"9.0.0-canary.f89d8b8f2.0","@material/elevation":"9.0.0-canary.f89d8b8f2.0","@material/typography":"9.0.0-canary.f89d8b8f2.0","@material/feature-targeting":"9.0.0-canary.f89d8b8f2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.f89d8b8f2.0_1608678365432_0.9302254893619921","host":"s3://npm-registry-packages"}},"9.0.0-canary.fb194dd35.0":{"name":"@material/tooltip","version":"9.0.0-canary.fb194dd35.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.fb194dd35.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"da559c79981a6ba85c62aafcd1b85585490fb199","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.fb194dd35.0.tgz","fileCount":36,"integrity":"sha512-JOFr3SH78IOybTMVJrHISrTqk28JY46DD8ww/S/+GL+LbT62MRuBeXb5xUii4YVc+cxLJnCZ05FWGFqzwBA1PQ==","signatures":[{"sig":"MEUCIHIBS6+V+tkJZMHQK8UWjwyMsfPlBDP5lk9pDamte9I/AiEApXLMA62TrFE5/cwOKe/Ojpvr9qvLDrZeB6hEpx1t7QI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6kQnCRA9TVsSAnZWagAABtYP/iJzNKETrdRVxwufjO9L\npiWD/V2arhzkVYYCovt6k/o4cKARjMHWn15dqfwjQi/tTB/GZIo8L4BguTIK\nIJfOY0I7IjFbP8en0f0YjgxKlUqlZXbTIj8eUk3m+wDdbsu/dwcrpqMO7Apo\nj/6HFqouHrbQn7H2IZuiwBtRcpV6qTZU4HYBsow+skr+6O3Bh7VrxBWF0K7C\n3Oq9fV05L8W2W/waJ0eGMGND/WJEhU8y4k98lolofk40EKTuDIg3OUPpIng5\nJWDrzuaHN+RjzWARJaAQYphSQBhUyr5OQTcjAv/qwBJkEkV6ksul5/D6Wx3R\nIxEuOcfYxIY+3Ueij02d5JWdjVd9pgY0Ep0V3ApzPovlFv+uWgCySL4HmQsN\n+pf3EkU15a1CT4FxFihlwpoaV2+NjaV+dOz6+BZGTA2PuG09rfcF+QFJJzoQ\nB9ULU4B9vofZp5k0axYBvAxxUN+2ahrrzGrlFFRiXAZBJnN5R6Y4tk8+yBY9\nZM4xh44uF55y/PgTBk4QFiZziOKvzX/hlAion2OWcm9Sr/6oKKKVqShaa2B/\n2ZR/NF+xRT6XAVhuaWXl06dS5M5381JlTXSI1o7khNQ3sMM48bvwIJ5hTuhJ\n8ANCZlLMTeQz7a89CpduxxEBw/LuMTLb+GNWCk+VImv9FuwFLoJCyzH6fLZj\nfxn1\r\n=UHVu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"57a5b34de1026133757436905fc54dc5b326d3e8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.fb194dd35.0","@material/rtl":"9.0.0-canary.fb194dd35.0","@material/base":"9.0.0-canary.fb194dd35.0","@material/shape":"9.0.0-canary.fb194dd35.0","@material/theme":"9.0.0-canary.fb194dd35.0","@material/animation":"9.0.0-canary.fb194dd35.0","@material/elevation":"9.0.0-canary.fb194dd35.0","@material/typography":"9.0.0-canary.fb194dd35.0","@material/feature-targeting":"9.0.0-canary.fb194dd35.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.fb194dd35.0_1609188390797_0.0929714091103866","host":"s3://npm-registry-packages"}},"9.0.0-canary.64f36e287.0":{"name":"@material/tooltip","version":"9.0.0-canary.64f36e287.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.64f36e287.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"363988d551675f1c00268309558f43057d89e962","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.64f36e287.0.tgz","fileCount":36,"integrity":"sha512-dIldr7M73SFWVOqC1zv0NPvhxSv/DHgH3ndtWJXf7QPQmy362rckQdGTGGQvrtwU+I+kbjNu57qwytXzf7yCOQ==","signatures":[{"sig":"MEUCIQDdOqUb83ayrU2gdADVZ+t2nsfSJsaBuCgFzDgR52QW1QIgLrFkbaOe3mwA0cvsoRFr70kSIigEq2rZHxRGFc+b588=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6kmECRA9TVsSAnZWagAAKDMQAIyAVywBJvsA6UMGIv02\nxHO99SM1topKoaf0RJ/czlU6g/9NUU/z5BbG3cwuNsSf0PyuDblPDIq0YngH\nA+Yc2U9sQh6nRg1OFZnwXIVC2gI4hlpRvTye3XEDS4iJ5iJ05W5xQKouE9Dy\nxj1IXBoQNl8zdmAW8QoYJW9dn5+kpx/ppAnAhAzfOArbjxtVzW2PrEn0caoq\nOX1Y37WBchIcCYvOOZ57v0jnj5KYCW0X/6NY8lo+IgM6KU3sP4ZskToh1D+v\nyg+FvW3DuEvD2g45QsHI5nZCMvVPrUTeMpYhb2lBIyV7ujqHJXIKF3AMRdic\nKx7vMwQvjpMOMrzRXVkybbxaFcWH3BzsTKitLq0mjntWdj+dvteHg6VtGe/D\nkbGqQhyFSKYHO/uGi1aLLHC/NDW4xS4spVGzMHRE/+kVse4qK/zWZQrKFRGF\nHnSHwvdvqcjfh/GaA6vox/IPyVr9cQN1Zq+OEOsiAfpg2HrVzYItzQS3rwSj\n4GO/VCHSlmEbWS63x+WieBKFsvgiGpXeCRiej9rJ2i6h1dydj4/tuu6j6MgC\nXMCyB1mBD0d1iG/1MYSB4//R4yCsJK/IIwa16sOZMQcbeNZQJAtcR4OItDxw\n4/+AWAMiqiWNGcq/bETGzWe5IGTzsgjhveVz//uQoSw7IqHiQGzZriHvRr+w\ntZrO\r\n=+Bfi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"23f6770d284ec6c17b1aad9913827f8d456418f2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.64f36e287.0","@material/rtl":"9.0.0-canary.64f36e287.0","@material/base":"9.0.0-canary.64f36e287.0","@material/shape":"9.0.0-canary.64f36e287.0","@material/theme":"9.0.0-canary.64f36e287.0","@material/animation":"9.0.0-canary.64f36e287.0","@material/elevation":"9.0.0-canary.64f36e287.0","@material/typography":"9.0.0-canary.64f36e287.0","@material/feature-targeting":"9.0.0-canary.64f36e287.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.64f36e287.0_1609189764306_0.9298076572831246","host":"s3://npm-registry-packages"}},"9.0.0-canary.b7bbe7022.0":{"name":"@material/tooltip","version":"9.0.0-canary.b7bbe7022.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0-canary.b7bbe7022.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"09e3c20f81865e27fa4b95a5d033eaa4444a8314","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0-canary.b7bbe7022.0.tgz","fileCount":36,"integrity":"sha512-644eI5Rlxv0g05oy2uaEqrj6Pz+cRUqZHpku9YEJaz2sULwV9w6vWiszi9aL3SeEDDBauoHurOA9xp/vZ7K8gw==","signatures":[{"sig":"MEYCIQDL4agintR/Wf7+GwaX6hehkehDXb2qUzvEr7tdYrM9WQIhANhiI3oQ7LA+hqJCzLC3UX0L6GuDSEiBIwgWtahRyxZG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf63oUCRA9TVsSAnZWagAAUFoQAJ6P2Q4sK+0aIzOTGk7q\nfNCbHb+dOXf7J24vY0+bPdaAymSMgTde+yZ3JzVIClgcd2IHDzVIy1XftGDs\naf/6pCqIdCC/06BEyHHCA1VAUgvNcWIaR0M0CMnXGXxdVuR/pBWCHXSEjj2i\nT9aY9umLisX+pJN86hKWd6fq7kpKfn+5L7rSdXr6CYt8qIoCXTm6Wx52cB1U\nX08G6Dk3XqLViCkCyfu6NdtGsKjGlweQ4iotvfQxguDZeb3ecd0/bvKCz/IO\nmJ+/XSD4gW1tK4M3B5wB4BSiZoTjfT2oANlhqlAMK3/4pIFUeZOVAcve1zuy\nKFNOq8N94SucWD6WXWyRIpvZqMbZRnuJkSnPtO0f81rTXa38bx0mQIGd6OXG\nlbQ+fHXOp0g6jEdAIr+xiwHho4mceYP4DFZFmEOnkL9UmIsgcufI+6hfDWDD\nda4supnX+spu5HRaxbwhtZJ7KDuKX63nMDvnTgsTRh824yqENlXOHifd8sDQ\n+EVuE4z5EufL6qPlmsMFtPeLaCmq5FknmnhTcx5W//oz4XmJBidTMigoEK2e\nOg6BhbZqW+4Or6ZbhkMyVApmB1c0W7jig/LJKMA/wNPa/AVT1CgaLI03S3fV\nMzUbHSl2AmCc/t+cwr2bsqMQ7Bza0nKll8492cb6tObJKUOoGEVIfHM03Uag\n6mOs\r\n=BydL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"81238a3912ea8bf30c97b0318ac2ce65f297eece","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"9.0.0-canary.b7bbe7022.0","@material/rtl":"9.0.0-canary.b7bbe7022.0","@material/base":"9.0.0-canary.b7bbe7022.0","@material/shape":"9.0.0-canary.b7bbe7022.0","@material/theme":"9.0.0-canary.b7bbe7022.0","@material/animation":"9.0.0-canary.b7bbe7022.0","@material/elevation":"9.0.0-canary.b7bbe7022.0","@material/typography":"9.0.0-canary.b7bbe7022.0","@material/feature-targeting":"9.0.0-canary.b7bbe7022.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0-canary.b7bbe7022.0_1609267732116_0.4281387892183459","host":"s3://npm-registry-packages"}},"9.0.0":{"name":"@material/tooltip","version":"9.0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@9.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8013997d69d58a559cb3cd2355dc7dbede898cc8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-9.0.0.tgz","fileCount":35,"integrity":"sha512-CH7YPah63UNlWCzJxhoKvyOPt4Scs9cBwIkc5mMDDcEZaRlcVh40Qzwtcc8PHq6kduEWDhj9klbeUaqX3ciUBg==","signatures":[{"sig":"MEUCIF9umQIj4APiiguyXjMnImEKGErW3rn7AQeYtqImmbD3AiEA6EP/Xw4ASL4hquAlchM3tlbPzuKWTc6Bb9/lUXJ1ziM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf64e5CRA9TVsSAnZWagAAwkgQAJocuNx7c0uTeaBdPR82\n3HDugueSNqeZBmmeYwyqzccU+qrk2sMF3OrNm5LP4JVedjl63wcrKF2o/pyr\nGa4YUj9AsZcaGRvVWLHPbQUlF9rm3hrcYf2ttCm+ZRf46j/LZjjxywasSJ9o\nAExEsmaWJQtER0jLcoiTdPHNAj96RoljKaf6cPipx/YTQOf4Pe9jg7OQr2zl\nbh4Le+ttv0lQL+XAW3jSgYSTEsHKn4jnLBzKvxQ3/S/91Hf/SVgge6QmM9Cu\nF/Fn6kKWSKGSB6ULgjzB0kYcvHahh+C95U3JB1uITd7uE9Sf2zm11L69Ot0L\nNLnbgtYLcmXDJmnVl48JkMxFXKlQa1J3jceawNlTQ6p29XTEOX6vIubU4ucb\nZ1j8nKXTMLrvGtksAWqYzRccC3vabEoPhb3kSlCf3ngs40sEBcUoXB+UmQUX\nl/KJNOb7AJIljDaXPtbtIH3mIUUmhriJLmQnTo8AjRBwBBlq8yrAqaIMJhYe\ndRpmUSSEIWdK7/ueSUf4xHvX9hwGO0nNY5RxXYhQsTFGpstsvHwkrIuwWVSk\nJVcu8wlByB/gqov56JqqMki0q9tHHsGm6JPIa2xyfdQy4cMnWpsHT/mrY5LH\nxXX0m5rvEYEQJOCzCXQ2/+yge5P2DHuevdFSabIDWsXN4pbKKBSNUZJcXG6F\n6QON\r\n=lMYk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","gitHead":"555aecce59125bc3f162b065dca47384bb5822b1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"^9.0.0","@material/rtl":"^9.0.0","@material/base":"^9.0.0","@material/shape":"^9.0.0","@material/theme":"^9.0.0","@material/animation":"^9.0.0","@material/elevation":"^9.0.0","@material/typography":"^9.0.0","@material/feature-targeting":"^9.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tooltip_9.0.0_1609271224801_0.45299433185148463","host":"s3://npm-registry-packages"}},"10.0.0-canary.776c18681.0":{"name":"@material/tooltip","version":"10.0.0-canary.776c18681.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.776c18681.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cb9a446e172816fecd3090ed1fbd30744f0bde2f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.776c18681.0.tgz","fileCount":36,"integrity":"sha512-+m99Dd1ygql1tq1vFNMHh2Zl5iUbGuI6qqXBQi5gsakvmwmhHHRubyTc+b4bhZ3zwWycAzB2gks6ZyRfLV/0/A==","signatures":[{"sig":"MEYCIQCr3oAJuHFP/vfAgLFJtImUqrETCbBBuMG7SoGu+HUDPwIhAIL4bCt7FhRHSgCMritBpWd9r7Lm/sDiXv0qYh27H8na","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf68yfCRA9TVsSAnZWagAAn3YP/1C176iKadepT+h2a3i9\nC/lyppb+Y38dwnD+tdmBjtfNXQNzEPiDPidNu84Qb/fuqLn/oBVE6KCOYRBm\nYkz39XvuAlSd+mDFp6qmhxd6v2FEA2fAG6O/LOPR16o+pzGnAXU1cwHDIwGq\nfl+UlKvjopAnY5Y4SNWVLxO8aDX21IAMUum4llTN6UV8vk1CzCTx7kS10UKW\ndwvUjbLgfD5T3rLOjZhxzwZHhBoqNNZZtQdIn13oZFvL0PAwsc+nRP/moNWe\nkt3IUuJcvqChBR84XOdrEYueV3dTyXWJmgAyE0yg2URXRKPhp7EzIkucJOSu\nac6amjZVBBll45bmetcg5MXJMNBSwaLRPTJwgkk5mS+2iWcXL+v/fgbOCGEF\nSYBRY4oFXguRFta46O+GZQO1tDZjh+octzcV5NRC0OGks0Hefl7tmm+ObF6y\n+YM3l1lT9r4z20ExOhzS8re0gFcDuW1GELse2TX95xixg7lqpZlVoxmSIkmn\n//C3wL6GFY7oihDrIPa5ZQn0AXqQC8fGYVtAmgHXfUkzGaK4svJ/IUAZw8ba\nHOyU2FZi9+VvBJD41jSPLIbarEUJQ1J7oK1+xiwWYOMxtn2UY0keWVjNu7tg\nCkz05Gpwu7NQfI6NGRy/qcsMfk1Hbclv97x6viy37T9eHqAtCy1XutataX+W\nBC5P\r\n=fZDj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"920f8ec98e9709a32b0564a5334ae434137478dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.776c18681.0","@material/rtl":"10.0.0-canary.776c18681.0","@material/base":"10.0.0-canary.776c18681.0","@material/shape":"10.0.0-canary.776c18681.0","@material/theme":"10.0.0-canary.776c18681.0","@material/animation":"10.0.0-canary.776c18681.0","@material/elevation":"10.0.0-canary.776c18681.0","@material/typography":"10.0.0-canary.776c18681.0","@material/feature-targeting":"10.0.0-canary.776c18681.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.776c18681.0_1609288862863_0.8887658484078043","host":"s3://npm-registry-packages"}},"10.0.0-canary.671d72d95.0":{"name":"@material/tooltip","version":"10.0.0-canary.671d72d95.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.671d72d95.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a92c510276a7ee1722ba28e025d2d343672cd18b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.671d72d95.0.tgz","fileCount":36,"integrity":"sha512-EJ93Mod1xpPoxeS80qLqEcyQH5o/7SmgC9K1Jk51TX0TIGtsUkxkl0CbwpGUj/dXsNPqOOByBD3wC8UWwyLEqQ==","signatures":[{"sig":"MEUCIADQASawmKhZmzzcbtqCRgfEHAAJ7BTeS9BTtzFTnldYAiEA4AMv8a0Bm0A6Lxvh4Qx4dRljCmZTziQa7G8upTRoYSk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7N9FCRA9TVsSAnZWagAAZSAP/iB0QWK6XQbPT0ETxteF\nwWmKEw1SkcZGYlPElzMClFKNth/b6fUyBJeTd1g7U1hEiegybpIpWFERbbmm\nptqA48AGx0aA1mbkkbLabRbe1DnOQMoL2VNPKMy24/FosOZyMex4cbTpzoxm\nUjn1KuRN4T9YAdybzVZHs0b0MDSrtVRDm/DJCdWV14i1CVcNU+WVKYxuI81P\nbEJaCOnb7G7CIgFPWJBT7ycVR4KsYF03kSDklFrmLvhF2RitHS+TGWCwHxcS\n4F7ZZh4I00+GW5Wgm2dAP4fgRQCEG/gilne76Gbp/rR/fkJV16NPM1MECGQF\n96YgyQ6XGgmothc7vTOaWNL+QgxXrvULG3lJtwM31zA4nEA/39eWkw2AkP9P\nx3TAoKnLsJEwgWpzX8l2d3BdAOWf2hk18RyCbJZs2/vanKcFFXSx+aDf+5G4\nPZrzooPRkswHuyPsZg0uFJdo7SgLwwodFmS+5cuX03tWkkW4O/bmA0h/qt2u\npHoHqbxwTVZ/Nf4/YoPIVBNrGkSl2WiHUe2I3qwFDqTBtK8f/iwlVQMOjjJ+\ndN0Yp/jgTFAaph8A18VtUT39srTwG+w22Q7bLVExLGTGWy8zTqx7SyjdiyaT\nOxoAY43tAd6jbwqFOy1FCspgyJS6BvDTRmsoRmWr87WYeduG5TShmhP4yAuB\nURmw\r\n=kg/9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c22803ec93a76c661222622456cf6f5c5a17459f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.671d72d95.0","@material/rtl":"10.0.0-canary.671d72d95.0","@material/base":"10.0.0-canary.671d72d95.0","@material/shape":"10.0.0-canary.671d72d95.0","@material/theme":"10.0.0-canary.671d72d95.0","@material/animation":"10.0.0-canary.671d72d95.0","@material/elevation":"10.0.0-canary.671d72d95.0","@material/typography":"10.0.0-canary.671d72d95.0","@material/feature-targeting":"10.0.0-canary.671d72d95.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.671d72d95.0_1609359172750_0.5586979654986788","host":"s3://npm-registry-packages"}},"10.0.0-canary.b4f5a1c9e.0":{"name":"@material/tooltip","version":"10.0.0-canary.b4f5a1c9e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.b4f5a1c9e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"650c76154c67eff0f3898f36016b08d7ac868a51","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.b4f5a1c9e.0.tgz","fileCount":36,"integrity":"sha512-/NmU373PeocQUvEBae+XXrfOAtmCg1xXRHNLkQJosvLwz+MXpTbGeGIR+LM9ck8gbxb3idGpZJMqdju2328diw==","signatures":[{"sig":"MEYCIQDlTDWnB+DWx8hyYh6Rixjy75odk5iSQhiA26NqY4XT4AIhAIumvuq/ioDRQQFbsobB+9xVh0GP8eEMP9aVhj4K5c2X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7PVoCRA9TVsSAnZWagAAUf0QAIjsKyVH05IxO2e1zkXQ\n7FtpdMgSpXpz+wWIEzkyE72pHxdGVl4oKDNdRjTombPQUFEnRDjz6FPIQMqO\nyLoJdvSWQ/ipUzeL7JKzV8cjBN6AaGdBkVq+oT1XT86VFsIvJU6EiN0guOMu\ngkVdN8dYvb+sbaWYWR6dH2R8p4MnSV+ph5gw008VOgh37BSmNuSYiENnMps6\nBZtEME2wT9XMv28rmC7KsY+mH/ZpCzt4Be01xC43L9VSDIZRKoIgG27TlI19\njBAdjoR6g8Z4B++csml9n9LU+ICTmMzQ+rrQwxkhyYLwffqvgx/0LOh5gNT4\nSao0PfhYd+uz5BTPgvJQGnQNZOAyBwzK5tNljxZSPoMzaW+IZIly91g2RS2o\nE/rTtrYokIGbNmFoThEqprioLFbVxyCue4Nn/s89lBMtMcSP2j/XJs0t7cpy\nb5wnuAa1RWBkS4rWs+lhudF5b4B0b76EQ60HTQk69w82MguUyFbTIVEKrZK6\n1FZ+hiEBUtcDP2RT/WSaXFMSmgPvryEQdA/EwZM2XWoat6IJ9Up3Rp1l2M3o\nl4buMpkI5xa6a0R1XZsU71XuwM+n+Cs0n/EuMs0wH44dEGl2ovtEqExiYVeO\n0LoV8WX4xbvJzMlgT97F5pIPm4RCLfCYRoDrlT+QZ4c2EvsmunSdO8OABZF3\nk3ht\r\n=OF5x\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1db47387aa8e99022677270066e7cba1da23732d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b4f5a1c9e.0","@material/rtl":"10.0.0-canary.b4f5a1c9e.0","@material/base":"10.0.0-canary.b4f5a1c9e.0","@material/shape":"10.0.0-canary.b4f5a1c9e.0","@material/theme":"10.0.0-canary.b4f5a1c9e.0","@material/animation":"10.0.0-canary.b4f5a1c9e.0","@material/elevation":"10.0.0-canary.b4f5a1c9e.0","@material/typography":"10.0.0-canary.b4f5a1c9e.0","@material/feature-targeting":"10.0.0-canary.b4f5a1c9e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.b4f5a1c9e.0_1609364839689_0.7946233878947491","host":"s3://npm-registry-packages"}},"10.0.0-canary.a94bd8deb.0":{"name":"@material/tooltip","version":"10.0.0-canary.a94bd8deb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.a94bd8deb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1c8f636106a43d780259a2988aeef9c7ff739181","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.a94bd8deb.0.tgz","fileCount":36,"integrity":"sha512-Wxo0wi/3Uz+ebganLSsSL5G0caLFihtgaIVJRjjB7C3l9+Z0B1uiJdD3+/yaues163p/9xRDdKo5ROWJ0mLYag==","signatures":[{"sig":"MEYCIQCCzO42CdIC5g7NTUylFGca9y7AagJ97RqPLvE1ALjU2AIhAKnG8AytM7e2ndCOlfE8hWGpesxVJyeqLFBJlL/bzB0J","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7PmZCRA9TVsSAnZWagAAKxQP/R9zZ7ls+1lxuCBIOi3O\nS1YO/CABXpQSovdgvKwaHZn3ziq3YeyYa0t1kr8jxkvGv7vdZHDEVxj5JgfG\nBPXI7PBCIKVH/OdTL8fFMaeR/je/KiyHZXVmFvvWrvrBRqQ9XcTMYyfQut03\nog7K500DVNcSCq9l8sSb9+N9GmchNwsm2+A75hWcqLe5ljBpOB2UVsS7jzmF\n+ukV91IXl24BXROdP66QBkmloo5eri5Qfoh4jbtqIFFpBEM5XyRaPxgqp7PU\nF6pomf9UXnUq1VIWqv80MDECIvjdQcFPSgDAFxRAI6udyo4GqGzC5INV5PyF\n+E13FWELZFlUdeICm7nt4YhaUj+qFlLcv2Atp4QNI4k/hQPzBaYd3iU/r0V4\n08+q7/UT2XX6UZAxThi8tCCKUIk+pCefsC7J0AG5H8ww4blOg67h2kPQvVA8\nLXHZiuFCcUlEFGECw4vCceWeAKGK3Y+/GblnCQgmLudkWQC9gsf+rUoTUGlp\niskw+GdrfifCq/0xD2mE4kU7Du07KIv3Bb+fsp26vxNOVL2e1syW4fJQgTnt\nyNVqBy/uPlU7ZpkEaySqR8EyAps+lEVsxZKnfsAKhC8eezbbLJpNruIArCT5\nRkGYv6nCMRJ8+AQDOth9uq7VqSOhyqF+sGLsAk5PjWCAzfBxCyrWuEQeeGNX\ncHlS\r\n=whVw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"12c943490c76f911dda3861f863c68d7abf77ce5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.a94bd8deb.0","@material/rtl":"10.0.0-canary.a94bd8deb.0","@material/base":"10.0.0-canary.a94bd8deb.0","@material/shape":"10.0.0-canary.a94bd8deb.0","@material/theme":"10.0.0-canary.a94bd8deb.0","@material/animation":"10.0.0-canary.a94bd8deb.0","@material/elevation":"10.0.0-canary.a94bd8deb.0","@material/typography":"10.0.0-canary.a94bd8deb.0","@material/feature-targeting":"10.0.0-canary.a94bd8deb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.a94bd8deb.0_1609365913414_0.7242916558098813","host":"s3://npm-registry-packages"}},"10.0.0-canary.5d128511b.0":{"name":"@material/tooltip","version":"10.0.0-canary.5d128511b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.5d128511b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e7194fdc7233c36b593d5336dbd837818d0eb60a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.5d128511b.0.tgz","fileCount":36,"integrity":"sha512-zA21jgiGWqZ2JK5XbKIaWhNDv+AG4eQCD5mDAlaviq1XX7G1z4cOWIYiFM3ri9bf954HSmN1eSfBmbZo0CQGMA==","signatures":[{"sig":"MEQCIB6wX3UnrhmFC4twyRyZBC/UdtP+mIVny06VjZS5NednAiAa73ya63CqiazElNpnsgyJr6YaiZP3A8tP3ZRIDQqaTQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":464377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf7PraCRA9TVsSAnZWagAAErcQAI3f7HNXfscROaZeryZe\n+IRoMb0XkxkIbmECeNxcwkPr4A/nMb3GTE84tCGjXPWx2fb/5zfBSxZaFOMx\ncBPXobG5cKeMr07m1UQtvJqfdZIDKBbV39rguAj8iRhaSRCFPjPA0L/SpyOZ\nDm/wluA/ziYDwx3h9WHrODZC2J50i4RiTjCzQur4MjQCQun0vX8bjCsqxI6N\noEXDXo8w5ojSr3nNtp8L5tblZa1ucByhBfKTNe4p2Jubguh+70nQUKN8cCvA\nm+mpeXoI+TP5dY7bclNZaY4jjrwV2dsTpbCQutopWAJ6OnmbwSRs6gCjxgZS\nGQ/EdIamBGlYizTr6xDGmfs/iIM40Ufgh6Ghz15ihqMSoXZ2CfD/0QEqeI7r\nRXgB9kS07jpx7pkEATiM+qv1XWLdUPNQmHM99L9qTK3Pq0ozcSbEa360XGGK\n/4BChbDaSJrQN78OVFDTo+AS401wBjkLZmuTvFs4EPgb38PoVJ3/6e0BhD2F\nd0KEzr5jrEQD5CBStSVsFBW3mbBXN/i5ui/QGWXAMjPgolzoDk4oNmLEnZgx\nkOwV9jAeLZgDJyeKknsKpoWPTNKeah+UttNc5eQZzjJBPDgzoClGQth59t3z\nrX90JsfwzRMQRd0O4KYzWm4HIkV4ltLK0fAh+5CawYhSrpmMpBSd47vjOfov\nm2t4\r\n=Od6a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"05d17b41cbad4a8aebac080f082633a26be09a3c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.5d128511b.0","@material/rtl":"10.0.0-canary.5d128511b.0","@material/base":"10.0.0-canary.5d128511b.0","@material/shape":"10.0.0-canary.5d128511b.0","@material/theme":"10.0.0-canary.5d128511b.0","@material/animation":"10.0.0-canary.5d128511b.0","@material/elevation":"10.0.0-canary.5d128511b.0","@material/typography":"10.0.0-canary.5d128511b.0","@material/feature-targeting":"10.0.0-canary.5d128511b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.5d128511b.0_1609366234283_0.19985219811744193","host":"s3://npm-registry-packages"}},"10.0.0-canary.365c69360.0":{"name":"@material/tooltip","version":"10.0.0-canary.365c69360.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.365c69360.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cf91fcf2ac19ec386825ad69869e0f7d99e54264","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.365c69360.0.tgz","fileCount":36,"integrity":"sha512-e2BWwflPGsf7ZF2DMBplX2f65QvjezchWQ+NwSWKRjsZf5zURXsgzI3he36LQnWMKkPg+FOeIgqBGyEQgmn61A==","signatures":[{"sig":"MEQCIHcBNeTPr0p0v/d1g5YnZRTh0gBCACPOhs7CWz28bGg3AiBkplRh4L+SfGfa8CWt/2X+FsF4c6p3fGdQ1Ki26I9G1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9KaaCRA9TVsSAnZWagAA9jwP/3ysJ1DarrBsjqOsPhVd\n7CRIR5YUBg6K3H3+F4nCayVekM6uGVRES2dQwG/JuPZPRqngVGYfRfeVlXo6\n4twGYYe9yr4PoILkTREmMW1Jg0UKIcZKVNY0rzSjIK+rDDpYdEAGyu+hiXud\nTqnxrsQPdpu6dQxW+SFLPdt589EmBrWEoNziVRZivGaHW8OIqeZwGUUHPnYh\ngm8FLIV0Uc+TDi4VF3xvnA0cHMWllAqqHqbguU6ft6o95ihgC+r9PQ1+6vlT\nXNTFYe0M2FrgOBVLYSwT3USkfcat3d5CopSNA4a8xj0X2Cy4Rf7G0iQIJxHa\nPFJg052KWXAQGrWmDPQpJU8MjuqYpWu22VZ3/kvfY4Qo94/Byt31Zr6J7trn\nIW2jNEdihpIx7y6P9V8vY7Jt80/At+gVzRciEMcEF4TV23syj+T2IqHxcKdT\nKNbYUMdJ/jahu4nFuHPHrpj/KPAzlPTcgXzCPlXpFBDqB0dp7HcpRbQ81hgk\nkhvo/5h/U75mdnl3Pujhhs0AG1KLa09g8ZAApEtaOEoax8SURYdM8gLt11QI\nY5Rxt5zR9H7qi4V/gV334mu/bwf+ejO76Ix1J8ubV/a6D7u4VmvUW8pgfPb/\nhxNLY+cx7w3UsKdpESdp5GoeM2cTZ7TKe0jK/RMdc56x44RF15qfxWYgwZQ3\nVxkl\r\n=VzJ4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0b060c30e2974c71db5d5ed87e3ab7918656edeb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.365c69360.0","@material/rtl":"10.0.0-canary.365c69360.0","@material/base":"10.0.0-canary.365c69360.0","@material/shape":"10.0.0-canary.365c69360.0","@material/theme":"10.0.0-canary.365c69360.0","@material/animation":"10.0.0-canary.365c69360.0","@material/elevation":"10.0.0-canary.365c69360.0","@material/typography":"10.0.0-canary.365c69360.0","@material/feature-targeting":"10.0.0-canary.365c69360.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.365c69360.0_1609868953903_0.23264710451186255","host":"s3://npm-registry-packages"}},"10.0.0-canary.700a8261a.0":{"name":"@material/tooltip","version":"10.0.0-canary.700a8261a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.700a8261a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e8e777b46a909e094e81c026f1a049d1dbe88bb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.700a8261a.0.tgz","fileCount":36,"integrity":"sha512-o/+YOL4SXiwf6iOa+ZK9DK2nLl1PPw0Na92AHdo1ChxqlRG/UlD4uBettTKhQlggPGkHxLSN9teVoPiyGfcIvg==","signatures":[{"sig":"MEQCIFaMFsHYprLuPUKXP0NLenitSAQvwjGPf5rOXh5QwLwUAiBUr4OPvUusPL5qH1in5Xx1MD2AtwwefVMNKmaEsxiQow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9NOyCRA9TVsSAnZWagAAP6kP/ix+7KmBLs5epE66TNUz\nuivzr1EVjmuBIHKAlPvOZCZOwig5FIMOvLyJs3W0XKGoOtaDH8nN3FqlnzhV\nHVJ2maCaMSRorGQyuF3pd09QmvSggZKcBujPIxw/+5v0ImHpwftwIdxl5Nr5\nzMzXxqGW+enpOSrzgMFV9QZrgMvvKlLxWLQmh6FdxOJykFuH61aB2UCHHWHU\njdVEmrPE0GBcsnh3NR9T7deov7H3JHQjjwZ6raENeErNARB2woL4QVdGtAZD\n2t4LOR0Tn4fMWkBmulLRTOZuql824UosvmsUhbUuu9z/pnXOvW/fqy+VBnFN\nglgnzsDyjRaHbtQGWx4cLuqAWBEkLe5Jovz9IhPKKrsaMI7tVTb9nUycoR3L\nfcbRTFUHOhftQb1OuKmq81moOQD7NaJD29K/8eryZkPrZYLKLne+K/FV1AD9\nvgz8dOgjU7L8gZF07KKPDFAmbGQAdL7ElHNPY2DVCul0FMsJINXRcbNltIYk\n53dU2V1KZJTeLIkpQCP0ihYNAzlIkwhzJu/U4wYTaG/6egcDX5IQagR8Bixk\nEZZ+E+CJjoTyek61QRspkqh+hzw3dYotF+6qQB+nJ5KRb4D8JoCn1MgSQUYD\nyHSQl3bH8Htq8hfGeyt0SUATdTi4nhD6FWac2eAltEbYZAGXFOO6lmlCkS7x\n+uAH\r\n=gudu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0e9aee4feea82b83f34c723b52aac42fda1cdbd2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.700a8261a.0","@material/rtl":"10.0.0-canary.700a8261a.0","@material/base":"10.0.0-canary.700a8261a.0","@material/shape":"10.0.0-canary.700a8261a.0","@material/theme":"10.0.0-canary.700a8261a.0","@material/animation":"10.0.0-canary.700a8261a.0","@material/elevation":"10.0.0-canary.700a8261a.0","@material/typography":"10.0.0-canary.700a8261a.0","@material/feature-targeting":"10.0.0-canary.700a8261a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.700a8261a.0_1609880498238_0.38894115723894385","host":"s3://npm-registry-packages"}},"10.0.0-canary.766981c15.0":{"name":"@material/tooltip","version":"10.0.0-canary.766981c15.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.766981c15.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4c90f37fce9c5142c1b72c6b0b1a06a021b584ce","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.766981c15.0.tgz","fileCount":36,"integrity":"sha512-f1b0BGm4zf8rE/Rol7CrPsjwGBbT34jg556r8ZoSG4ktfkMXLi8eBgCcuQWB0lxOyngPzlI3Bj/5gJRye55WcA==","signatures":[{"sig":"MEQCIArPD5h6gp0IS8VHXYSD5K397CDFBjUGDR9q0vD9Q2WXAiAFll3rPpTKaYpofvwW7UycDJgf5u/Z0335bqMEZcitxg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9OsJCRA9TVsSAnZWagAArooQAJuAM8BDWdvq6/7nTx1u\nf4tr1nTjP0B4BQBfAE06dSgerhd3Ao3qwpgIqAcEWgoJ5RBXwfHu4uqwAjhl\nzdITr5skM+tMZudQcQosoNgj73k5b4WWU4UulJv35EndMEj+RYRQBm4qo4nG\njq1Y260Vgm2GsPAr5fr7XWeF1taHzPOvpE+/k5S9vws2gGBV2r0P4cKO6j0T\nBm560K1uVhDApEiOwkiMAtAqn5kSweuUaj92diE/H9s1Vubouu52AylOKGJv\njHW4YoYgUWt+ToRa/XMv6ZdZ5jJiCTrVCXhEfJY3rqj706ggUMxuCQ9YYjVa\nuOKFgkOyDbNlId1dwTj6Yv5bAbLj0XITadFnMqizj1mX0sVAX5P8+FQu+bwC\nDjpWPJaPg1xmu4YxasdD3dadJ75Lw6Zfgf8CetqyNuPRKWYyPKxprbimZvEI\nDRWhg3XL1E7Cv7eBdjaGOFLxGfzhBd2rHAFFrtg/2JLoKuRJlRDij9B61RfI\nkoZ1sy4GrjoWpY0PcItdBZfvA4qWIZeY/cd3uZvOihKqYPv44vsE50c2gnNd\nXIQUa/57evBnyMiqAtYKJSeTvy9DUMalt2zabNiFlmnJGe75Gzr19WHY92n6\n1EAB/A7YQYAmcRtD3wYKUj+hJvpIRzdR8vtJnZkaLRdbaONk2ifq8Fl68v36\nCh7n\r\n=YqLw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"40a13adf47648f48d6dfb1daac9ded2f7f0bd442","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.766981c15.0","@material/rtl":"10.0.0-canary.766981c15.0","@material/base":"10.0.0-canary.766981c15.0","@material/shape":"10.0.0-canary.766981c15.0","@material/theme":"10.0.0-canary.766981c15.0","@material/animation":"10.0.0-canary.766981c15.0","@material/elevation":"10.0.0-canary.766981c15.0","@material/typography":"10.0.0-canary.766981c15.0","@material/feature-targeting":"10.0.0-canary.766981c15.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.766981c15.0_1609886473324_0.828026163509759","host":"s3://npm-registry-packages"}},"10.0.0-canary.b28c576d9.0":{"name":"@material/tooltip","version":"10.0.0-canary.b28c576d9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.b28c576d9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b422d3cb9a7e068eb8cf65b6fdfc32a875f56ec1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.b28c576d9.0.tgz","fileCount":36,"integrity":"sha512-eXl8BxDPTlsOEYMsm9jd8OeacXxIYROmwFLmOc1UI5Lm9OtCSB2G7hZmyLj+zDPnCxMJaYr2X+kkf9BJRWsUMA==","signatures":[{"sig":"MEQCIDcBG1q8Q5J0sq3mS+PuEVfiA+xAl4M2GfhQ84HaVAAKAiBmKwHDEk7nHChI1uUxrbuJY4/aokYbbHKmNBhIMkmCcw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9O1OCRA9TVsSAnZWagAAQFQP+wakD+QJzCdl6zZOI9rp\nRuU4ISZh50pfH/m72P9EobuNbgyOQYOXNX04KgADtUw3AsEz0b9ig0lMa3ZB\ntNbs6tOA/p2YjFZyByNM3Dpjynax9Ezw/yDNToUV7K1BXttdYjmEcBniyKfM\n//Yjr2z67yLKIKpxMa2uibTo1SLxlgw21ETiRs80JlTMGH+OLIuYmf+FG2dH\nb9PEjvIsbs0yJLHxPfPKWcMAqYeCTlg2m3+PyrT/tOSsoS9d76w3W5/5+9h9\n4Rhof0s5Q3RVo96XmS7NO2GIsnU3tpv6th+2MNm53WBlbX+gJj8Zkae2oJHI\nOoIQ0m+W6LsQeNZ/KgkaY+b2Yb3UJlGTgtvGMUqJsy07SBTIuvmPY+DQd2no\n3yrp/tekO1POoptnh8eu3LfQ43tXN2P9BeiMiO6Hw2/arzHNDSGHBgmaJipP\nfbou2TpoI1GQPoOzb3hiA8YZRpA2pUXvz4CgO6Rlx8djJMnuvt27L9EN/3NF\nL3ZXb3pwSUrWq6+wusdyyx7Q9iNS+QOafTvokVxIAbrnVpftvzdM75UzF40q\nLZYbvXjLYW+DGCCuzFiHmssI/KnqBzWFFl5i2u6JJu9cIrkHSxyWbUjgp0b0\nG7mGlXGjgycwB3HoTj9MNUzDpi8+G1Aaa3ZCCDFiVKeiee99dgGP9wHM0z2g\nWwyZ\r\n=k+Wc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f11c5039e5e02253cd6e3eaebf7ee15629f3c182","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b28c576d9.0","@material/rtl":"10.0.0-canary.b28c576d9.0","@material/base":"10.0.0-canary.b28c576d9.0","@material/shape":"10.0.0-canary.b28c576d9.0","@material/theme":"10.0.0-canary.b28c576d9.0","@material/animation":"10.0.0-canary.b28c576d9.0","@material/elevation":"10.0.0-canary.b28c576d9.0","@material/typography":"10.0.0-canary.b28c576d9.0","@material/feature-targeting":"10.0.0-canary.b28c576d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.b28c576d9.0_1609887053580_0.796934385699416","host":"s3://npm-registry-packages"}},"10.0.0-canary.968735356.0":{"name":"@material/tooltip","version":"10.0.0-canary.968735356.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.968735356.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ebd734de27979533f87779e9e26656016aa91f0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.968735356.0.tgz","fileCount":36,"integrity":"sha512-xvPifFAAt7nXZCLX+ydULJTg6OQI0YqiUA+33ANz323rq9Mqvf/rOXB3DfesBqjlSe9KVMRI+RKozV5ltTp7jg==","signatures":[{"sig":"MEUCIBR2bT8XNpGjPZDMouQVTigL9cVoBtcHnKYZsOn8dOO2AiEAhja7NKiwy4U5/D5Nr+JLXQ1Z6o+kSOnfnThV1Pg8Cdk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":465583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9dyiCRA9TVsSAnZWagAAnb0P/1dN4GN8ixXSKTqpt8WL\nVhzZX7vovKUJ7izJZFuOb8xLTtk+SRh4XnLdquKUBWUQk5J4kzJqjlTEjW5R\nHs4TkBGtifdfx3URIS+9scn+qa/xrvuSD34dVl3n0Hc/KEKVva2sWSgqEemN\nWB79OPTiB5rszezeHFwkQAAI3wTey81jqvccoEJpfT9qCfg54n4Yc/sQxf54\nsKkyXCHJd5pQMsSP/PL+N7vGLewnbunvFOu1Nvaq6xBTyV5D15wFiWc4X9gX\nkr0Ujnyo6lFVqe1swYhvkCKRRKxKwLPJL88xmhgxmcC5koHlNlN97JY9FgTm\nIGwijnyIDFGqgogdQDxY66XRqaAl8l9uavr/z2QfT5RH5AgNhqwKJPF9xcwE\nf4LA7cEHRm6h/MszNxbVhnl73y46gURvSB9ggs1h4SMMyylOYUXKQTfb2KqO\nUvj9FVKMFW381GK2Q3gMVFi0ogxQMKXuQgkj+lgke8eqU6KR9wzfrsEZ4oBq\n20cokpUMff47kT0IzaUI8CUVre5I0NBPp3DuHEsrawGTRXKk3kdvcXVTQo2U\njpvXCpTMdUKkfNdOq6rxm+MZyGJ2Nli8MA8lKZTA0tXrVeLUXtVNK3YPO7TM\ntU4x//SvLNsAr7bKgpNmBCJIe8l+INeQfZKJoj0lhOj6vSQpwWGSH+KHvRd/\nXe2n\r\n=yr9A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"016bf1732e983523c8ba8007681b058735467018","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.968735356.0","@material/rtl":"10.0.0-canary.968735356.0","@material/base":"10.0.0-canary.968735356.0","@material/shape":"10.0.0-canary.968735356.0","@material/theme":"10.0.0-canary.968735356.0","@material/animation":"10.0.0-canary.968735356.0","@material/elevation":"10.0.0-canary.968735356.0","@material/typography":"10.0.0-canary.968735356.0","@material/feature-targeting":"10.0.0-canary.968735356.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.968735356.0_1609948321704_0.0642370059282884","host":"s3://npm-registry-packages"}},"10.0.0-canary.c5e18b020.0":{"name":"@material/tooltip","version":"10.0.0-canary.c5e18b020.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.c5e18b020.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"259a5ee47c1282b9584ee6692f4492a553a36b87","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.c5e18b020.0.tgz","fileCount":36,"integrity":"sha512-FT3NR9GTx9TaYLRe+v08g2TCK5ur9N/V/FWnTGoQVSVEl2C7WD4bJWTO2TGFYbA8f7ow4CarBa+OK2Xg6r/e6A==","signatures":[{"sig":"MEYCIQDyakQJqFuDjrTXRJza+PUsr5AfG8v4heB6krDd7W1LZwIhAIbFF7pqQpgg5ADWm4a2HzCSxzmg+WRUMVNW5b13ZZX8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9hNLCRA9TVsSAnZWagAATp4P/1pFr0OgVCTrOQUFI6qC\nPhD/XLYQfK7QcXdMm6e5RcIJYnFB9kgeO3gLXoo8+zSaLRjgzQM4R2wwo8VK\nxC/wDyQgvE6SZqE7iBKYXe/v5mAXmb6dJhYiqylwOCgtcSN55g6kJlrJjLWs\nyKpdQOI01GyL4TaV+DtaIETOyscJOhCq/8zYUAvjaz5Y5yFA3TwDqwPDbRQD\nH8abKLvDz2eoyPFYXJhIsiD4FuLwIIj9NzpR/MZhq3u7bPR4BgQHMEwInuCa\nmvJ5wtGK7OhAlPhn0cYE/o/ot+mbxMP+7/iN+aixJfcMAj90FPOtBGkgrQ6j\nnEMdJFS2787d39/DISI+SfvRGLGfVWlckHLlUd2jjLa5Ax2yiH1aD+4EvdDr\nctnrv6Wub59KV1CD2OXPAQD8FY5+9QusW+UiuqqTzPlJ+5mPjFf223prY4cb\nq+SwDfcH4Y1vuZjexP0PZRt6hvbPk3MGr/ewUbbJRRuSIBSHlzXzuOQyqhvh\ndWqe0VP4ASyiHVNhaosMtRz/sXouW7CobASbWje7d8nUHI0NXs7STuExjnl5\nqYTZQOkFv5GgdzyW6raGhinIyWWVFQB3Hyp5D1SbRvuiEWy6vh0uDxQzgAQy\nNV86JNKMr8zwksDmL8O5CeFW6GFMnMSInjGQeF4PyC06mNa7SBQf/Z15ly6V\nWA1s\r\n=TaHS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"16a60c2c89ea18fb88971304d4491f612734e932","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.c5e18b020.0","@material/rtl":"10.0.0-canary.c5e18b020.0","@material/base":"10.0.0-canary.c5e18b020.0","@material/shape":"10.0.0-canary.c5e18b020.0","@material/theme":"10.0.0-canary.c5e18b020.0","@material/animation":"10.0.0-canary.c5e18b020.0","@material/elevation":"10.0.0-canary.c5e18b020.0","@material/typography":"10.0.0-canary.c5e18b020.0","@material/feature-targeting":"10.0.0-canary.c5e18b020.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.c5e18b020.0_1609962315198_0.5501857338387777","host":"s3://npm-registry-packages"}},"10.0.0-canary.bcff8a66a.0":{"name":"@material/tooltip","version":"10.0.0-canary.bcff8a66a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.bcff8a66a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9159f3dcc8903782b51965d74e84333837c954b6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.bcff8a66a.0.tgz","fileCount":36,"integrity":"sha512-T84htG4hme8jD33OsRWv7yEuLinG67Vx7i5NRABeKHFYA6aBHyimx0f7P2m4PaARenLHqcJaq+O1Hjww6kikEQ==","signatures":[{"sig":"MEUCIQCCDirJla1DkPnYuytZcVKQkVjgMvRosxKpDI/PVo0VagIgCYRhKP28k4TNOoeW6AdaLAlEbdRzUs21Go1tS4IrFD0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":467960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9h0wCRA9TVsSAnZWagAAYXIQAIxf90j16E4RWR8DPE42\nQcbePt7SNJR7sw4l5C4ZPHjb+It9kGWNtdgSkGIK1XBt+vo6VrpC1Z2qY1IK\nUt2kLtQueK2KHy8dMtZ8OZZzLD0f5glMYRDsdiyRBzXbp6utl3kwp20VPzhF\nfeVQdWlvBeoVZnkgdyrZHGSHY3msWv5MXuLDDUL/q34bwAuxjTdufA92TKSD\nWTrA2mKAlEBQKc/U8+KKOsqzENTakUV8PfvA1rmtPTyQNm3QPjytQvr0bKVM\n5Fq60YwXjWwJRifpuOOS7JrM64PdpaXgte6x1Z90uHQ+N2oG++UGMOwIWQav\n+ULkZPnS3TkcUIR16fphicaoZCJxtq451rQg4uo9nWgKhkCLr0X3wVBon6fO\nGIwmtBI9IVLIoO/DyeqeNJE+fA4mSSDPNQwUhyDbRW9TD694Kwmp2e4wW37/\nBscDqOPF5nPkDjoGBBlsQlgplUgRdIEfLYH/EwFQk3GdoOW4aN3OLPxsSMnQ\nYBs36WSpk9nuh3n19+cuyLeE8MCsrH7asPGpFbEJ/gog86nl4sn/cbXAH5EE\n7LEdqWCe3fBVJ9C3HPtMM2y0C9K6i2nOLfHZsbpK5sycQjklFP9a6pKinv9a\nofYLjCMXy2SBJAM+4cm4SYlqD3QDBJMPf5sFYhCQ1rF44ys5LQzmJ4s11ZC5\nwphU\r\n=u5Oi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"81af087ae7601c8b819dbada709de8d76ddab960","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.bcff8a66a.0","@material/rtl":"10.0.0-canary.bcff8a66a.0","@material/base":"10.0.0-canary.bcff8a66a.0","@material/shape":"10.0.0-canary.bcff8a66a.0","@material/theme":"10.0.0-canary.bcff8a66a.0","@material/animation":"10.0.0-canary.bcff8a66a.0","@material/elevation":"10.0.0-canary.bcff8a66a.0","@material/typography":"10.0.0-canary.bcff8a66a.0","@material/feature-targeting":"10.0.0-canary.bcff8a66a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.bcff8a66a.0_1609964848510_0.4238370079144125","host":"s3://npm-registry-packages"}},"10.0.0-canary.79328c9ff.0":{"name":"@material/tooltip","version":"10.0.0-canary.79328c9ff.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.79328c9ff.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b01a025bdd11755088e134e4b6a3fc092e7dd1bb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.79328c9ff.0.tgz","fileCount":36,"integrity":"sha512-8DUQ2td1tzu5+y+961IKhZOqsT29uhe2erLZj5jXcla33kik6o8e2Oth1FoRpmMYeRZotyEllB1m+n8+pXaPHg==","signatures":[{"sig":"MEUCIDYemgspMeTysXYvEJwGBORinM74NRjnRlXx5wAJMa/kAiEAreaOYt4WFVTEyr0hdEU5aXZ2W2k5g+Oi+RqF2Jd30CQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9nNdCRA9TVsSAnZWagAALsEP/2QAbiR9Wvyb/bQ57b0G\ndOINel1MZZji/X1vmMjJFC8SJLl7KmIiR9rq7Mjf/yGf8Ra10CsDagYdH3yf\nUnEs1uJgUBH6gRjqdnzrx2O03HsjmeJWPH8M5LSC4ovzEWT8Ml41wGw3h8oy\nAZuO/Q4wrWK2YBAXb5hS/j4dm8BykDyLqU3umJk443IBAdIk9n2xQGbdjjTC\nLUoa5ANkTvKok9h3WEoqCk8nPBDRbbWsF4sAjbPZBxtDcGqzp3QxlR5KCxnn\n88dKqTn6kp4OXZjXlRzrzQM2OY+8JtF6njWkhRYLuOoVflJSQRpwEXZ2R5dB\nw9mNPe9gyne38PhQZ7U8/Sf9v1XA8pGeuX4p5yxPxbQFJVr9XyA7lD3ptCI/\n9ArlfrcTdEgb28WPQcGe+sBqvW9xFbdibPvdWtZOc7Hnif3sZZqxX/537ueS\nc5HxZRM8thB4TQvrD0v4WpWlLMB4dgwq3D/ULCMsOKjkgIwmAVxovaNkRjwc\nQg8v4kAXBmmdtyR2ygz+wKTLwPQx1HbPPWIjYk2lLCF9ZaGMnCmMPj31loUZ\n7m5OCqb+JBR0cryQoaBe6zENC2BKoLwpJl9ywMx/tr1IRcsSnkf8brC3bybz\nKxQIG4ZRCPqlPMHE0NNcuhP61p1wNQH+UuxtQHD1ozieb1zwzp8F2/Q4fpYM\nvVJg\r\n=qjyc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"15dd1d7d9065f275f9f9779094b959944d33197a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.79328c9ff.0","@material/rtl":"10.0.0-canary.79328c9ff.0","@material/base":"10.0.0-canary.79328c9ff.0","@material/shape":"10.0.0-canary.79328c9ff.0","@material/theme":"10.0.0-canary.79328c9ff.0","@material/animation":"10.0.0-canary.79328c9ff.0","@material/elevation":"10.0.0-canary.79328c9ff.0","@material/typography":"10.0.0-canary.79328c9ff.0","@material/feature-targeting":"10.0.0-canary.79328c9ff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.79328c9ff.0_1609986909456_0.6423928566559982","host":"s3://npm-registry-packages"}},"10.0.0-canary.121e1f303.0":{"name":"@material/tooltip","version":"10.0.0-canary.121e1f303.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.121e1f303.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2714d06fbcb0fe29a8c25f5bffcf77db13fdb114","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.121e1f303.0.tgz","fileCount":36,"integrity":"sha512-Q876opo5UWkIPw53hNzMNUDpP049L5EUszVWTyDFoWcMdpRjYVPp64UFgbdX2FWqpUlDgX8Mf4akhEOhb8GVdQ==","signatures":[{"sig":"MEQCIDD1dhgPGIx/PYNpA5GFS7lDNRucLwW+VN8UVvKAX6+lAiBtEdWpxq+xL29IT11V/1PqIuiYzNrQHvLtYV9Z9KrpxQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf95dPCRA9TVsSAnZWagAAhL8P/1cWmrk8d+ppYQs7GaVV\nMYIlaxvEAmBCTsTvfndl4mF6KnKpzdkCweT5DKy+Ujyy4PbNQviMkuUoYivl\nkTl48TrNdJLMbrlSyr6QcDE2jLW/HJnGjDydTvlt7JOxYW1uacGiUXxOKzvL\ntrEBGHvRiH2/8Fb99w7Q/MJA1el7YeFwyGojuln0brnz73+Q2SNuBazxY//o\nZNsQA5hhWOSZLGDOxfMXC4C4DV9dbk4DAlg+t8qONK4//ZvQarYIkmqGW+Gp\naXyKtUetSLLtSV6R89vMK7ML8R5GLLPv30kF6SwbGHEdCBCcuVQ8DMMAi+hE\n/s+eHQmCIL8ykpfnA9iJJBezVvR58o4FrTviPq6GGhaJ0ZDOkGbl8ddhOVjK\nz7xpg+NhttIt/mW7W/jPayVGvl5ZMrZDVtCn4h0ELMjegsE9fNc2NABnSeRI\nnDXgraHyRGj154H05z2/CjJKdh1cDuECSz1YmTmLi/vzXyeOoaoPpVtD0bxz\n6FMxjC9kxyK2cVAO/5PX1DWzw+1WPi/2l+EDmStiItdlAStfqFdXoRpzCIAO\nxMKe/SqMmwiE9Ij+71JTB86xhHnMKhCRYKQcc628nNxLAnCu6GjcDAOWt88C\no0MugXDZzux8GNiEDBrS6ij04PLmdyNsW4f92si90UtCbDyYavMC02RjpiWk\n2EhH\r\n=Tg9R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6ae814dae9eac40570f13ed9d7b821cceddf838f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.121e1f303.0","@material/rtl":"10.0.0-canary.121e1f303.0","@material/base":"10.0.0-canary.121e1f303.0","@material/shape":"10.0.0-canary.121e1f303.0","@material/theme":"10.0.0-canary.121e1f303.0","@material/animation":"10.0.0-canary.121e1f303.0","@material/elevation":"10.0.0-canary.121e1f303.0","@material/typography":"10.0.0-canary.121e1f303.0","@material/feature-targeting":"10.0.0-canary.121e1f303.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.121e1f303.0_1610061646886_0.297267935489375","host":"s3://npm-registry-packages"}},"10.0.0-canary.abdd10065.0":{"name":"@material/tooltip","version":"10.0.0-canary.abdd10065.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.abdd10065.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b42f3a6ab35a1a9f32a198f1e493554a815a0173","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.abdd10065.0.tgz","fileCount":36,"integrity":"sha512-EKgdA656J+3Z9v/v0THRb9AGMqQNp8k5RDnhYGQ6nht5oKvJPCgiOZmkEDg911ziG8NLDAzH0PO8CT/LeUig+Q==","signatures":[{"sig":"MEUCIHV2ZiGSlFOIbX3DPYOvYJfvWE5GHYtXoWBASaDD/zQzAiEA//qx6Acrvo2PgTy3UTPnlohDtgKXNtVSMan28U+hq80=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+JvdCRA9TVsSAnZWagAAi/wP/2aRciDm+Z/yAyTS9er/\ne6fwfTpHV3ZxsP5yBukwPt0gnGWbBnpe6GYd5LX3osN5ZSZ7y2cTYfCuFIjG\ni0GgKeyklBOyxgDP8SP0rtLmjjVmqrR4n8xQvYrK09lsKhTFIyc3iZrCEgKA\nhy1HcSbIUNToVRsUtDl1JlQuxZTujTxqcjm6lv9bA9QvMksfrsWxxPKcNgKH\nHZ5YjZyFren0E+WJ+YgqoRYmn+dTxq+Z8L58+uXD9XZOkBUSf3jJcU6V04g8\nSpaKBINu8ee2etDLo/xAxnwvKnf7hsy1KNzyXCJoSlVJTvhIpOj1T8eXhwZ/\npkibQGfFz5MBLD5+rfSnmOWA0lWRX+FB/NsgB225H/CbOD9gjFZFUqmH3lye\n9q24kj886V4XK8n2sFO9RW/qIWdfQyj30ZSONwVocze70D6hNC8zOJ3jfea9\ni4DSv4341iR66yIu+mXlZ+uKAc5O95k4T2qkd8gIl+1N87S0WTUsqcIDOcYq\nQG8MOIS/6T/jPoyCtwanTqhYiJDLU557c9sA1q3LwlLlSEUTZg2E3x0NPMpW\nTV7I0YqdD/HzRKw4FCt89QYW34/iBjBifUrusXSoQkPs6k8cZWpkHyW/gneo\npMkIB6LsTOsKy43rAiwRNBVfUaq55wVggYDvoxEwzgqrVKFWXoso8EyjwRwy\ncBod\r\n=nbBL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bc8986a19721edfc6facb62cf839cd222de97d02","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.abdd10065.0","@material/rtl":"10.0.0-canary.abdd10065.0","@material/base":"10.0.0-canary.abdd10065.0","@material/shape":"10.0.0-canary.abdd10065.0","@material/theme":"10.0.0-canary.abdd10065.0","@material/animation":"10.0.0-canary.abdd10065.0","@material/elevation":"10.0.0-canary.abdd10065.0","@material/typography":"10.0.0-canary.abdd10065.0","@material/feature-targeting":"10.0.0-canary.abdd10065.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.abdd10065.0_1610128348929_0.6508770483416007","host":"s3://npm-registry-packages"}},"10.0.0-canary.089de519c.0":{"name":"@material/tooltip","version":"10.0.0-canary.089de519c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.089de519c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e875f513ef81bd934f0643f210304c89eb7044a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.089de519c.0.tgz","fileCount":36,"integrity":"sha512-gj56E9IgnFf+c3KcRq6f2/uim04lJ7KClP1q7DA8RtG19CA7wyX3HY3npHRr1IjQoZPKaVj1FtkHsItmt0Lyjg==","signatures":[{"sig":"MEQCIBZ48TmlaMSW/DCV1NjWlLtaKrtnzsvwxcphlcxncGhdAiAi2S/8keYU6H8Wsdgd2Ql6crMMnQmH8rINjRjFZ09qzQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+NrrCRA9TVsSAnZWagAAdHQP/2ruSy31NPdYi5cVoqTv\nMes6r32Pm/gM9NnYF3HhN/43GGKgDyMbrdttTANEJ68864yKBaahEn5XgCb+\nBHNRtgb0HFYmg8mkkuiGhgyFkFtpHTIq9UGHS2F2uGwUSwvUNtAoNyBrWWjN\nF6GmnRbzSPaIWxj7JPYL/V1ixrO9tsyQ3GiAVtms0mjZlaD3op6NN3Jkob/B\necaazssY41Fa8mleEr5TOOiWIewPV078S7ywPiI0C/5ZSNK3xXoQYCzKH/MK\nJcRIYJkT4AFIaxKkAnQS/Vi6/8fO5nfyaod1lQmY6rgX6h4Q/vwT7l67zbWC\nV3J1TNvKGpaEYs6eFRpvKm9niR6CzNzJJ8h1pj9csq6w4tqTxdIF+ADCImvE\nXUJz2BoDDrMK3BU0L5kmi/9Cf94Dpsd858x994gYRfpZKZAHqxcCV9hqFg+9\n5YvOCElo5nmOH8DqhD/IAgcden/JjES1Hsc0ngCDcjvwPf63uzG4I/ySPPW7\nfJhAKk/HyH6y/vm15m3vgV1IDkmQQZY4PcGpII5nJbCXHewR9VcF24/6TLAv\nssR9pqR6HSqAy+jlOzylQksAzqkHFB2o1hbVmnzyx7jJyzVf9z0JuJpoxC9i\nGPZScQPYEhC44faT+n4N0pAZYzkMGYB7l1GwsVUh770MTt+lEqHNIrFnQbSg\nyNS7\r\n=/L96\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6a64709b5be73a45401fe82d1e6d126d7312fd21","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.089de519c.0","@material/rtl":"10.0.0-canary.089de519c.0","@material/base":"10.0.0-canary.089de519c.0","@material/shape":"10.0.0-canary.089de519c.0","@material/theme":"10.0.0-canary.089de519c.0","@material/animation":"10.0.0-canary.089de519c.0","@material/elevation":"10.0.0-canary.089de519c.0","@material/typography":"10.0.0-canary.089de519c.0","@material/feature-targeting":"10.0.0-canary.089de519c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.089de519c.0_1610144491090_0.052761620252463226","host":"s3://npm-registry-packages"}},"10.0.0-canary.163119837.0":{"name":"@material/tooltip","version":"10.0.0-canary.163119837.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.163119837.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"93fd9da00be3ef9d3c2474e1be3cb91ef3198910","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.163119837.0.tgz","fileCount":36,"integrity":"sha512-qzZY90QBhMuv4kz/5w+Z3+X360ceqzJl+XJ0TjK4nDLiewyx3YrMdDIvWQUG39KzUU+zSbFXttjeaaIHDbqUzg==","signatures":[{"sig":"MEUCIBa8bMuhFtZyzq1yFjmtJppeeX6oucppQ/syTMdQoVYDAiEApTqP21KrUHCzm0X9CXzPC9InIL+56wn2c8oogNNHLOA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+O7LCRA9TVsSAnZWagAAphEP/390s78e0L7G0QLfbcPi\n2hJSl7PkAVJqk7RHtHxtwyNPTKkemxVE+L73Q4YUbg2AXIeNLD3vK82M/0eL\nRWwx14JAwDNW97y2tR0BkigjSvV7zQPjP2Cxb3qQ4Tk8YktJZ4YEKK0/9yYD\nTiQu23DFN02FMmLbVChZJSzS5oaZSJPUKKYFt99zAC7IKsaqDVr0lr0Q88dQ\niZ7u3cijOT8YCAN2mM1mAtyShy/YQobAD7CfEKP0h+q4gi/1iBBpl7K7dt7G\nXH5BCCjvQFeonagRzlORFWISGaeBg/OW5ncv5PnvN95y7855mW1cxw3jUZF4\nATSCBT1o1RINjUGKZYMlzSgu0iC05lazMQ91TAJMoyExkhg7sDzbn5QvQ15J\nVWqgYvLg5Fby0XZqniTmV8Iar3jxzkEXx9tPjf4DWxjpBioP44oXaeMEXNuH\n/IkcaJbI9HsEsIda5TEfbQS4dZFMr2kanhJD22G0jox6k60+FL3NXpTcWCdV\n5alNFIy1dhaotkf9Or8Q3bhC8QYakOrEhgOCxU4PgGVK+/s34IPtsRq7X2V4\nuEeMX+Bvvye6CDwk3bGpqrQMq87G6ktuziPmuM13injWd4GcdIa3cltJfNHz\nIcp4BYwwfYEJgoiTL3q/IKjxdacRuqu4nmfB4rHanE39/pBmzJCnCImKUMfA\njd9c\r\n=dzwM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"86f8af57c151ec42ed920ac445544bc384ce0975","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.163119837.0","@material/rtl":"10.0.0-canary.163119837.0","@material/base":"10.0.0-canary.163119837.0","@material/shape":"10.0.0-canary.163119837.0","@material/theme":"10.0.0-canary.163119837.0","@material/animation":"10.0.0-canary.163119837.0","@material/elevation":"10.0.0-canary.163119837.0","@material/typography":"10.0.0-canary.163119837.0","@material/feature-targeting":"10.0.0-canary.163119837.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.163119837.0_1610149578937_0.39376936873377355","host":"s3://npm-registry-packages"}},"10.0.0-canary.b8a1a58e4.0":{"name":"@material/tooltip","version":"10.0.0-canary.b8a1a58e4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.b8a1a58e4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fe55b892fc5bcf5612c50999861bbf0306621d1a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.b8a1a58e4.0.tgz","fileCount":36,"integrity":"sha512-LQnZiO14eKBAIKUCisfkWMNvjW5LW5Hs7OdwubKVudOwpRceqPETsFALAGTVejIfIA9rD57qxpi6TEpOQmq+Fw==","signatures":[{"sig":"MEUCIQDOtFkXbqMnKdmZSE/Q7xW84wc9xZJ8YBDcblbsgbJy5AIgGiKM4tVPI2KkbNrDAOo/NOBdFF01bDcXsq7dH/YBvto=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/HvyCRA9TVsSAnZWagAAsXUP/2OYFlfIYJLvpkHRKVWY\n+Rbii2byJD7+AkOsytE0m9sMBblTZ3zb3u/sakIT3H7XIHz+16agnSiWZl+7\nhtWntShSFwuh1fkRsvsq312PPd03HC7w2SSQBtB6vqXaUFNdD7qP2UZWv0Kk\nranKPMhZGPsMVo/a6bbxwSdIlb/miXl3R7uAOYlEilZcJp57NBFS5+XpCCNf\nNnmVoBs6dEMU3b67ThldO1rJxShoQUp79WvZQfuWMCvEw0AHAmnDNOzs2zvk\nRGKV1N/p4u9flMR58fwoi79mdBNPII/9/hAtbEAINAyv0zIs2Yx/eWYtEhFR\nyuoY6OSgWTXblqXA3Hp+642I8ezgrPxSDXddB2YwBTvF0OXzCFQgmB0knC6u\nysSnBizYf7F6tBzIp6t38i/eyNvqWFPOfvO6gXMDzoXRdYnWwqaZR34u81IG\nBagiF60/fn/R4NwkcS+gVtKuSPyOlNUUy3jMCoaLLQ58bRQAY3dGj4gdpTzr\nw0UIbbSJqFfkG9r7HJ6miWSIpzHrVOX1KsismsKdRahr1+93+pOr40BghZc7\n+Ei03+Sn6axqmz/8mOvrrmpiZ9iIAYgQr7tFMgX61hdRVNlgzsMd2Ad9vEEX\nLY6iZXiW1hWULMEjz6d+5jU+Y0HPL8FMhTARFyieL49iQfVbDSsKFuF+vYR6\ngr0P\r\n=D+Gp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3b735aa03cc784b7346905168638eb6a486435b9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b8a1a58e4.0","@material/rtl":"10.0.0-canary.b8a1a58e4.0","@material/base":"10.0.0-canary.b8a1a58e4.0","@material/shape":"10.0.0-canary.b8a1a58e4.0","@material/theme":"10.0.0-canary.b8a1a58e4.0","@material/animation":"10.0.0-canary.b8a1a58e4.0","@material/elevation":"10.0.0-canary.b8a1a58e4.0","@material/typography":"10.0.0-canary.b8a1a58e4.0","@material/feature-targeting":"10.0.0-canary.b8a1a58e4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.b8a1a58e4.0_1610382322446_0.8312096833510751","host":"s3://npm-registry-packages"}},"10.0.0-canary.7584267ff.0":{"name":"@material/tooltip","version":"10.0.0-canary.7584267ff.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.7584267ff.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"434908afa904431d630b7841fb05b220ea9880d9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.7584267ff.0.tgz","fileCount":36,"integrity":"sha512-9kiCeLFvGRI0Ee1y9FJS/LoMz8l413ekvVzRFwGXxzKQXbAXQTcHwFPHCXeeFkUWRAIJkGyJWZ5C9QLcEE8bXg==","signatures":[{"sig":"MEYCIQCb54r6cjydAY8g1zEJDdzHyTRj8XjBV9+lgwmq4WX9fQIhAL12odQMXECT0h5+QMSmf+jgEmh9TVLacsT5EiQ16vAb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/PevCRA9TVsSAnZWagAAOfYP/Rt0gKFUtrc37XBZjtSV\nznnMdVGK/UT3IwAI/6TQZmoNXSBLbWGTGUOlkPBsZDIMp/70vhBaEFvH5n8u\n1aWPXdf2KFmIOkLP/+qaT0n/t0bBHAaZXWK4JNrSCM4Y1Gw+kHJ+7+ikmnzr\nwTuPojyWilo2vicw5lBBiUPqGmEf4YzI+WFSkswk78OLbpxkOCBvrRon7/t2\ngK1vPHbQBg+I1o+wLF2CTFKmGI3CYJfwAbbkTlZBHY5cafk3ORR9BKLKmJqy\nc/p+p5D/dbbP8uxMn2k0+rPmr6Fp7Nmr90V0g068ylzBdcIVY7p8ywzmF/nc\nRKUQ8wzMZVD+gpVtpvnS7GxcrxvCYxaOJSO8Y2sVtaeTiz4+pLls2DWTuYx6\nvQEs+w5BU6rbZ33F0m78h3t6DUvqJL71mG3HxSnyf/wK+q9A3vhXP0oJ0Ntp\nhNtQR4BT40JNaIVdeUoilcBaQpEOaVEEcTLOe3lXPuR40OPszXb67w+SS9BA\niKuqz7uL6ppKEwoCeJ2jOYJmKJbVyCdVMH3OIx+zIuPOL8eyxmoiPtgBaUyy\nTe4vZ6FAMO4N9NAGfsnRRGDCpeUnxnoOi44HZbNp04DhdfxijSAcU9Vr6PSW\nBNIFXBCoSfxbbu4AtByLUVqk1Q6raZM+mXrlUkM7b66c2KwG0r1LNJNVBg7a\nYIZh\r\n=zMSZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"89cedd80674ac536aacf2762f084fd7d1640873f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.7584267ff.0","@material/rtl":"10.0.0-canary.7584267ff.0","@material/base":"10.0.0-canary.7584267ff.0","@material/shape":"10.0.0-canary.7584267ff.0","@material/theme":"10.0.0-canary.7584267ff.0","@material/animation":"10.0.0-canary.7584267ff.0","@material/elevation":"10.0.0-canary.7584267ff.0","@material/typography":"10.0.0-canary.7584267ff.0","@material/feature-targeting":"10.0.0-canary.7584267ff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.7584267ff.0_1610413999339_0.11159117943351249","host":"s3://npm-registry-packages"}},"10.0.0-canary.251ac04c0.0":{"name":"@material/tooltip","version":"10.0.0-canary.251ac04c0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.251ac04c0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5e500c07b58f424d9064c30a495ae656e4dd4cc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.251ac04c0.0.tgz","fileCount":36,"integrity":"sha512-RKjtnsNmg+25PcHr9Ktq9TMI98HTzGTdS6bog4fcDQDT4A54coxlqjxGatVvUfmYY94F+jCNJno0nzFDrhlwxw==","signatures":[{"sig":"MEUCIDF7Fdfa9/Ioot1QT76m9nQNbcJi2P6+KlDGoe/02TfvAiEA7bhLCkg84qRvIxo/hQRmj/9Cm2I/Owzxsf/v1pR6Lw0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/f7mCRA9TVsSAnZWagAAIdQP/0kKuimqzkHg0Iu0m3De\nfo1qSBI+YB2ib+vFGcZ6yptIa5Ndz5rndzYe8PNCOAvOXaX95ebsO+E6+P8V\n02T4Jlmj0lb15YSmiXHksKy9MRTVhsQjQsq4NWzhv7p+EU0bAXLra1BaBXzb\n3VWn+h91COolsf9dmrWw7i0IsElHZNzZQwL94qhaPN8yAav3n6KpfdwrFQMs\nKzbwtu2/i2eu+Hunc5kh9Hd+9w72diYn2UyntxpPQ46GoMvGL2HKLslwaiXH\nr6x94TTi4rz/PWrCWfIKE1gPSHk1K4sFs4rkQPUiBugK5Ax09gUsFlzsW40P\nObrGGaMnRZxJEGvfZwJvNOW2LdCTYawlSn2vaGhHd2AXQD97hG+AB49u7O8V\nBbGeRmPQW/bk00qh/YBeLLpl5/F75vj8oPDt0Lfb0MOe8vnMSRmXyip+PUeB\nXtE9KCVu4LRDBYC+6M3euqMR59gVQv0Jbg6cdaZkqsKaynjMEu8T9zYxVWIz\n2tOW10xsiSGC3RzfRm4vZjyqjgHsqBB3P/RsWEJMO99qB0+MSUfYDFrx7Zx0\nwtnyuyalmdDnID0x50U3AUfw4MgcNOcznW3xWnAxF7ujI+v4qexeU1JVHYtQ\nUB5J7q1N9wH3gs1bYz7TftpV+WD0BD/9Ku6tO2UnGqfVJnjJJ4mFykGkr6Eg\nAq21\r\n=0UGx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bacdc97357600156630f8321ac8a3a8746474194","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.251ac04c0.0","@material/rtl":"10.0.0-canary.251ac04c0.0","@material/base":"10.0.0-canary.251ac04c0.0","@material/shape":"10.0.0-canary.251ac04c0.0","@material/theme":"10.0.0-canary.251ac04c0.0","@material/animation":"10.0.0-canary.251ac04c0.0","@material/elevation":"10.0.0-canary.251ac04c0.0","@material/typography":"10.0.0-canary.251ac04c0.0","@material/feature-targeting":"10.0.0-canary.251ac04c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.251ac04c0.0_1610481381168_0.34628190289004235","host":"s3://npm-registry-packages"}},"10.0.0-canary.772cc1068.0":{"name":"@material/tooltip","version":"10.0.0-canary.772cc1068.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.772cc1068.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ce62d3407ab03710f9d691718c8811074db4504","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.772cc1068.0.tgz","fileCount":36,"integrity":"sha512-LHj7LoMq4v4Fl2U4vjM3NFnqHWT5/aALiAPKlTN6NHF8EuTnCbv4g5w/qa6b9RLObgdeOQqQi7uMkemlmsNEhQ==","signatures":[{"sig":"MEUCIQD/wFULJOxptiudGseRIWis0flIud+t6HlmtEeS6pDJSwIgfalhA32SGyZNF3h3AOVLVwoyXUIu2s9Tcs05okGNeBo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/4tkCRA9TVsSAnZWagAABBQP/jDwUTUzpbLK+Rn8C6mV\n6okso8iJBL2iLK4Wj1acHF3dGSchTHrAUHHsDrRIloVoglSyouj/GTfB3OPj\nxpQSQdoSfjgcgTrOPuqopkcwPjf4VvgxE4nbyW2mUTB3GiT3RV/LijqzYWOd\n7gMCyUs3GaIrHbPeokabKzermjcWbtYQDc0Md8geTNDLOqwcczHc4mUY5Flg\nTleX1KHcDZhuew+bjyVWbZtqCsspZ0GbHi22VDLkaLuPMQeFVIlOhStcl25v\nGu8xkmoEpDMO4Oyc9573WdAyIqns/k6Aza1iYqvD2xDFgZjX0OzS278RHCWO\nFhIpSsPL9Tzk2wLfA8EIJjl++CQpM2Eh7KUmhgUYt8KjZR9erXrUnxgj0FrG\nIL2WjLtUkYDogbzHOXsyJLkXY17AE5pWnH1SjS3YjTvl6nhY75Xaf/+QOCR4\nSythXB6v7QLrKcXI+Km6yNEn/niKtESSBSPmOe92V4yfrYfqn8zRH3hAeWnN\nEUvengk6cyL1Fay8f1u9VLKtG1sG2LYkX0SqO3mWM7tL5uEeZdLE+9D7AtbQ\nRTVm+wxoSioM2Ue1uFI6lYNCjkyfGOGG+5Her+yg7KgL5UE0sZI2J9Q8yo/x\nk2n3nwDY8B++Plcl/YScRSuuNaeTnEbxtAec9voWHOpBaZknZUHpfC7Z5q3x\nuZTT\r\n=rUHR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e8dfb103b25351e76ae27e482ed4f13c4bf997c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.772cc1068.0","@material/rtl":"10.0.0-canary.772cc1068.0","@material/base":"10.0.0-canary.772cc1068.0","@material/shape":"10.0.0-canary.772cc1068.0","@material/theme":"10.0.0-canary.772cc1068.0","@material/animation":"10.0.0-canary.772cc1068.0","@material/elevation":"10.0.0-canary.772cc1068.0","@material/typography":"10.0.0-canary.772cc1068.0","@material/feature-targeting":"10.0.0-canary.772cc1068.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.772cc1068.0_1610582883852_0.7810244016293191","host":"s3://npm-registry-packages"}},"10.0.0-canary.fe13dd130.0":{"name":"@material/tooltip","version":"10.0.0-canary.fe13dd130.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.fe13dd130.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e893cf123d4b5e805c4652509003cfa2b5c64ce0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.fe13dd130.0.tgz","fileCount":36,"integrity":"sha512-B+NpOTb2b8ub3jVhUtlnUDZRQz7RI8zIT57o1pecAVPvUErADHmFeBctnaOmkTLP2h/h67aRtjHweLfFN0DVJg==","signatures":[{"sig":"MEQCIFCX+v0QGfL7wVCPlIJ9rISpYK73CihP2Etd/LCj7+pNAiBWjhPBiUNLBgocf+JO2noCpvghiPXy+bWjePWMvU1veA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/5owCRA9TVsSAnZWagAAD6EP/jbfp+EX4RnmzZXfMRmz\noPFVJhrDNk9SN68YvLFK9UwmFvj7WxZWxWdqY35wNmCQxOXMKutfX1gXLMl/\nwY4Q64TwSZgfHI/DKsjVlig8K3JxpMWMiyhT+9wt5suh6JRJ8q1Uwa8offxy\n9hqnN0QeiHo2lGnp4Vp1FcPIUViX8EJY1hu4wCkcgb/VqR3u9PiRxeksqa5L\n+PFJXAEwixifGCMU13z61l9t5uz8Dp7K/EVHufH2c5b0CIv5hTZBZ0Zfo80p\n8C2K//ySJ04JcSlpZadVuGOYfTQFqse5oKXAOR26ekKLo/jmNWsfiDgajB2z\nY85JDAe4E8/kwGYjTNHnRmQRCOB8Xx3vQc1ZlwHyQgElCIzvrcoQJehABjnS\ndDZ32cL8qfU/UCgRqoXTBVFOmbUC0Vygc4Npm8ojvuqB+QDD+D10WvjmJOyL\n9HUGbK5oik7q+xbJGSjr2alsfanHb1dBA7pk4U5OYc7gqEzsZek2IVciW/f8\nxV1rKtHLszHZTdu/Gn9PMmxR7dmy1ZoWKXkhQxxHLas9HYqQlWhHzr/z/rhV\nPxcdGmSy6x6GeLV1BQb/g2I/xKaTDJMPbN5T4/rkL8Yoon+G2o9uTDl2CAAx\n5ZpkZpF/v3YiNBHSYmXQ3nzIt4tIZlCqfZbU/LhjDnVppNZeWwZqqSrHiyEH\nVak3\r\n=c1SK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8825c25e04c8e88b7430f2f8e148da8a9197c02e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.fe13dd130.0","@material/rtl":"10.0.0-canary.fe13dd130.0","@material/base":"10.0.0-canary.fe13dd130.0","@material/shape":"10.0.0-canary.fe13dd130.0","@material/theme":"10.0.0-canary.fe13dd130.0","@material/animation":"10.0.0-canary.fe13dd130.0","@material/elevation":"10.0.0-canary.fe13dd130.0","@material/typography":"10.0.0-canary.fe13dd130.0","@material/feature-targeting":"10.0.0-canary.fe13dd130.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.fe13dd130.0_1610586671777_0.9753025278745047","host":"s3://npm-registry-packages"}},"10.0.0-canary.c7c5da28f.0":{"name":"@material/tooltip","version":"10.0.0-canary.c7c5da28f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.c7c5da28f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"158af8a76e56cbb6d2eb7f20ec5c81b879abe532","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.c7c5da28f.0.tgz","fileCount":36,"integrity":"sha512-MehLB9R+8l44c0SYJuZb6dc0cmVTp4C9dZYL50mewiGPf0MdC7YeggJ9osxOstxx0I+kqT+kbE4se4PasSOYmQ==","signatures":[{"sig":"MEQCIAajzFJyO9FMNCyQlmhBDx+DIDuJHjiVlVCCwpiYuUGeAiBnEwMZnSUcRYXAxxeEK7zwxT0NzcDi4W2lMBC+ihpEug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/5/HCRA9TVsSAnZWagAAhs8P/j+Tg2bX35r2vN1+fq/+\nDDCDRSjp+iiExU8xT6CBSVOECB5jg1ESV1r7YQ4beb9uie+FPCVh6wPTtn8z\n/b9czzlxIIYMobol++4zQ/aiCpsUDbs7GD2HGVtPA6sSLE+3V2qzQt8Q7OpE\nDUUalpXh+uhCkAj8F8ZbVOHmLgM3WnL2bGX9JX0DHUxF4ExgP1YX2DOvzJgH\nc5YFlwg0Vv7l4AFChnMSas5IzFz9d7UMOe1F4ih4bU32GBqBVpA3uugCotRT\nf/2m0dqY4JxQ7ODiEk33qAA1b7LzVSwaIF5d0/aN61Doz8JddmyPVAWJ2gct\n5TI1my/aQ3FN9WtRyHya2DA3DKaRVz2lp/NG7yf7+xXvATXLA5FFj5aGr5KC\nfp0iBMFRODx54q0WWTGkapmVmgLxPX7oOJqT3HCIo/35D0xsQjsJW1x2SVFg\nUVPlomtRz4pYsKxm8PxGTwx9yb0qa7aIixMzpA05KIMRzhc8Y7MSE9pgLyHk\nqQF5we6MGjwYwq+inupH76paEWqeAe7DiRUcm4Ne7iu1NXgiA1MVONOgL4Q0\ntFdo9Zup20upbEx7ozaaX4zBmeleQ1QIMomh65dbci0tJ00YPHIx8ypcQMDj\nMpQd8kNJJwdLhxQiVjgqLQfwdcDSBtdm3juL22xg7dqYte7PfTw+mSk9ac/A\nfjh4\r\n=VsxA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5d3f3a72d4e9757f2993684a89928b04ad29c6a1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.c7c5da28f.0","@material/rtl":"10.0.0-canary.c7c5da28f.0","@material/base":"10.0.0-canary.c7c5da28f.0","@material/shape":"10.0.0-canary.c7c5da28f.0","@material/theme":"10.0.0-canary.c7c5da28f.0","@material/animation":"10.0.0-canary.c7c5da28f.0","@material/elevation":"10.0.0-canary.c7c5da28f.0","@material/typography":"10.0.0-canary.c7c5da28f.0","@material/feature-targeting":"10.0.0-canary.c7c5da28f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.c7c5da28f.0_1610588102685_0.7154090908025112","host":"s3://npm-registry-packages"}},"10.0.0-canary.b2faa116a.0":{"name":"@material/tooltip","version":"10.0.0-canary.b2faa116a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.b2faa116a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"726669d3e16edfcc296084e53982ce8e1005de42","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.b2faa116a.0.tgz","fileCount":36,"integrity":"sha512-tcIhK+MzOUTV+7f5SBvI+bno/Fjx4Iviy+h4OkbYToFOTPRkBR03qGjQVvhm78T8jKzOTRPRhr0VfRnI+Q2RWQ==","signatures":[{"sig":"MEYCIQCsbJtUqsDLCOPcgSRYRd34mjA/X25E3REcoWyxRXfhRwIhAOxToEazg4aB6w3ck2tRg5wXB6D8AHPg6DVuJ2Jq+5DS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":471035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBzKqCRA9TVsSAnZWagAAwjkP/Am9NQYPdDUzE6kZ8xIb\nNOfxIFITmc+3uKRPq7Rad2kKedytG3etWmFb4N8pzLbfJL8e/qwbTOJRH02S\nRrct8bMJNPyoZyIw+0NNJRaqEiK/3f2KlUqssUf1EsNAk5sWjkv6tbkfZFci\neG4++LGjo5XA8aqGmCC+CLAwZU9qCW/0KkFeQOsaVE5sItpGAd6W1/krHdpd\nBfakhVzWQKs+kLqdgWcECw1ZwTaEqw51w+Ko3WO6nyetMugZ1hFJCHEKSSFX\n50N0ZVxULAOH7eqzRkG7neb/nckKSFD9WTxJV0ZZweInyR8DGB9kcGwUPeEe\nNgRqrsTkQSwW4aZebfqgpMjHBkkLDb7bIoMy6/FsDzSYrCABid8WJAx5dWvC\n+XWsbrSs5wxg5LOHpoR4zDHE+8vGfA9WKWKRhQhbEH82KDWSdUw10yzNxFCE\nm+tWhLzavRwekcY9lnRMRk46+ifnypSDh8B1yMA+/suN52gVNYWoS868vxEP\nh7XOGdq/TyMwcLWMPRcqaz3R0Dpd3dohursj1X6yPFmD8X6Z0VL9fqmNxmI0\nVUqK3BacOoijyok730+nsxqUlJFQLcsrov2th3S1CwOh03EUwWDATtrgVbJz\n893gJeQe6ox+Dzph9BLslqIaAlxNQznqLP+yb67tJdBElfD0lnoqR+gF0Qup\nXGmu\r\n=QjMi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8c83e6751cbdbda8095b6ae0686196398066d600","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b2faa116a.0","@material/rtl":"10.0.0-canary.b2faa116a.0","@material/base":"10.0.0-canary.b2faa116a.0","@material/shape":"10.0.0-canary.b2faa116a.0","@material/theme":"10.0.0-canary.b2faa116a.0","@material/animation":"10.0.0-canary.b2faa116a.0","@material/elevation":"10.0.0-canary.b2faa116a.0","@material/typography":"10.0.0-canary.b2faa116a.0","@material/feature-targeting":"10.0.0-canary.b2faa116a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.b2faa116a.0_1611084457526_0.7834637905279389","host":"s3://npm-registry-packages"}},"10.0.0-canary.0c95c9f7b.0":{"name":"@material/tooltip","version":"10.0.0-canary.0c95c9f7b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.0c95c9f7b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6100df1aef44adc9287933f3276ac2a15cbdb8b9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.0c95c9f7b.0.tgz","fileCount":36,"integrity":"sha512-lCoai1xx9Gs8UIDsytn0L1wqAI1wW35Gxe2ykr5ocIZ6nBbRulh5fSFiMICjGZmWg0UHqFT1PLHmH4S0x4pzrg==","signatures":[{"sig":"MEUCIC5+UvPBTeuGaBL5INp2MUaTH4EkiYASFYb+V0rZ4gWvAiEAgAPaT6UG1uPoEEAXTHCLwR1PD9fvx5e25BXQkhXcaww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB2M/CRA9TVsSAnZWagAADHYP/i60S2s+uNv8rYdrLOm+\n6WQRguFHNIdD5CDbARSNXA9VhL5jofrRYGc2GR4q3tnQAT1BWfmaOQUPRGkF\ndAGGANUnjldQo+v6ZsrNjfioB1IGt4U/HnxqKzIWBo1Ei8QRFsmOv8ZRmmA/\ndj1+N1dzHAEJ+P0ZwiSbAci9ABGAeHUgJVCfznYofoyMn0Z5u98hiNHI+2Pz\nOx9Cg+5gyZmNzjMKXGvhtZxOU5LvZrTIbAngSWnQU9KE7LJUerMry+UcUQYb\ngnZK21houJkr6dM9NOwL+hs7hSeD+RxCgLpz9TlYnCi4GlXSrthJimeuLkLh\nY0zPzeZccxZkUXvcqOzfHx2jH157OMw8ZlQr7dc1M3VDzQNa3oaiIks9qR1A\nMcrjRZZu8AaLyBpC53DB1QdhJoEXLJ5awwTOvmfoA1r4CzQJV3uC4ggdR30O\npJewOzmkzok8AOkmGbhJ5s4R6KgHvwYt8RmCyK7HKCq0f7Y+lH+xf6mlDesL\n/u4GCjsaqeDqthg7gYZwVq0AuKIai3t6myOWw/oGdKT+i9Jm2VBHQTR9QNc/\n/t6iA3/nWLWB1rt+rnxldiArZWy1R+rD5q2YSH21RgN2DbIc8s2TawOHw6q5\nAB0/diMYdtSi37g/FXlXjvima+7IUPPm7sL8JI3wDZothpK+bPQS3LugV98l\nBfgq\r\n=nqya\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c9db31c38cf439af3f1498600e029c2dd812acb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.0c95c9f7b.0","@material/rtl":"10.0.0-canary.0c95c9f7b.0","@material/base":"10.0.0-canary.0c95c9f7b.0","@material/shape":"10.0.0-canary.0c95c9f7b.0","@material/theme":"10.0.0-canary.0c95c9f7b.0","@material/animation":"10.0.0-canary.0c95c9f7b.0","@material/elevation":"10.0.0-canary.0c95c9f7b.0","@material/typography":"10.0.0-canary.0c95c9f7b.0","@material/feature-targeting":"10.0.0-canary.0c95c9f7b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.0c95c9f7b.0_1611096894926_0.2564499120284254","host":"s3://npm-registry-packages"}},"10.0.0-canary.5268222c4.0":{"name":"@material/tooltip","version":"10.0.0-canary.5268222c4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.5268222c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9d73f9cae1a0c200ee55311e068903ca9083516","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.5268222c4.0.tgz","fileCount":36,"integrity":"sha512-3G5PQdlt5GMmrZGmIB4+aYh2WcRS4nnAX2Ofb0GbFuNtO3kjf/3eHmUhZbrvhcLhQ5V9jjfxJwUGAjPPkJaGKg==","signatures":[{"sig":"MEUCIQDPX3jJQxXodYqoBKjepay5qwzsKZYhA7vOQxYmEhGE6wIgFz1sWUQfitpGilxoHuVMmcOmftxseWmT3XU6HbkZvkw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCIJ5CRA9TVsSAnZWagAA8m0P/3PawrqjUho08xLEjFFA\n22INgF+ooyMe/RHa/xJtKOLrP4G4/ERLEEIA37RW+PGiXXJuhVWfObmwbEHD\nGMHfAHa03t8GE+ubFTRsgROIygB1BrNAoLf87IEedysxYwHuh5f46HALAWEV\nzPD0pD1gGOmMVyODADXdYYxVePGLNkyQYzZD+teRlP5TEG7gvZsGPGimL1fA\niGRcfeYWlwTpcOp8zOsHudzdYvWeIGN+eMmSYI7sznc0d5egPmRr003qK9kP\nAkeYFdnfOeHxPuz2nd151xOgRZlSBYTrZD0KB/EBx9xLmll6n+k1F2WAthYb\nxamkI203WpHXwWdx5IXu/XOmwnXQy6CtbsyLlc3gO9hTf/rTp1GSJDs7z6LU\n2pQcxxXHipg2M+oKxq1yrjjZS6mZQ1jlGGC0mItN7H/oxwdzqtSlgj1EBLwO\nIJU+7DBgW89aLx47JXDS/wo7XacVlqA5zO8rN2h+D/muWdxocsYe3ko3SdDf\n9NpdNXCSkeM8Hh4iWlKlW9mZmXix1Efb2z6XndqPlQn87RwVlws0vCG7pcxF\nLXgiY7xj9mUUyk8j8j5zFgpDwYMzVTeDncZ9MNJAW/lGcbSl7me7l3ha7yJN\nmLCMt91RNm2OPnkFOkjhokGxPz4BmD403lpSt/dmrYpB5DA5RSZy6b5+V05/\nugyz\r\n=mzbX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"149775a975bdac97e3f25a99b254c8b632e6ebd4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.5268222c4.0","@material/rtl":"10.0.0-canary.5268222c4.0","@material/base":"10.0.0-canary.5268222c4.0","@material/shape":"10.0.0-canary.5268222c4.0","@material/theme":"10.0.0-canary.5268222c4.0","@material/animation":"10.0.0-canary.5268222c4.0","@material/elevation":"10.0.0-canary.5268222c4.0","@material/typography":"10.0.0-canary.5268222c4.0","@material/feature-targeting":"10.0.0-canary.5268222c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.5268222c4.0_1611170425148_0.42140209466366496","host":"s3://npm-registry-packages"}},"10.0.0-canary.2ed2d829b.0":{"name":"@material/tooltip","version":"10.0.0-canary.2ed2d829b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.2ed2d829b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6c03ed2126922bdef604159d2f9fc269687c2640","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.2ed2d829b.0.tgz","fileCount":36,"integrity":"sha512-csNi/8QCx65lODEmC6Uf/ALrK7dVGNw+xfu9vLSo3NaSqa/INn6SPUQ79KVNRlVmTLqCtBgUK1Y/1e0ImXjT0w==","signatures":[{"sig":"MEYCIQD96rkro70FUFTrFESbNzDEMR0ggKj0uN2PV/rp2WrhJgIhAJJEJqqhKn6o0kR8G9dtq7y7sypcLQ5Dvcq7CJ4/2382","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCLgRCRA9TVsSAnZWagAAE8IQAKE/3vrfVaL2IXBaV6me\nMzvNuDsYzAliTcksjbsLS3FVjhgtXFxpLlT6NNV/6v1dUM4AoupvDimvSDJx\neNg16bNNTQP8tuWpf+mmGKwMKciX/k6V8b0QZECQbEL1796W9I6PcQcT+fVn\n/2SymJPChnkb2Yd+wFdl3DaksAv9eJy0uSMu+BsMopkyTxucLjrnuHH7k/2I\nMLOXmViD51Au8HvFjYSGgENSaXcFng2+ItZLIgRXerYNZY9hN0zwbqxwtByE\nNoZG9xsKQpsqcPgIUF8oN6h4DvRBCv6fpY6PMOk54o/5W299qt0dWIZzzD1c\n+UaodGzeTV69/f/TKTpb9wEgbmqUTG+bkVX6tXTHaKp74fmi334HkePZOOcf\netT0UpWrXpMutxMxI+WuvQcRisO5E3YSlC/cDVfhDdcMO/wOlvikiyPLlvIr\nhEnotWJjkTq5wQWV7c4E7UQh6kc03KG1/Nhx4hsvJJ8Lda8FTqo3nYKQj42M\ne84yCq9gQpa90L6xwZE19oCYQi3k64V6TQXowM2O2lJ4DbY4DoNsr7d8JIAi\nsJLHKiyrZFbFETiUeiGzdaiZsGA4xfG0YUXq84spbOHSmikNJfsKM5euJaqa\nAfsIyedrz2/IKMQ+shObiPOTZDHfCPqcNDiqswBvA15yeyT+8GDJgBcvbbf0\neyOi\r\n=7wm6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e937a8c393e2170307639b8126f0a461ffaf9e6c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.2ed2d829b.0","@material/rtl":"10.0.0-canary.2ed2d829b.0","@material/base":"10.0.0-canary.2ed2d829b.0","@material/shape":"10.0.0-canary.2ed2d829b.0","@material/theme":"10.0.0-canary.2ed2d829b.0","@material/animation":"10.0.0-canary.2ed2d829b.0","@material/elevation":"10.0.0-canary.2ed2d829b.0","@material/typography":"10.0.0-canary.2ed2d829b.0","@material/feature-targeting":"10.0.0-canary.2ed2d829b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.2ed2d829b.0_1611184145293_0.17946097393455607","host":"s3://npm-registry-packages"}},"10.0.0-canary.df00c2b30.0":{"name":"@material/tooltip","version":"10.0.0-canary.df00c2b30.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.df00c2b30.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f9fc36533c93e61352058bf66794e1bbd6278ea8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.df00c2b30.0.tgz","fileCount":36,"integrity":"sha512-CKlcV4HwbhwBc7PO8PaDvO18YtF1+6qPMI+icFzuFplsjAa7wy+JwHCPL3A2uwkPiMhHB8yOpvBgG+xxYxcB3w==","signatures":[{"sig":"MEUCIQCIgaqtIywYRFmNB79V0NpiSmG9MxygKVSdX03z+/5dfAIgN2GQqJ7mgY4y7AkJqjkHXHH8wZVHrviKb176IU/NkgE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCdxXCRA9TVsSAnZWagAARRAP/03HVb2uoMsUCEyZhyCc\nPzPkuoje1yDvhbtmEZRruSgMUVR5MdzKssoe6t4Tcu7CkrB+LZu1AOJ4LgdB\noM/WQ6dG1d9S5yvvRJ41ZFrVaAKPUCavz0Q54LmekTr/d9Ddnei/OyZw3sSV\nzp2B4sYFeKxOmCK41n6dSgnsoAo1QcqVpg/sEIBM08aF1sTp67TQmG0fEH2D\nyCRnK+vThPfFDSlpzWfYQEhzU7mHvZgqSP02qdrTKDFJW1lsgw94vpQRH4Bp\nFiW0ZyDZ+5GrbeLVTxWUVRRRTWGO0WVxN0X2Tzs6k0/9Xu+1OKG+aqW7Ztzl\n1bEWu9IgNftetZJvzw9X52b2Ol6Zswn1CZJd3aYFvq/AvUfQ2vu8Oy4DOcRj\ny6F8Eni8etc7e472SV2DpEXc2yLrAOWTsg86Z/XLLU/A/1h35lDQCulft0Q+\nYzjdDZOuU4t5JawCegnA1v+hG2UvETfcPBjFBdPXhuarhsQsjVuTKLni/Ml4\nNlRD2t1Psfs+M8xZGZdw1JOcWZsYn8LlCeUPqB4wrpj9+LVfZbbTJ1egL2Hg\nmHl2Cge1nl4g8qVjDT/8DyALBuk1UMe9ovc9qXOT0PhT917MK++Wl2c/eLaZ\nebpcjxFrhxajg7O8KwEV3c2UPD1zJYT7aMatgvHnLCF+Y64BMtBtyFzyVVDv\nBYRk\r\n=yPkN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b80e68ca5ce1e4ff7a83ec06c805029869aaa5fd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.df00c2b30.0","@material/rtl":"10.0.0-canary.df00c2b30.0","@material/base":"10.0.0-canary.df00c2b30.0","@material/shape":"10.0.0-canary.df00c2b30.0","@material/theme":"10.0.0-canary.df00c2b30.0","@material/animation":"10.0.0-canary.df00c2b30.0","@material/elevation":"10.0.0-canary.df00c2b30.0","@material/typography":"10.0.0-canary.df00c2b30.0","@material/feature-targeting":"10.0.0-canary.df00c2b30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.df00c2b30.0_1611258966795_0.8375005604092911","host":"s3://npm-registry-packages"}},"10.0.0-canary.fd61b0476.0":{"name":"@material/tooltip","version":"10.0.0-canary.fd61b0476.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.fd61b0476.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6e6cf5287966a8c5ebd2833f97eb29f53b26c9e9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.fd61b0476.0.tgz","fileCount":36,"integrity":"sha512-kZ2wtTSaSaYYIOV6QOflcGLOJ62TEt46jcFJHONS5be2ltjR6AopnwFCjnV+8I49aBP1hnn1rC7hfzBkrUC8Ig==","signatures":[{"sig":"MEYCIQD/l7TQiU+3EyFLZTRnV0/sO8ZsQiuGDcmbgqNx2o62ywIhALarmMdwXE3B3Cz4lu4PJbrkjUnaKxTPKxfz/dAFEmkO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCd/CCRA9TVsSAnZWagAAMF0P/jUzuVZIgNsthsBv5YWU\neFNTDy1M5EIdZ5OQloJM/KLa8EP5CyCfWKRPqaSFxm0LZXTl7hYwPHxITN/v\nT44eIuTM5ShPRAoqae56G/DSLiHNb8aNBgkZ5ReRMlhuH9vvi83Bt35AkafA\nSJaeoQoms6Tj1tvHjX+LVINeMdJrNGCMcJhBrmiVeVgE1+2SXYkbZYpMh7M0\nUVuNFwTZdGrBwW5QC9ym/CxEy4QcphOfmUwoEOW6ubUaRBzCMia9WXBO5mlJ\n5JmQ6X/bgz8Tao3ZxvEOYCo715pIK9Ft0vGEvOzQtO8tytuMig+kCXA7Ec6Q\nwpks3fCmNM5/vtL9zCMqLL1U2/6k4jPBdrB/a1WdBxarT19ErtY5iqtWTG3i\n1wH8pBxRj+FpmAXZQmuTzf1KW3F1miB5zoAk0jIaqOcL3N8tLkKYaqXceT9k\n8dY9aCVe5p7hXbOfe+RzTnQhdAdEmWD9AKwSBrtm07TQZVUPzCp5YwxZlW2/\nvr9TgJhCwvtnerwfD8EB7Xsiv5Pmndi+vtL50ggMDQTK/seeAijYlRfCiHA9\nKebrZS/jxWtFAgbLQSkXZq7LnbOwxyIzPLKBV+FflIa95r0OymbZ/ztoFc0P\nNO1xzWwN8jN0O8Mp4g5Y2W3JuuNC6nkwJbVbNG67naGAt7F3OyNzjSIt2ERI\nGdIf\r\n=ymyR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"67853fc809fc128218f211f5b54f854f102d1ec1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.fd61b0476.0","@material/rtl":"10.0.0-canary.fd61b0476.0","@material/base":"10.0.0-canary.fd61b0476.0","@material/shape":"10.0.0-canary.fd61b0476.0","@material/theme":"10.0.0-canary.fd61b0476.0","@material/animation":"10.0.0-canary.fd61b0476.0","@material/elevation":"10.0.0-canary.fd61b0476.0","@material/typography":"10.0.0-canary.fd61b0476.0","@material/feature-targeting":"10.0.0-canary.fd61b0476.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.fd61b0476.0_1611259842419_0.12825160455814277","host":"s3://npm-registry-packages"}},"10.0.0-canary.3fb3a0265.0":{"name":"@material/tooltip","version":"10.0.0-canary.3fb3a0265.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.3fb3a0265.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b8a2242d0788fa207acc04646aab8b50e7d84e9a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.3fb3a0265.0.tgz","fileCount":36,"integrity":"sha512-g3RiY4HXmD8diUFDj0EQF5unv1yS32CSbUCpvv3Dv5imBuuFZf6OPNI2hSvjJR+b0SRGYDnfFo+rJ5RssaO2Jw==","signatures":[{"sig":"MEUCIQDU2WPNmh5QHNFfrW+vsbd9V2T1xix/UP3SfDgN3Q5p8AIgPsu4FXaxLSBjwnlXgSNl0ianWK/wYzpDv+SOWDpLwfc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgChblCRA9TVsSAnZWagAAgVUP/RX8tc2S0wXeImCchUN2\nap9F6bb0iVvqN3+9yaCNFOW18Bu6TDoLrG+VZDeY7X4vASbcyg4ImkPifezU\nt+6j3b5T9dly9RUmyasr0507wzGFjVOo2gPJr9X7L2gCvbIIWInRlXNAPLhQ\ngvIPGl6YOvRLm+aysniiOoCD3eSWupGK9SSCc9RGNqx/b0OXcBd19TifxYm4\n7g6M3+5M6oIXG/kAccKzzL/1inpBDEa71xXCFehUlGjQKtJhYokH8Po2Z4zH\nV/HMAT4nZ/WkO5KdXnq8vl/VpJdYgUALWHJX6x6vQp01HgPtu7kzCQdh+0XD\nQULFo0A0cF+B8006yXwCOhOFv3VHZQbTiQZ+zPiOjTV+rhwaKQxYASflErV8\n87jU/rgFCAKGY9GzYeccKYYUhn7N93EQNzOud6TuB/ncV1UxIydEEZ+APLXf\ndMF4LEjyv0xZQgcTgOGM0DbsG5LYPNdEeHkqlkQ5m8+ECAcUds4pCy9x/zVI\n7duOdnyOCwJGrlaqUoQySt9xgYeFCM8OVip615OC28yH2N0DvS3bY0uNVCtC\nUK0y0nOcJqcikcyxN7pF7+7yM+Mqf4gYdSgjt77hDPWUdtIVYe60u+WcOrTD\nmO2+NaXnad3gAWAlx7+HgC/KKbFgfXBFf8+VBPBkJHFlZUjbYwHL/Ev5udHZ\nDQoM\r\n=fKu8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5e619e42cc5398fa779a726d775cc7e9a72a1acf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.3fb3a0265.0","@material/rtl":"10.0.0-canary.3fb3a0265.0","@material/base":"10.0.0-canary.3fb3a0265.0","@material/shape":"10.0.0-canary.3fb3a0265.0","@material/theme":"10.0.0-canary.3fb3a0265.0","@material/animation":"10.0.0-canary.3fb3a0265.0","@material/elevation":"10.0.0-canary.3fb3a0265.0","@material/typography":"10.0.0-canary.3fb3a0265.0","@material/feature-targeting":"10.0.0-canary.3fb3a0265.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.3fb3a0265.0_1611273957066_0.03350630396538379","host":"s3://npm-registry-packages"}},"10.0.0-canary.07deaec27.0":{"name":"@material/tooltip","version":"10.0.0-canary.07deaec27.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.07deaec27.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36a16d9682d499c3a1db9e85e3e2e8fb64cacb3f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.07deaec27.0.tgz","fileCount":36,"integrity":"sha512-YLq5L0McYHGIU6wIfBt2bl11eIbzeVCeJzdyTdxGLdbNpddAaN5ZshPFO/G+V025mRlu74eTyhP9zajGXBlJlw==","signatures":[{"sig":"MEUCIQCLNO7GPFe+7IabXOQwGSNG3Oh63O89bvKSkWGU9WZa4QIgUSc3e+do6g/LczoRQ5rT8WXC3xjcllI4SQ/H+5dEDGs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCwP5CRA9TVsSAnZWagAAc0oP/1Rv9Yuzu834L8fnHI+0\ndxx5Cpur3ZZbgmHFfAdHFD25b88PNSTYOW4nwG/ibGL2RWbHsDa70aKVYzuW\newDSTeTIL0fWjMENYTELN253G8eM3a5C54wxSXTBX4Q59DxKmj90p5xA61yy\nK6ZkQAO4F0fKvFWY2lPy5GZUX1QadPDdznVetiQK+PbP4iY6VdwO7d6xFMJf\nk+zds5m6xxaGLkN1gHD1K+GBkqa4zFgiNqFJKdKO7n0FehIua0/Ez4n5UKf/\njhWcpGDfFFMV0WD1Q7ES77wTSGBMdtVd/VQCHvwERLEbgLNPye/O63JcgDgV\nRH5/avdo6OIJChuVD7J/K9w+wO+4zBsXnp6p0Gb+mvY5/dYA/sqr/BHPapeG\nyr0P7Ng1DiZFd6fUEdB0vEDPtrXk5Zt4IEpMV1gSKxeGcQH32+ImOHj5Ed5x\nFIjasnYSgz4OSPqwtzufaMDrEWYYLIBYJe0jeoxWMYjy/rFi9zNKk3nN93Ui\nD2RXg2SYevP67FPqx9/TS5KbzJ/Po3Wqi5Bxc9mneREHjpI7YdpBBytzfeRP\nhs0k667ApR6Hx0tTfMYyOcEd4yIVyQfrjiuTH0vx8iMSx9O3IwbcleBE3O3j\n9dlR3C4g9sQ/Jj5NxMNSvMITVcAFTrWy/PfwShtdDlgSxUzh2RqhIqLr08zF\ncXAQ\r\n=fLQX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"be75b8d81f1ed6f8ebe94c8673f32110d71cec7c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.07deaec27.0","@material/rtl":"10.0.0-canary.07deaec27.0","@material/base":"10.0.0-canary.07deaec27.0","@material/shape":"10.0.0-canary.07deaec27.0","@material/theme":"10.0.0-canary.07deaec27.0","@material/animation":"10.0.0-canary.07deaec27.0","@material/elevation":"10.0.0-canary.07deaec27.0","@material/typography":"10.0.0-canary.07deaec27.0","@material/feature-targeting":"10.0.0-canary.07deaec27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.07deaec27.0_1611334649286_0.17220706848377","host":"s3://npm-registry-packages"}},"10.0.0-canary.d2959b16c.0":{"name":"@material/tooltip","version":"10.0.0-canary.d2959b16c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.d2959b16c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"58761fc2892ce8ca5edccfe160359d2f553aa2df","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.d2959b16c.0.tgz","fileCount":36,"integrity":"sha512-112vl5wl7cn2/bv+jLt7EhvsiH9/DP1wQOWkTb6ULEf5VF3FsO30hdYbaCoy1EYI5FQvk8ZV3HBHk4KXjT0PhA==","signatures":[{"sig":"MEUCIQCJGzgXqDlIAGuZlD/w/UNffLblMvU/jLF26IwqmoBwRgIgD3rPh9PyNjYj4uvJD/w9GrWGAO0vfxT2gamDzf9Hz+k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCx8WCRA9TVsSAnZWagAAhFAP/1wEBo3B8W6O7fKDjb8U\nAceqKlF+l0MtvNO6BlWlIgxmKKcDJSSWiQbpUr7QHMNr4gmZsHSD1tqiNsMB\nm4TQUIOnLnwEvTjIaDuF/Rr0iVW14Xq4+ZeOFindNCuqYNrumyEibmAetRn8\nNprrrwQbds2bLB77DjP+jyPNH4pI2duchWTfDl3qMIKO3l6EE3M0j56rGCoW\n24gHSyP/OhcPJI3pQgWABhXSF72UdDD3YFbHQVBcVPexdiCg6G8E222YQtmC\nIHYdE/EtisNFMvl8MhdRtD9gNeDOEhaEsNpj+gY/ITq3h+aO9So1GUrsnjSF\nw8PQt0yMNQQcaE6glyggvsrB9cCKAHU7ko/2CCfzwAcK1x8yL4NkFDsLtRDp\nGCda909yQqWulmDvsqz0fkg2xZErqzB1ASKd0LcD6o+Ynjrq0HnFpfhnTXlC\nWrlCr5x1RyPj56IE3naJ8eJiMWJ+trWplhz7fSLSPEFpyyzDbqz6l/Gf5M/q\nbYjBrrPJ0Ga1tWUE2oH9ZX/uJAOvDAhevvbolukd5yuQIse3s3L8ynv3DFrb\nFoiCiZyC0H4h6TR+TF+x7ckXoI2AnP44Jn4nBgU6JJTVGI8iqltjsQTzHSs/\nsUfpm/aOCNzQB6TrjCjULlyY9ApD2y1wx3WfX4HPk7ud5ojujp4IigLEqnMf\nSZdk\r\n=l+5L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9a89df0257ea15e66bbd565cfea291993f0c4ef6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.d2959b16c.0","@material/rtl":"10.0.0-canary.d2959b16c.0","@material/base":"10.0.0-canary.d2959b16c.0","@material/shape":"10.0.0-canary.d2959b16c.0","@material/theme":"10.0.0-canary.d2959b16c.0","@material/animation":"10.0.0-canary.d2959b16c.0","@material/elevation":"10.0.0-canary.d2959b16c.0","@material/typography":"10.0.0-canary.d2959b16c.0","@material/feature-targeting":"10.0.0-canary.d2959b16c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.d2959b16c.0_1611341590394_0.7874612019733762","host":"s3://npm-registry-packages"}},"10.0.0-canary.75f3bfe7c.0":{"name":"@material/tooltip","version":"10.0.0-canary.75f3bfe7c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.75f3bfe7c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bf6c5ab912a96fa01819dad179448bc897f9d6eb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.75f3bfe7c.0.tgz","fileCount":36,"integrity":"sha512-uog5OUOUa5BgELZEIbFXn7OBs8JN9R1v4DgHeSSchANxywwBiukk6ohW3VCvxikKxrxzJxH8S1lyJgEWZPy2Mg==","signatures":[{"sig":"MEQCIGCG4cZGyJkrJDGw5ZSQN2uo0MdA0MLA51uB53LBeGyhAiBSZrI+qe/jh3b0akzP6yiKl28KOZqI1xKRX9DMV6f/JA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC1czCRA9TVsSAnZWagAAUVIQAIvIeD3A3Dih6rufU5Lp\neCVSJny6/SWKk4U5h+a+2SFe0gojl7jz/qhnTJ3nyCfc7R1Yuu9+NzxizfLM\nfVWOEcG+y5dDX1tAj8LT0edpKI2rrIE73nAkQtF/M9JqG3r34z2V8y8s1jMT\n3fJei5QmHMQLE9JOfsvi2f6kMTSlwbvZphwuAfFFZN7kudy4Q+pQBbEGlXTd\nPP9O+mjj+5La0f4SfmZ0twodHErROrlhHop/AFeFAcCqxZdOEnidzXpqS96T\n/7jnxyWM/KfRgsbpyOZT9OPKTNbtzJSZWazipYJR5GscTbPo3eB0NYGWLKWZ\nPGLU97vswOFzOIJMmYjb/HLJoKxMcI1OojRCP3hQwwVnYXhlytfPZ1KjS/YM\n5Pky6CbTTel+HerOH7dKq1FsqOt2Xo1vz0q030odDf/Exuh5FVBQzPInEWYB\naTDto3seZGZAeRRH5YW19f+cWfhmvWWdWauYg6CPbzdbxdHD9t0eb9k0D8YP\na6kzcA1Tc7ojl6jtV6gOuD2DzPn2yw2rLUT9oJRyrtP06KK7PPQco7D7pbIy\n8u7Sa+tWavlZaScyuv+ka14FzVVMmVn/HIgwZf3IPGsRfhbBVKeFP7U6hDsn\nLk/PNQstVt5kTCDWbWVMhYsd6Xm/SV8gMx8ZxxUgUyquBNgdUmAJxKfAREuR\nNlNU\r\n=+Yaj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"057941e604e02f88d571d61967040f58bf499bdc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.75f3bfe7c.0","@material/rtl":"10.0.0-canary.75f3bfe7c.0","@material/base":"10.0.0-canary.75f3bfe7c.0","@material/shape":"10.0.0-canary.75f3bfe7c.0","@material/theme":"10.0.0-canary.75f3bfe7c.0","@material/animation":"10.0.0-canary.75f3bfe7c.0","@material/elevation":"10.0.0-canary.75f3bfe7c.0","@material/typography":"10.0.0-canary.75f3bfe7c.0","@material/feature-targeting":"10.0.0-canary.75f3bfe7c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.75f3bfe7c.0_1611355955210_0.07178584964554502","host":"s3://npm-registry-packages"}},"10.0.0-canary.b9adb7a0f.0":{"name":"@material/tooltip","version":"10.0.0-canary.b9adb7a0f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.b9adb7a0f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8792abfe90882fbd6ebe3b122e8619e7a2ca6c7c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.b9adb7a0f.0.tgz","fileCount":36,"integrity":"sha512-ABmctR22A9Ag8hHehZN/x0nUAbLqIUyQiYXL5l80mAEBo6NuJJ4cUXYea2bXmtwhlnk30kb/fFfsA7kN7UAsAw==","signatures":[{"sig":"MEUCIDM5TLHFUY7w9GktRP1l3qxiKfZwgR8tdGwcRD6+4RuLAiEApObxhwSusP8RO3WRWjQEuNPnU51NnQ8m4zRpJgAQaX4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgC2GZCRA9TVsSAnZWagAA7EkP/1qMlmVP1vJQuxRmBYCD\nup0Mi1DLAvYZS8POG7BozOvPKKTyhsiWyqANg81OuK8HOULetbaRQ2xjKVNP\nNDMWNTJYlfQJJEdjp1wN+QiZ7kt9GRCN5dXB2u+nD3e8FwsXswTgXTqk9yFX\n1cwb9hphX/SpSeWHXNWeebkalkuLpJvP8M6znZfCbiP+AvKXbpHi4Vh4hM5G\n2grMQ2iUb2h4QpDoyNYb7yL+xtj7aBGuRYZWxB7oYYkt4Oa/iPxuGeZclmhU\ngIzvpcIKmxq6ku/2CeEI7QrBiIJB1QyCuZtf3g2mYIVtQEVAQBVFHdcBmGKp\n7RFTfwIQTEkrpSIWJVl225BH/vI+Aq82RC75Y9Zr5oUVGWzSbU92ozBtHhFn\nTvjVbelwUCN+AtcoyFrzfa9kxxe+2dSHbzxBBEBv9Rwlcj6w18KtaBa0kaSn\nCzYET65efw7BOf3CcM3562Bhkxkefnt4wWcpZrxEFFYBbNHlf9YJvSe+YsCr\nGGJRJCgMpZHzvCDMOtKycekPwys4iK25+ufGfP1DjLA6tDNDSg5+CQz8hCVv\ndz6GrnsscffbJcQzd2BA/ZEQdZkMroAiGla1SKwJ8O723CrdzVLjMeokzcGQ\nqXKBmWp0WKaQd5u1GIxQC+/n3Grjvpj2K7l1SXbLTNGpyDg/smF0+e9ELv1x\nG9Lb\r\n=/3/c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a591eb080c699d02013eb9ab0090fdd5e9813a72","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b9adb7a0f.0","@material/rtl":"10.0.0-canary.b9adb7a0f.0","@material/base":"10.0.0-canary.b9adb7a0f.0","@material/shape":"10.0.0-canary.b9adb7a0f.0","@material/theme":"10.0.0-canary.b9adb7a0f.0","@material/animation":"10.0.0-canary.b9adb7a0f.0","@material/elevation":"10.0.0-canary.b9adb7a0f.0","@material/typography":"10.0.0-canary.b9adb7a0f.0","@material/feature-targeting":"10.0.0-canary.b9adb7a0f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.b9adb7a0f.0_1611358616829_0.27083467031588393","host":"s3://npm-registry-packages"}},"10.0.0-canary.d29ec2862.0":{"name":"@material/tooltip","version":"10.0.0-canary.d29ec2862.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.d29ec2862.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6c0cb6a1a2536b215fc4552a02466752822bc662","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.d29ec2862.0.tgz","fileCount":36,"integrity":"sha512-ysLK+LtdMCH3VrkLdYLIlyIS63WCSHzLdr1TQJAYKuCNtJULXY21h74KGcLH8mQriGQn2NsBqkWrxJHPxLBSZQ==","signatures":[{"sig":"MEUCIQCcHv6gc2GzrU3LiFGLkSzSpALa15YBEjlIVZ7gPLxVGQIgDMoQU8/zcwvgN9z+USbf4jaU1s9cEViJGgFFzv/SREA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDvDpCRA9TVsSAnZWagAAaJEP/11WjXakE9VE0YdWY0sL\nQsbV7qCamwiC50I90DSI8t9tPgXgBkLJxhbDM/VHomQVmNNbH/YrzPNYgo83\nkxD0qWY7DIsiMHC3eZ2l74oPjTVVujR02y1a7F2Ne3c4MJMy5Mb3slS0UQ70\nVr9lNMN6sGFuE26QFFg2MCAFp29Es2b1O6r08etCJZaybTSx4qIuYktIPjbC\nB4YczsvT2w0U0UguqUV4+AqyIRQGggjIuaJqyy4GZWgKOfC4ikSEMMEj9Ozq\nIRNBHF7E3VsZeYvX0U/UUGiR9hffz97G/hsnefgZ21XNMwsEKQPHsA+fcoAZ\nFGrdwALx11tOSnM4mq0Gv9ztxtQeQGy1LE4Rq1ioSqts2qmn1TANvVZ4ZrzC\nSfR5ayOytvTAJYG4vuJK5fQJgsvaYqqTbYI1Ku68IgJvToGTcqn9rzxQKIfu\n9v/IVqXYKyEOJl7h2BM57++QX2YtJxy8CrundPVgD/FNaeA7wlaHvQN8bBek\nyOpGBfv1eBnoWpBJ1gFkxjw1aQ+cG53cGwcsU22a4XiYyTJ9wEFQnsVq8s2T\nnOy3fXS1eCfIc1QorK/yQ/VUr/TirPGKAFPtddy+0u8aAo8WhREHe6fUmSAL\nyptRJCStcHHQinxF58hMx9mVeiLAu1F1yfoHvhC6E7Khn8uCAXOGLmNYJg8P\nehv1\r\n=p+Z6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1f2d18d6e94fa1f0808b7d768169b9f4827dc692","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.d29ec2862.0","@material/rtl":"10.0.0-canary.d29ec2862.0","@material/base":"10.0.0-canary.d29ec2862.0","@material/shape":"10.0.0-canary.d29ec2862.0","@material/theme":"10.0.0-canary.d29ec2862.0","@material/animation":"10.0.0-canary.d29ec2862.0","@material/elevation":"10.0.0-canary.d29ec2862.0","@material/typography":"10.0.0-canary.d29ec2862.0","@material/feature-targeting":"10.0.0-canary.d29ec2862.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.d29ec2862.0_1611591912204_0.2417162327983735","host":"s3://npm-registry-packages"}},"10.0.0-canary.96be07c68.0":{"name":"@material/tooltip","version":"10.0.0-canary.96be07c68.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.96be07c68.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"69f32fea8e0074a02b28645468eb8ec048ac4037","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.96be07c68.0.tgz","fileCount":36,"integrity":"sha512-6bMbb8BDx5F14fgcbM6M+Ht61NcT1bdijh5pZy67C3m5/S14RTgZavPMV2JqDKDQrTEJjNr8z7eFuNhpooxcPg==","signatures":[{"sig":"MEYCIQCuZNX0RfW2VdjebkkzaLDyLZAf+kNqgp+glitkmGLfOwIhAJIFTzO/ItHkHmTs1voe4XWYwkfTMH4Ng5HtKiMkLiHd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":485049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD14jCRA9TVsSAnZWagAAUFQP/iL6haneTxVqiZw2LeBI\nrkkkMWq0a8qGbp9dezQLfl3I+caqHaqJ02vWaD8WiQR20M4HsD8BuR4zPhQs\n5BXhPY5xqOW0bsyw8DjkfUAQUCifmaMZ6R9pkcUC3cB8qpoNpJ/Uo/gzat5G\nNQxC2W/R3k1Ri2ou/mAI/0xv21MfkzyoQKdOUfGAXM/OSCXmBeaMQYyxir4d\ngZskTmGRZGpkL+pMMZ5ZG5Bv+XQOF37hYAiGyVt77PnXhIg21lRBs5g7CJr6\nbdAziUvK8RUkbX9O+eEwiRRjqgVQlyM72BxNtmQ77L4oakS43CHY2CBP6xPz\nb++6+e2k7lhvKSzQ+DaUBQsoZ90IQ8LhBSfV8AzlsiQx1DHVkmNYpUMNkZ04\nTMgvbEuNRKRoHkUd1SyAwRi3X0IsPGjI66p32lt8H6Eq4HH6Qe+FGW0gNEck\nxUjXcBNQ/o4w1Qb14KWxGrudErgiJs2HW9T5N/Fmq/of9ve0xjgomtqUfrgq\nEVb2hQ6i44zxlq8uxBrlUv+Zo8eTWxvlHUgTghKdaDvisAIAzodG1o/SRUrF\nMpQdZIwLD20MGhjlu8aBhZhTG7OTukxp05goxrC9WpE2O/bhDXXi/jWXxq6z\noAGxEs9zpJTDLw3JF2qek2Bh98WPa0PJXd9VMkMs9wFZacPEa7TVAjBnpt2u\nSDue\r\n=Dpqe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ad510acabea4f02cd7399e109ef73d3b0bb52e0f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.96be07c68.0","@material/rtl":"10.0.0-canary.96be07c68.0","@material/base":"10.0.0-canary.96be07c68.0","@material/shape":"10.0.0-canary.96be07c68.0","@material/theme":"10.0.0-canary.96be07c68.0","@material/animation":"10.0.0-canary.96be07c68.0","@material/elevation":"10.0.0-canary.96be07c68.0","@material/typography":"10.0.0-canary.96be07c68.0","@material/feature-targeting":"10.0.0-canary.96be07c68.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.96be07c68.0_1611619875056_0.3598977539270267","host":"s3://npm-registry-packages"}},"10.0.0-canary.e383944e9.0":{"name":"@material/tooltip","version":"10.0.0-canary.e383944e9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.e383944e9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db23d47f254c347811dfaa0f29683e57f7e3bf76","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.e383944e9.0.tgz","fileCount":36,"integrity":"sha512-+H0cDx2QSxo/7AQJOfQO6drhouYVBcWZTcZTzmV6pjixXSN+xLzA3UFnM1abojiZADsrvo8WkmKxB4mLZjMLDQ==","signatures":[{"sig":"MEUCIHZ/fHHUeG7abZT0jISaqhEvIVZDjXbUOeqNP5xkw0NuAiEA8DqKARfHUiXsJE9ipxzF0CwnaP9WS3RggyTCAgzEF1A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":485049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD3RZCRA9TVsSAnZWagAA0UAQAJia3AI363x4YAKM7OiO\nm+URI1GFifKiqm8fsckPsgdDwNHVUnie+NV4VeiGO13sBEVR91KdMmlOLF6x\nvjjo/7Ci5XnQ8y3yr0dWO1B0tJ0LHN0OFF/eCYa3AH4tSkekh9TdmG0vKfyT\naPmPYQuOZzurVgeFyk1ttHGD0lfQTqVwkhHH3AsMEvTJThAF9/FugRHREkHm\nBPqgpu+6QZmWPJb5IGSrolcwLSIXvD8HYccOpQ6NpNvC3q5oSI3vWLmxtKkm\nm9BKRBSWIMNyULBVS01CC94pRUzD+aizDIHQWLjnr2EnF1EpfE5qtL12KGyq\nGqU9CnrK+h/7wRlteqZOlg8KU5Qli3kZdvwVL1g1autqJINRXLoQNs9Br0p3\nAPSDWt2tOSVnj0n8eVuJ9GPI5WqS+LQiBL1EBFIG5kthJFDQtDYoXi57kwhX\n8id3SEQuA/UwWFGHNJUOX2BEaYRnEzd6Zty/S5PYOI/2S/ed/oJKq3wxTutN\nmsLheFjSoOg1XheMMZt+xtMQrEORHPhWeCxwIS2m07HpiIPqp4Kljgj/lDl4\n66/O0mRSmvbDcW0kTFhLx83WRKh48vh3vrTimViYtzb2ESGaNon9/mXJ8sKH\nHYxL/XJg6Cq3JDrKaW2Z8VRGq33MXzVc4nElsS1PktkA/MahvVBbJ8TJbVL+\nql0h\r\n=e6uh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"dc6dc4efb9210fc9c70fb089edb90278a8ab66f8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.e383944e9.0","@material/rtl":"10.0.0-canary.e383944e9.0","@material/base":"10.0.0-canary.e383944e9.0","@material/shape":"10.0.0-canary.e383944e9.0","@material/theme":"10.0.0-canary.e383944e9.0","@material/animation":"10.0.0-canary.e383944e9.0","@material/elevation":"10.0.0-canary.e383944e9.0","@material/typography":"10.0.0-canary.e383944e9.0","@material/feature-targeting":"10.0.0-canary.e383944e9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.e383944e9.0_1611625560798_0.14342521581576917","host":"s3://npm-registry-packages"}},"10.0.0-canary.623af861e.0":{"name":"@material/tooltip","version":"10.0.0-canary.623af861e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.623af861e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dddb3efaafdbcaaab991986bd9b56d462078d1d6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.623af861e.0.tgz","fileCount":36,"integrity":"sha512-YkD6HTsJ4e/BYtwYXh+ddJgRNxg9NAAYF85UW81OGvyEzjv+92yCHVDJjf6dC6qthS8x5s2LyzDgZ+dbIDxhGQ==","signatures":[{"sig":"MEUCIQCRyztf0LAS2GyWtRTcO+eQOU00H+mQfc1sFeAXRN4xTAIgX9xZsg+HCPS0X75E/E3QV8n/efbmW2sXxpGLrY93n7M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD5CJCRA9TVsSAnZWagAAabAP/2mMzaEQoeYAshIRKaiG\n2C81LOMvzctY/TIQojECVoNytEMwXM0L9nEnV98ZcwzJKcfJbkFiR/He4Mpy\n026YKXz43Nns0shx1y0/Jm5wd6QBk00tY5fo1bXbye73+n7cU2GaoUniXCw8\nk2G1mV2j59sIP6fUBtWZnKA54BpgpvMkRHTm2jHUbWezwOnGTtfGfIGjFemv\nCYeJqhX+VE9Ekx0XcNfU1MPl6RPWvP9rAhGHnjkusZYxbUQc7pEf7y7FTVFi\nHYExUj1nJ3NAAZ2CmefkZ/1h405ryNsaXdULR/bcTtj+yCr7Wgbxf3lPtPxo\naPqoOIO1FsOGBq/sX88c6Mc7lig+4fwhsOQkYR8DQXyy40aYasydffTZW6v6\ndXgT9d/irysFBXxqX/LYJ17Wv1hgjVx79QTl0jBgCQtKr/GrkSoyCzk/hU0X\noz0abygAUX3eFIpPJvAVuF58DT4TVikwWO9s0fMyEA0Vyy1PV4jwQWeIV1zs\n/bop29HZQkKHesB0wlaOgq/71T7e3OpgjE5OgP0J0fbjt8GURUjhrUx8TcY8\nL9JboMIUBkQqA+IpGOQUEoQr0v513x6gN9/PLLBHKvb2+9Xb9c4BRND02ChM\n054IWpdoH+urZKF/k0gWwBUc2Ov+bjlMGreNNHh4LxYKbJyvW9NUSis9SnIr\njvs9\r\n=Wp9G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5906815761339487fac225651c29aa422211a72b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.623af861e.0","@material/rtl":"10.0.0-canary.623af861e.0","@material/base":"10.0.0-canary.623af861e.0","@material/shape":"10.0.0-canary.623af861e.0","@material/theme":"10.0.0-canary.623af861e.0","@material/animation":"10.0.0-canary.623af861e.0","@material/elevation":"10.0.0-canary.623af861e.0","@material/typography":"10.0.0-canary.623af861e.0","@material/feature-targeting":"10.0.0-canary.623af861e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.623af861e.0_1611632777144_0.6715221833783553","host":"s3://npm-registry-packages"}},"10.0.0-canary.6863fd43a.0":{"name":"@material/tooltip","version":"10.0.0-canary.6863fd43a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.6863fd43a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4f83d583f57d0c854c4d028a35c02132f1e8c824","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.6863fd43a.0.tgz","fileCount":36,"integrity":"sha512-1ULwifI/wUapbFvbnuRGWx415imZvmQX9PQGwfOqpDd+EnDe1H7gimMRbolYj56YZPqqXm65N+M/tYAfCDZwCQ==","signatures":[{"sig":"MEUCIF+iv1UYGGBz3nI9UDWmrlmvQvFGbP8TcciS9Rkv2T55AiEA7vlThciraIrOYrTerhznVtGHHdTfO82rs98EzTa25s8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEIrlCRA9TVsSAnZWagAAKIIQAKTbsEdlpOXt0iVPs+JO\norZDEFVfqDYhIEk7iCTr4bEsg2LWq+YuyLMtm6stU13h8qWuZgtfv64feju3\nwvAn/yj9XVHjC35T7a6xAmydqWubyzDSz10jUMHBNvq6WoG695bNUMG0447z\n0lVEbFLbTqpDFS9e7JmgeMluq9cUPNZdHG7p0DCh680QxJgLyxSJFvPuupfh\n7QAzu9bfFsmiy05hb3LpD4LQq+1qzDXU7yXw7DCFqLJ+b3+0sC/xkDY9IU01\nyYpqYFBnPzqw5M11xXiyUPVQmPfiiriuiSwddUPsYOwhFbFC1XOTeDDUdNuG\nO4FDV+Ts7A6CjXxenww3VjHt3iqm54dmaED0iOueZaGhc5TjBjzBolJnzKvT\na1kwVrqsUVf5HLreCb14YFG24V2OGm3RXhJJwOI4xjbyNx27QeQ3UkbqkVXA\nEWa5utgFGocpH6cN+CVlhens3VubcXvZkAhX4mZlULSHUdpTDRdsBvTB1Se4\nic4XWRrqAcb4tcAp5U+B2Bvxo3JmSyN/M8ov8mGZwA3QkwShZ91DG4ms0Re+\nyo+lE6Yepts4jiKbYd1dGZmmWClDgwUyu7DWCbbxt8tDYvlPsbJyJf8Wo6XY\nm67st2wOABv4LHjyZBoNbH8qGkVcM9eOmRzDWczayDAsY0bcleRa/zx9pk71\nfiqA\r\n=kQ7v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"49d0dacd3a675991bd5b8c454304b1f10dbcfda4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.6863fd43a.0","@material/rtl":"10.0.0-canary.6863fd43a.0","@material/base":"10.0.0-canary.6863fd43a.0","@material/shape":"10.0.0-canary.6863fd43a.0","@material/theme":"10.0.0-canary.6863fd43a.0","@material/animation":"10.0.0-canary.6863fd43a.0","@material/elevation":"10.0.0-canary.6863fd43a.0","@material/typography":"10.0.0-canary.6863fd43a.0","@material/feature-targeting":"10.0.0-canary.6863fd43a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.6863fd43a.0_1611696868803_0.7979914607922098","host":"s3://npm-registry-packages"}},"10.0.0-canary.ea55b87ca.0":{"name":"@material/tooltip","version":"10.0.0-canary.ea55b87ca.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.ea55b87ca.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ddc670bf5f6d3632a1dd75a9646adb91b08cbf5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.ea55b87ca.0.tgz","fileCount":36,"integrity":"sha512-y4KhEkJ7V6I4dXk6uGwKqIFidrhMQvZox6j+7i/7ubvB0EYs1JRvHhqh+hIrJ7JWkfMJ2Cj30Qq9GXCznNaYtg==","signatures":[{"sig":"MEUCIGv5yjoiZ2W+4wxDFZrjsVs222+xvei8muBnRYrrTP67AiEA61YUhw2TEvO6xZIrzzDBUQyGTjBIHuxRxsUfJmGwjE0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEKoCCRA9TVsSAnZWagAACEgP/jy/rT3yQPbiSWnVspx1\nTvfwX/Pq+2yu2kSEooCQYH2HKQSYFYgg1RTspoyxu3YzKGFuMQZDGD5u2Se3\nzppOU8dVZ4DzzjfLNE1HVfyGPRx6a4okrDJWGm8Shi4oAQesOiyerIXP1yfL\n7IAzG/IWQYQ63NWoEqxBYAg+C+4G6EQz4h5Wlk409lECJ8e2IdiqaEnteV0w\n9Xx0YWSed74qMyMEJBQL3IJ7ekfSPwKKKDScnzZ1mXtNRJgDiv6YmLSnN1wG\nfLbwNOb0l6yJUnPjqsE7kmg1HMZIevH/+EUU6cOMAUbc0q+hzgdf114U8FLd\nKPAcUMtImznBwqihIoxKdksNnsh5k0p+rKyvRMfcY1HoEbzHErQhD6g4Tlhh\njotMaodclVB/7C+K7lmqm9QG1uPKnKFtS/TeuFgzwp3/EuEUngv9f9SDhhh/\nRcqPACQw+sbFFbSK/n6RMfuRKF1dT1s4kdMEmjIL1XdoT0vHkPOTspKN2pxM\nha+NonDSn9URlMq/vr1XVseo62u3eX+u2ReH8GNitCrN+H0VwI+zJncL2x1h\nP3bCJqlYXbv525MR4KIO8BTWTRujea5sKPUoDzSTBWKckuRkPcLvL1yyYTgA\nyCkVggqZAf/ur/U8jPIc33fjRUPnrLCrtctYyWvc46pVQax38qbArtKhOIxA\nzs2G\r\n=DL2N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"00e7569feb0aac4c4dbbfb9b292c9f53adb608bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.ea55b87ca.0","@material/rtl":"10.0.0-canary.ea55b87ca.0","@material/base":"10.0.0-canary.ea55b87ca.0","@material/shape":"10.0.0-canary.ea55b87ca.0","@material/theme":"10.0.0-canary.ea55b87ca.0","@material/animation":"10.0.0-canary.ea55b87ca.0","@material/elevation":"10.0.0-canary.ea55b87ca.0","@material/typography":"10.0.0-canary.ea55b87ca.0","@material/feature-targeting":"10.0.0-canary.ea55b87ca.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.ea55b87ca.0_1611704833634_0.3268153498200559","host":"s3://npm-registry-packages"}},"10.0.0-canary.e902ff05f.0":{"name":"@material/tooltip","version":"10.0.0-canary.e902ff05f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.e902ff05f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"33a1a63389a43864e3002acdcf64a7c10eb92597","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.e902ff05f.0.tgz","fileCount":36,"integrity":"sha512-WdFfWBzQKNX2CAmfznVT74+MZ+yhDkzNi6VRAQ7Nx7TlB69TZ4eyVletejtVZUvV8SzjZgPWlnKBfnBfdw/SjQ==","signatures":[{"sig":"MEQCIGSdeWHr5Nu84i5I3EDjhKB0wz0EXUgXGpkdUo6AWbNDAiA6PDWUOgTjkUIOYmcpbSXjkMFHa2EFSOUefmJE/MZvCA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEK5BCRA9TVsSAnZWagAAAJIP/RIW6IMLb7Wg7CwOFFxI\n5X1ngHHa6MsbgEW1JGte+TSp1Lt2o3IdATPYZ4NkxowtFNo3JSLqPKklalmO\njk2P8RA2oe5JNY4jF/KZxCOr0hqmrGx692aAY931tcQV9Ql1cWFlfzAkRVSG\nNsbct0180rsCS/WFh2oA/oWGWKbsqT71KmN5Tm0H9jlrTRcCX3T/Y4/g/myo\nqbzCQXyMdBrdWLY1KvPUhQPAZXgZL3foWh6iTK2qQKdRD8maD09eJu1hswnr\ndkCubmBvtg9PFspPNgol6oonPYZHOk0Hxt0muUk/NWKyGV8MPdJbo+qBUs00\nRig8b4pUgUD9J4lNyeaMXEss4RJMNmWjRzZES1RgwPoPfEgOjDL4nhUynPtk\nm556bHzatLSlLrLiU7HNENEnMGW2hd8tVN8702BQDR38QbUOVauD8/W8QTno\nTY4W5k3lsWOYUz16F0oRTy2op3thnSuIdPvArnybGjhZoGNK1e+VmrWgGMHK\nd6nIOfERTrrffzV6JZdiwbQR6Cv/YhwXLWCZJAg3ZDCeYvg6oKPqabqdJ4z2\n5nG5xyONMO8vRIeMd4W8c/Awy5TgBgbEhsEQsAnjaFX8VG8dNG9mJEeUjIDB\nOgJCwqThCDtl1xGsaUX2fG2oFTRsigPy5I+C5+d5Q7+ZQLWvoQgxKoc7XNiu\n/bJ0\r\n=9QKD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8ae6ee07772b70becfa69208ee5a4849f86c2fea","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.e902ff05f.0","@material/rtl":"10.0.0-canary.e902ff05f.0","@material/base":"10.0.0-canary.e902ff05f.0","@material/shape":"10.0.0-canary.e902ff05f.0","@material/theme":"10.0.0-canary.e902ff05f.0","@material/animation":"10.0.0-canary.e902ff05f.0","@material/elevation":"10.0.0-canary.e902ff05f.0","@material/typography":"10.0.0-canary.e902ff05f.0","@material/feature-targeting":"10.0.0-canary.e902ff05f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.e902ff05f.0_1611705919911_0.9879347560412479","host":"s3://npm-registry-packages"}},"10.0.0-canary.2c9fc538a.0":{"name":"@material/tooltip","version":"10.0.0-canary.2c9fc538a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.2c9fc538a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e94314d39d77d7d1d80fcb6285f17eb3f157a9dc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.2c9fc538a.0.tgz","fileCount":36,"integrity":"sha512-RYu/hDYBYu48r47yu5tS/2J8mVDE+pCuYlFgODr/1+VxasUR6GhWIWYe36yqUSg1yxdz9mPmf6+nwIkq4lImKg==","signatures":[{"sig":"MEYCIQCIkVGv6/ZcetimFIX5wd7qPYuYt+zuDvSrwPPwa89+5AIhAKadPamkdBnnU0r1oFniFYmSIyUifcS90V5TtUxOUcJe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgELOoCRA9TVsSAnZWagAAEDYP+QD/8MfZjtTtOdnZAA3Z\njBKRqjQ0Gdp8bzhM/P4pba5hUcrl4xRbzTOrL+Pe02alW9JtCc1pi67TzTyG\nYmSEKCLoFu0MdtSS9q17CggbzW3wACh8KfFSk3ad5ivVxXtmlyesZagzDucl\n1mSCqDMGRx757myIoVz7H4smlv0P09phQ6SDXhD3gAy1XHg9u19xliMV5q/W\nXbwej618WrOMSq/BtDWJ4JkUvnICyVuEFgKBsWf7U7AjGoI23VU+wApmpzSa\nAq5Qzl1hjEtwIOwAL/jw64g+uWxMB6BmQmMAgkH/he9+viLe2StxjTI1x9Dq\nNmQBortucDq4ih0Yw8vmfcoIGb+dm33I9N7fCIQZRjmCVTYhRuanz6vxLZcv\n7lWJ4wnrIucnIiHxi0plHdprP+9wX6Ftddn/JJ9NqgPJFqKPpaDnOQR4d3ew\nZOj++X0sYk++nNJsEnx4Za3MJ+WdittSwOsLFMhP7sVWX2kyrCY56j54V6In\nx34wU0kNSF10bEPW4xg1CwogPt+npB/b6KhsGvuDpGRUncCEWSPLbKozZEbp\nE5Ur/BJ2b2/IB2p4jv7xe2WgHPrDy8OYmZ5fsLIScFuNpg65Zd3uPo7dHP6g\nZIBxsYmVz5lAgJJhZ1kwVb1KyiM2Ci+Ef8IBglFYEo7hx8tysl8IIU70q8jH\nZS8+\r\n=r+xM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4bc5fff9ddee1f7703010e418626d050ca883474","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.2c9fc538a.0","@material/rtl":"10.0.0-canary.2c9fc538a.0","@material/base":"10.0.0-canary.2c9fc538a.0","@material/shape":"10.0.0-canary.2c9fc538a.0","@material/theme":"10.0.0-canary.2c9fc538a.0","@material/animation":"10.0.0-canary.2c9fc538a.0","@material/elevation":"10.0.0-canary.2c9fc538a.0","@material/typography":"10.0.0-canary.2c9fc538a.0","@material/feature-targeting":"10.0.0-canary.2c9fc538a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.2c9fc538a.0_1611707304184_0.7071198281713014","host":"s3://npm-registry-packages"}},"10.0.0-canary.6bf56aaa4.0":{"name":"@material/tooltip","version":"10.0.0-canary.6bf56aaa4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.6bf56aaa4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c31274e1dd89b5902026ced9717a37fc3fcbbc5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.6bf56aaa4.0.tgz","fileCount":36,"integrity":"sha512-/7eybm1Rhr4nwPSn0Yf3i/SP2VTQTJrL7ZNO4Eu4swI2L1SZw0x+7h19t2f4n2wTo7uT6Jch58M99rEL1EbjmQ==","signatures":[{"sig":"MEQCIGQhED79l5NHjsFBrB/vFaGOVa8k63vs7JQB/orqqcmDAiAA8QvQsSff+ghgolPd/J+Wxucvhrcn/0JFY5+RqQj7ig==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEMARCRA9TVsSAnZWagAABx0QAITRqTHE89tYYVIEceKk\n+KndG5t7lJiwkdM5tyX4VXzu6IaSP3e+fAkh8V8HHRh+vtnwbXA0jOWEzwqt\n4GGThuoTBEdODQX+JGWIaRbx3sDVRFOp2rVGCOkclJ5V+YgiITQzTIMLPs5b\n5V9gy0OFucb/E05mjLej/XoLasZwJ6XCOqOrHg/BJA4DvMM1IeSi2utQVZ4S\nt6apmUCANVy2Hc7aJmhqIFWF0UCRjzai04hg4c087das7dG/iIx7z7XRG4TI\ngWzpFfD+JP1bQ5MSWNqApFjXfTfZJD4YhFBfPSbo6rlG5bCAsS06V0qWXtPi\nuiGAmMqdWWKnKcEOxexLOylwgD4QHuLFbjvWWAFyfqr3XBfqyZqsrk+SC0YW\nDIxj9V38b54jlSeL1KzxJ41Oom5arNTjTqEhy7X01fjnepfjO/U+T5lm0pN9\nD7tt+0fKaCgxq+LZesZWDoZqj6rAeDefV/d7D8DXMcS/e3Ot3LeHnUqjhyuW\n2ke8RBz24GBPU81CFPOW+tAS6vo1oiBHQ5C9V4pxaPsUeZWicOaPJjAdAwn+\ncmoiQs0lT2WJurlhpv2YRY2dSKg8UOPV+qhdbMWPFKbzNH/OxvULecMGzo6O\nhkPz1PR4wPxSW6t4D3vKYpNySs0R2OPezbg4CxrZcxzSSCdaZldABtHQhKA/\nuM+g\r\n=xSsC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"557b9cd09fc15e60ea09bd17651230487a292b59","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.6bf56aaa4.0","@material/rtl":"10.0.0-canary.6bf56aaa4.0","@material/base":"10.0.0-canary.6bf56aaa4.0","@material/shape":"10.0.0-canary.6bf56aaa4.0","@material/theme":"10.0.0-canary.6bf56aaa4.0","@material/animation":"10.0.0-canary.6bf56aaa4.0","@material/elevation":"10.0.0-canary.6bf56aaa4.0","@material/typography":"10.0.0-canary.6bf56aaa4.0","@material/feature-targeting":"10.0.0-canary.6bf56aaa4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.6bf56aaa4.0_1611710481100_0.679179734152118","host":"s3://npm-registry-packages"}},"10.0.0-canary.994873795.0":{"name":"@material/tooltip","version":"10.0.0-canary.994873795.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.994873795.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cf45693e451279c53e324a982e708e29f05670f5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.994873795.0.tgz","fileCount":36,"integrity":"sha512-y0i3krlNPVucV86udriHDVyQ98FQa6fRAXT8NYHRYI/Uq5Cxpsv14cSj9l6bO6Fydza1KfvWAHF0j2StcAvHQQ==","signatures":[{"sig":"MEQCIEoFq8334q/osDVB61EYp0uVyj9XiuNLG1v0rMq8V1JrAiABw+NWDgXcAXG8guGCfoxir7BUJnrJObXpCAmFtcjjpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":510562,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEX4YCRA9TVsSAnZWagAABoUP/j/k5yrVYo+FaqZ5Jh3B\nlH+9AIVShKwMKWQn5fdxDuQu7lKqDN0hHP9yJQJc5EBAVDceouiq6SzAdbCU\naT66XkfHt2rjRANMSE+snOEg8JkEFyqnvUk1wG3FI7RIv0hMLRuQV0GiDd8M\n73adC4MG5CZ4Ncshs+9gMo4w0279vMxI/yj723VPxeQMBSyl5bZePYar09jG\nA292jpV8Ot61jGOit/UXb5CxlYcTduyIUhnw2YX8MhiAlyUXpfr/yHviIdRH\nwNZgsqlimqkx9LRN56u40Jp27HIdFGO9hNFBJScl60ldT1Q1qWI6nNhUAOgE\nWyM9lh8Z+S2vksyaCh56G/miRweuS+VUy0A/WofVW9uedXTFAwVOye+0vUoh\nCg3jGqw0zBcl5kZVHMnhPYu/6E0sJlTWx0Ky9YASjeF+wu/lOWo+pXkI33Fo\n5gvfyvbeBKPcwLH19yBUPLSKAwFi3KaIhi6pAGTo5kjta+mTrvRNvS3xq73w\nM1YgIizrdzhWaZ12b5G04kWu4HaXMUyu2pKag9IKvk2dRtt5bIP9VMIvMLBK\neZ6hcK4VUEXPzzXW60xxTOhozagwYoPAgIkr+9BZ51HnBn2YSGIpHdtvwPTV\nRWJbFgffmpe6WpgX3zC5Xg4hIgHzGUBOwU3fRyBt/aUtL27Xbc/MFCXoNh10\nGZ9N\r\n=LINf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8d1337af6a27bed9f06167ca1cc1c996fffdd9a8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.994873795.0","@material/rtl":"10.0.0-canary.994873795.0","@material/base":"10.0.0-canary.994873795.0","@material/shape":"10.0.0-canary.994873795.0","@material/theme":"10.0.0-canary.994873795.0","@material/animation":"10.0.0-canary.994873795.0","@material/elevation":"10.0.0-canary.994873795.0","@material/typography":"10.0.0-canary.994873795.0","@material/feature-targeting":"10.0.0-canary.994873795.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.994873795.0_1611759128195_0.43482534634842573","host":"s3://npm-registry-packages"}},"10.0.0-canary.96878e1d0.0":{"name":"@material/tooltip","version":"10.0.0-canary.96878e1d0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.96878e1d0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c0ab2ee8994108263a7bc8599c889bd27dab7a99","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.96878e1d0.0.tgz","fileCount":36,"integrity":"sha512-N+IMnGh3k14j+gvCipbDPftVMoZw92ZyvobY+Jm1V1zIuy1no0rmd8VK0A0dE50zV78oeQO//omjvGyoeHeHxQ==","signatures":[{"sig":"MEUCIDweJbGeLEsr2L0ezrLSK5BQT6AkqAqzaPiODkMCvOzCAiEA8vJKg0DQA2mcqqRu6B9yI2FOs6xbBlvVYsI2Z8/qAi4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEarzCRA9TVsSAnZWagAA98wP/0PMM+fcTaZuJjlKtWoZ\nBAHd7ocO+m7tugosVXGkwNklOdZjqaf+YYeF34I20xashCiXRym40CuE4nQR\nWnm+38GDQdXLgNUK+GRrONHUdbr23ReyeDcKm41s+itBgFXyV+P3jwdhcTOw\nMOcD/bUNVPQpCDcnJP0Xi2BlvPjPrIAPHjE+EYxT4s60MBLzwca9jcBACog+\nONk83CWYmy1VZvbrDmYYMjKI8Vzkhxy68sN4Hw5tHmKscDhBLxUNnvj/1llf\n12/6atDeNWz7Yfgyt9Jfvmdsf2JYm/ILgWaOflNT5YaRzziNM07mPir6DklJ\nY2sdfPEJjtwzy3aCbk1yqaTownPk5i6zt9j8U+zomTi/QcLu7XAUT2gtCYF7\n8tgHPf4HmuEcxTnXN7wMaUKLh+cZW7PK98sYGLJO9Rbhl/3XidM3V/yfk3Mg\nKoq1sBQPJ41KZ+CaRV3bE/qOGHl1068Pkj3ohYL0Y7rER+7js4mu3uqF7IOs\nwsqMisIL53K0k5DcfA0mcThBRxiZGTzh2mDu8tudhw/iXFk6EVTiqgWRI8bB\nPRiFrME0MeUx9dDx9BoGCLzTYHp3lmUClS0W1HEd6UKSbuJPWYIo43/Hnz+Z\nFxX6+AMbmbNj0V1bomK0gEZiDlR9K95Xa9HZBjsFlzckJVEqlNja1Xd20Sk9\nT6Aw\r\n=30pC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"cc9f62002fbbf03874065eac25971ed2b49a47ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.96878e1d0.0","@material/rtl":"10.0.0-canary.96878e1d0.0","@material/base":"10.0.0-canary.96878e1d0.0","@material/shape":"10.0.0-canary.96878e1d0.0","@material/theme":"10.0.0-canary.96878e1d0.0","@material/animation":"10.0.0-canary.96878e1d0.0","@material/elevation":"10.0.0-canary.96878e1d0.0","@material/typography":"10.0.0-canary.96878e1d0.0","@material/feature-targeting":"10.0.0-canary.96878e1d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.96878e1d0.0_1611770610868_0.5313341018437332","host":"s3://npm-registry-packages"}},"10.0.0-canary.3c117cdcc.0":{"name":"@material/tooltip","version":"10.0.0-canary.3c117cdcc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.3c117cdcc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ee7b071bc7ae23ecb1013799fece4348a2a96e3f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.3c117cdcc.0.tgz","fileCount":36,"integrity":"sha512-mOdMp0iCva/oY2XpWwZl+YJGBfi5n0Ptz45rUWSfiGdyrNjB9pVGdZD6nf1wxmftwDhGmchJVYvhdawt89EBhg==","signatures":[{"sig":"MEYCIQDqiFURqDHbQIcyOmnlKmxH/x3klGjP5InFIBRU1AN1kgIhAI3atNRBXtwRjNCtW+uQcWSdMTnND5eWwDwrXgs1LWXs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":510322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEbIDCRA9TVsSAnZWagAAIMwP/i0n8ePktDTOp0PqFs3T\nddFthB0tchpuXSADokP4+xcsR85qf87OJ2nt7FQ8bU5tMUsnwxBgNQFdCzNZ\nRyVz/vXJKV9TD2gPzt4QR8TlzYICm81bt03KZT78XSW78+1oi5ltBgLN2Ksl\n5q7DflmoAo/EMgdubtfnwIr603nVoGj7xpS4zWa9MIIcMy8gRnAQf0ieZ768\n4NHynnHHA+xVnwqcib/JDfmVNNfqw3gnFC6v0xzybV8IEabM55yN+uP5XGAl\nXfR+qUPmmZnjRbwC9jwFTOgqzhDx6ht7tVk20wt4e+pf6o0nX2jEhTzYb9Eh\nHN7ZcRsr19wnb9nnr89KS1lT1djy6cbqnhKiwo9MJvvFKu2gdChorcRBDQnE\n1YPeEiFJxmJbBgj1x2Jbj4AaAlntc6CGbgLr9FKwBwjPISJ5y2a3cqwjLXJ6\nimm1CU/3CXChuu/bYvpTBikJbEAnkwShmGvXKItGx8Y30brEa3uR61eBzTGA\n4J9+wWOjKL/VCaEPBCgaLIGLrU2FzzDwFBZpoVmSaadUkCvtwNvS7dSbOeoq\nn8LjpY1F3QysFiOgke4yVOhjNcPihY00+oic5gm4VouN4eLu8Y+fxtfZH22w\nBfez8BRz1Y//UAG4+n0D7pIjYcVn5l1wWOiVINqCfhTr9YnIyPSZ10LxsA8O\n4w2+\r\n=V2wU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"dfd1ede4a4727199e63765d305bb36d91509dde8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.3c117cdcc.0","@material/rtl":"10.0.0-canary.3c117cdcc.0","@material/base":"10.0.0-canary.3c117cdcc.0","@material/shape":"10.0.0-canary.3c117cdcc.0","@material/theme":"10.0.0-canary.3c117cdcc.0","@material/animation":"10.0.0-canary.3c117cdcc.0","@material/elevation":"10.0.0-canary.3c117cdcc.0","@material/typography":"10.0.0-canary.3c117cdcc.0","@material/feature-targeting":"10.0.0-canary.3c117cdcc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.3c117cdcc.0_1611772419250_0.770286486380346","host":"s3://npm-registry-packages"}},"10.0.0-canary.b411e7033.0":{"name":"@material/tooltip","version":"10.0.0-canary.b411e7033.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.b411e7033.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6a06dd8ff9740c196d2c9ba021ef21c5e19ff293","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.b411e7033.0.tgz","fileCount":36,"integrity":"sha512-cIKSlS4kLVPodIcQ3OTxpfwVcA+V7/QFaNd254l2ydyLeHHahj/1gp0WoD1Wwujzza1KV2840bDKMEKFvt7Dpg==","signatures":[{"sig":"MEQCIHvRXudMX2UVboTb3Afve3iGyO/ewyjjYjZIMLoAt6NnAiAfKSiCuGlM9b1XKJduIYKLm3tauK0QY5rtukYnnbrB5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":510322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEeOACRA9TVsSAnZWagAA9PMQAI+64ioiOyoY9HSeMbJA\nBUZt6o/ekFyKRWe/O0Hx8MK9pPIzSQfYJQk0RWaQ++FErnIlUT5Kodo565tI\nuvvao2nGUaq25kpbyRA5W70jSZ0OHPcaYdmwrYwXI44dPM1H1jmd1vgZlQ8r\nhSm5pPhOvWU1Bw6O2K0Bbmb60yLjeFww4p/wvuLp3C3UaP1LnhBMpQGgym22\nWKUz5t9dVCUKN1FnVCuqFh77lHlrtIn9yzbVYVxFZ0DrLhgQ+DxHHzvXxRDo\nePlUMFW3bkbxpLd9ewM6B/Vgdf2oldC2I5G7dtmmVN4VJsQHEYd0dJLUGdfx\nAmt+dFBnzmXa2ComNlzAYnAUpKAhrrir2hh41rm/V/P2cu5Bl6xMJTmISlHP\nxVglq+ogwG0rmhINtY6t3D4oLg1hse5ADw0TRFfNpxm1Nay4XR5xF41fT9AO\nq9ZkTKpZEUfY+xztpTSf0m0YWEnVx18jsf9B0OCSDdVm+qMTzs1ciH4RKYUd\ne9AS3GwczuzRcvhpFvES2+tKoFxNyIy2xr5UiCG0wYXPMSBTQ0hXh8boI885\nqpvVBqxHYDKKCivI2ycwtq8sgG7o7cLqBq+y3ICTLBkDz9OjFrS8EkQeOIrD\nKDcFLxJPj6B+/pLLg7wt7N3M8nbRSpqnRweO9wgewsHnhQ/Is1WBwaHKUwpO\nSjFd\r\n=ujkl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n![Tooltip example](images/tooltip.png)\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nTooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\n### Tooltip positioning\nTooltip positioning is based on the anchor element (the element that, on user\ninteraction, results in showing or hiding of a tooltip). They appear directly\nbelow or above this anchor element and can be placed flush with either the end,\ncenter, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Tooltips aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\n## Tooltips\n\n### Tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1d12550a6229cb648f6739f83d7ba5feeaa67dac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.b411e7033.0","@material/rtl":"10.0.0-canary.b411e7033.0","@material/base":"10.0.0-canary.b411e7033.0","@material/shape":"10.0.0-canary.b411e7033.0","@material/theme":"10.0.0-canary.b411e7033.0","@material/animation":"10.0.0-canary.b411e7033.0","@material/elevation":"10.0.0-canary.b411e7033.0","@material/typography":"10.0.0-canary.b411e7033.0","@material/feature-targeting":"10.0.0-canary.b411e7033.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.b411e7033.0_1611785088223_0.779128133968735","host":"s3://npm-registry-packages"}},"10.0.0-canary.a9ac16b4a.0":{"name":"@material/tooltip","version":"10.0.0-canary.a9ac16b4a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.a9ac16b4a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e6c1f70932a7626911291c5f2037e3c5afba6082","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.a9ac16b4a.0.tgz","fileCount":38,"integrity":"sha512-sqzkjjXEYcUWjBiPOWcKw7qHGRP7HOL9FzMl2VJowkwRGrjUqT+8hSwVb7H2Zsu3YZD1bt/ET2wZlEo2mGSV/A==","signatures":[{"sig":"MEQCIFhmzMoOPOaeh+NnfrHYT4f9MhsK4nUZ05VXaL7ZglPrAiAZonhoBOEJh9ZWxdcfMWdwlq0kxccr4Bq238ftCm6Cvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEfGOCRA9TVsSAnZWagAA4rMP/jSc1N7/jJZ4ahKrVkbZ\nHYveBSp8w1zIs2uZSFRNzGMI/GHTfpT17dU0z2YgGveEpaencNgGP9zzRYGx\nyrrYhyIIKwaJlBVS9xncBqC0gjFJbOwhpEbgE2uGEx8JjhUcOah9bVsk24kK\ngsUnooCn4/h3+w/qnokMnrFV/zsOCqIVS71VvNbyb7Jz7Vh0p91I8jozJJxY\niqJnij59s4cqRKLvgLCKCO1YDdyhI9G6Ag0fgKxBXcnGOmJzvkrGAJwJSsqK\nb4fM+izps4FH1kl6skc28WSPGKxGd5McA95p6Stchu63VboiVJEGKNHHWGIR\nBtxnZHDGLIJjtfCN2eHux1yuaRyQlU2JEagnog0Yj/9q8e9W7AJ0cATk6Yie\n6X6BQTlZdB/LOkPsvmF3+bpniG0EC/HtCuqOQ+P7XACsw3+RaOwavRXK1nvy\nsv/kJMl5JjR6tCb6crTEOB73g7+W1dchc8E5k2yW/YK3zwa8YjLQx1UFjOOX\n7760P4b58ubd+kOMcz3dGK66J8Zl0TCFNXzcalppQQvvBL+IaeD6GHbI/tJa\nFSdvDW6ybviCsd4/JBsxJVuTPXVfran/ZiegnMprNiMPJWUF/pbRVgk4W1eZ\na/Qygm/Qs82rCD0xGoVy8+UczvVK38lZ32uDdTNGZYPrj/q6V5eSweVWHf+z\nBmOQ\r\n=TXHX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1635bad405a8d329ac4e844d0a2b5f3bac553113","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.0","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.a9ac16b4a.0","@material/rtl":"10.0.0-canary.a9ac16b4a.0","@material/base":"10.0.0-canary.a9ac16b4a.0","@material/shape":"10.0.0-canary.a9ac16b4a.0","@material/theme":"10.0.0-canary.a9ac16b4a.0","@material/animation":"10.0.0-canary.a9ac16b4a.0","@material/elevation":"10.0.0-canary.a9ac16b4a.0","@material/typography":"10.0.0-canary.a9ac16b4a.0","@material/feature-targeting":"10.0.0-canary.a9ac16b4a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.a9ac16b4a.0_1611788685559_0.9955023144764374","host":"s3://npm-registry-packages"}},"10.0.0-canary.fec7b42ca.0":{"name":"@material/tooltip","version":"10.0.0-canary.fec7b42ca.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.fec7b42ca.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6579b08a55c9c505b1d0eccf08e165600b1f9f90","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.fec7b42ca.0.tgz","fileCount":38,"integrity":"sha512-+DJ6B5WVlEVkt3aTie1CsfJIcaZTN+barwvW2q5sV0CX/v5JbufnuzJ6P6tSrtgYMMsepkIkIzZ1TXv10VJVUw==","signatures":[{"sig":"MEUCIE+6abQCey1xazVi9fsEuYHch5ZUHO7DBaxj2itfCNWuAiEA3vMFzIY9EU/SyGup6Wf1ja02c+lcrqSPvxRVFNZtPWY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEw1mCRA9TVsSAnZWagAATx0QAI0lB+Quz0POGQz2Mm+z\nfG0xdBS8IGjJhepF++VlKiz+xwSps5ULTFUZ0LJsDCtfNlo0w4HwVknWOlY8\ngOheVN9UaDZA3WsiEMu1IP/xyQDp5wvUFz3hupvRx79xYa7rn10fRMo0DaXZ\nH0vZC0ANS4UyKzsrK49nXxT/d14S9z3gfub4P38uc822FPARBoP8sD7ijKH0\nd2347Jth8Q68ZOJamaOu4uun9K9lL30vwWaRtnm/0vWti/I8ch8k5OBOgSt2\nhVU/Ew0rkWqpA/CvAC8uUEbRDbTCBC8XXyYmV7iEF5YdgCOVz+Ev0r/rOT2x\nfoYF6fAXVObJMntR0XpzdLITYTwXHgh1f4W12uISqRWFOef642iGRGAfHKYw\nOETOuw6TSP/EOphnGLwiJu2u1ypFq9jUXxi17Mtp+pluKX0nY+zdZy0IpA0R\nv3yLE2holh5gTVEJatYKu915Jxln1/U3SVYLg5K3LCQtMfdTchuG4rlxgHZS\n1x0XuRtm/Sa56oSOVl2PddOEr6za8u6rN+P2eFSNJbrV4WyEuvjUcDMwY5+D\nkQgxX7eYI13iq7aEnoCiKrY0xojvqFBhmJL5nJPwPxtjnV+1oSXDnagMNWml\nFd6PEtNDOHYCqOTGXIxaX9yxSy/oSqgqgMKn+YvYmT8AXjxqLIRJbYlik5Uo\nvXPj\r\n=9xR0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c05b9618cc2b93ff9a68314dc20c83c691206159","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.fec7b42ca.0","@material/rtl":"10.0.0-canary.fec7b42ca.0","@material/base":"10.0.0-canary.fec7b42ca.0","@material/shape":"10.0.0-canary.fec7b42ca.0","@material/theme":"10.0.0-canary.fec7b42ca.0","@material/animation":"10.0.0-canary.fec7b42ca.0","@material/elevation":"10.0.0-canary.fec7b42ca.0","@material/typography":"10.0.0-canary.fec7b42ca.0","@material/feature-targeting":"10.0.0-canary.fec7b42ca.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.fec7b42ca.0_1611861349709_0.5949896746491257","host":"s3://npm-registry-packages"}},"10.0.0-canary.8e66dbfee.0":{"name":"@material/tooltip","version":"10.0.0-canary.8e66dbfee.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.8e66dbfee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9f9ade3e4ac2b2df20baaaf74b43abaf4d5eb0c8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.8e66dbfee.0.tgz","fileCount":38,"integrity":"sha512-X/hlF/Vegc6ofAgTeXZF1KKNeiwZU6K/Ntu/sWY3okXqgy1Y/P937y8Z9hIh9kgAd9NcbFR5bBvFncdrs+QnoQ==","signatures":[{"sig":"MEYCIQDut3i4Bik8W4f9qsxcal28uOzEVMS5PmCYdPaB2gFZdgIhAJvCpecXYnkB3sWP8d0hUUc/W5/IxnYIL8kxFRbJoIt1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGIz/CRA9TVsSAnZWagAAS60P/3jknqzwYqFmNOiB/r/c\nDkOZ9QZqhvnGagaMkVb0vByIAGb0Q3GOhAnJaoZzF0TQX1jX7LF6mfWDOkfb\nF5+KijzwBm8spvOujlr0/dbS0Z+q9SinuI9sTsJqoJLyD9vKdLMwxlRsJLhM\nKTuSRnhZtdQ80hBmkJx5rgG4mEHkqeNjNTP0pZ1oq8CZs6wsmhtiIcJQ96R9\n+zBfp1aRiaGvKl/bi+MdWgI3upWvWINKYGqZP1XIwHabFh8gBfvRUAM0/OYd\nGEAJMSFc34aTlrevc5L6p3Pa9q5km3Ossz+qqTAVGjVU0mryQoaUtXVqLmkd\nPH+A++9SAEDYQFf+I9EY260KVmNb1AU9RZlHZ0hNXpufQcgRyywN1zR0OqAQ\nOSq0sFu23x1z89N9uLusgTv7xgeg1DTep8J3Kl0HbX4raC/F01KH0TGGJ40b\nYKVYRa3H6128CUjc5qh8oIBt1cuY5lr9pz2zvDsW+j+Eb6DZWSwGFmM4Nf+h\ny9ATh6dAVP64R8RAr9bZ5sDLc1dAsQ7US8aR7kj36Up3kWHTvJoJ9IXYsHEL\nZ+njmkpWA4uQdNrEHhewEw/O7NzjdgKD2yTp+B1COvf22z9ox2fTGni6z+iY\nqlN0jynam04SvPpsGBM5Eapz47B7ZZzhSLpdHdPWSCBxm+YqSYVVe8ilpEhM\nr1/T\r\n=AGyg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"63606d4d60d94cbfccb1897812018e02aa13bd18","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.8e66dbfee.0","@material/rtl":"10.0.0-canary.8e66dbfee.0","@material/base":"10.0.0-canary.8e66dbfee.0","@material/shape":"10.0.0-canary.8e66dbfee.0","@material/theme":"10.0.0-canary.8e66dbfee.0","@material/animation":"10.0.0-canary.8e66dbfee.0","@material/elevation":"10.0.0-canary.8e66dbfee.0","@material/typography":"10.0.0-canary.8e66dbfee.0","@material/feature-targeting":"10.0.0-canary.8e66dbfee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.8e66dbfee.0_1612221694747_0.28997436390457443","host":"s3://npm-registry-packages"}},"10.0.0-canary.637d15da6.0":{"name":"@material/tooltip","version":"10.0.0-canary.637d15da6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.637d15da6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"050cf3e0e55c47f11bd3595c29d8cb5021e0f7a5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.637d15da6.0.tgz","fileCount":38,"integrity":"sha512-D4eHxm9SpiPcxvUZwfIgOiUe7IIKBO/wz5WlyuAaYfSCunIjBcOem5TDX5LKtQGBjEfcBPwZjyuhRXZH8W3Bfg==","signatures":[{"sig":"MEQCIBTagR18dtCx7qVN0FiKLmhHPQdL4SPBXM6PbSE4pQSqAiAom0UcQjxWt8u0GX+5XWSw4yNl0jB+Y/ii8K+eeFglJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGZ70CRA9TVsSAnZWagAAWzgP/AwZuwNRd5FQMHtdCJ17\nsIxwFT23bzDwr8k7UcpU/RT0ZkZovti1VOLdlu6MK472ot3ZQEWpGSNSIK8x\n4giI2BpJrAscUA9vo3rYK8X8PSNK7kwTn8SDNzuZdWTmVOEj9JyHo5uPleGT\nR3EcqbBbrR6YMCD3ZRLG/lAD+/RTW+ccYXPXpQnsKd6VikpC8ytR/T4FiqHv\nd5BbHcuYXnDh5cN+ixac+JpeNzyFlS2etpLlkPUBCufy5qo4r+jdERkvJ8Wr\nNyCXnTkDySYXkONyVbrrV27J6gH1V1rdXMgh0pu5RnFhFo+jkel3eZuk5OKb\nNMzFHrqKvJBcP3J1/W1/UumBuNNrfA+m5oepPWmQU284oU7lTnQSeD+9sQXk\nKCk7rkSQBEkzdXjBy7u51enmNeEpD3OBZJCSA/1OmPgRML0gbOeyaUiODkvf\n9jlDFrQQ2/yWTErqMK+HX2E4QDivM6qWis3BjxvgK6SSsoQn0sfaWTORBSK9\npwtOnbPyKj3zbx0RRmNfTBNmTkbui1FFTGn/Nnql9W/QazHEGZehUVYd4X9b\nrMzg96knqKgQLVG4PpwPoOSXq0C1we5cuvccf2yPFrZjMaJsU1SXtizNdZ+A\nIxVHUh2jIDlx7R8yb3N4izhUDRjvv66CchaPJvoGnem+dukUlsq8M1CWmJ1o\nCHMF\r\n=tVuh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"264dfb09f81436a3537d88f2366133e250344864","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.637d15da6.0","@material/rtl":"10.0.0-canary.637d15da6.0","@material/base":"10.0.0-canary.637d15da6.0","@material/shape":"10.0.0-canary.637d15da6.0","@material/theme":"10.0.0-canary.637d15da6.0","@material/animation":"10.0.0-canary.637d15da6.0","@material/elevation":"10.0.0-canary.637d15da6.0","@material/typography":"10.0.0-canary.637d15da6.0","@material/feature-targeting":"10.0.0-canary.637d15da6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.637d15da6.0_1612291827290_0.2396896029342397","host":"s3://npm-registry-packages"}},"10.0.0-canary.fb793939e.0":{"name":"@material/tooltip","version":"10.0.0-canary.fb793939e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.fb793939e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"70f2f9301c596b25e9eb09355fa0253d56a22231","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.fb793939e.0.tgz","fileCount":38,"integrity":"sha512-8S3LlVdgIrZliIBmFfiho5xvNJjEO/wZqr4XXLnlw8DvKZCwyLc6nyCYQktF5jNXOkGc6PmFErLK1j8Z686uqA==","signatures":[{"sig":"MEUCIQDXon3168cnIIW9hyCdgVUpb3ceosh6Fm33ad/EIP96cwIgI7B5xS0UEBGIbm2Afah76VcNw2ENYgPjJ5xz8k1ghhM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGePLCRA9TVsSAnZWagAAtk0QAJWZ+OljHPSUQqkhM4rg\n9Xld4GTdVekmkyNdz7NEob/a4dJa8AH7uUUk8Nt3D543RZBxxaDW1GfVIxt5\nE+mCx7DdP9RS/3EZeSYuVYmCOuXNDhIttTpvs0+zK/HyT4WZNs8qs99ONaUO\nHM5aYq+ho+ftIfvIbiIIgJ6mSXqsgWc5Faqpy5RPwE88gl6L1Je71oCdb2S0\nG/FAb1I0e5NjN1vQY2LQu8gihWge0hAmpe0PdRcY8zUYLHw+4pKMEVMxM4Sh\nhvuyi19G6q8PYBq3b4LfGA2/V0RbPc6mD3y5vpCSSswZaMFwZCprZ8Kd+4cE\n1yTxzLAf2W8+7iMo/Sdv6cq2/nK3+7jkq58iEQqtUd9C3ode6jfYjNIpRiOr\nYpHJtP6mujV3GyqpUnj94Uq2wl3SB33nFUd8vqHdq9HkPld8nnioV40UWv0Y\n+HPr+gqK7HVQAHfAQBfkxPoYUw0KlBdvMD4sDF4AgnvOncCjhFfotKTorycg\nH7Y+9W4C+7tMdUbGtMbQ2ChhCyN3b+H1XGgQhOWJsYAM4ZHPy3uLA1geIDbf\nz46WB31DCUPw5CEiaCVx98MFC4Q7aRpM0PHpU2ehg9G5MNT2jdxZBjfIyjKq\nadEUDJSX7IvZqWS0d6eKuwBRrolPjIgxlp3rtXSEcDPb9jL5YJ7WKucEuzFJ\nuTZ8\r\n=69/e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b89489007d2a0c1f3821bd2291e448d44723ac68","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.fb793939e.0","@material/rtl":"10.0.0-canary.fb793939e.0","@material/base":"10.0.0-canary.fb793939e.0","@material/shape":"10.0.0-canary.fb793939e.0","@material/theme":"10.0.0-canary.fb793939e.0","@material/animation":"10.0.0-canary.fb793939e.0","@material/elevation":"10.0.0-canary.fb793939e.0","@material/typography":"10.0.0-canary.fb793939e.0","@material/feature-targeting":"10.0.0-canary.fb793939e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.fb793939e.0_1612309450715_0.6973216294767586","host":"s3://npm-registry-packages"}},"10.0.0-canary.15a4d40dd.0":{"name":"@material/tooltip","version":"10.0.0-canary.15a4d40dd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.15a4d40dd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"441daadb20e7d4ac036170f3931abd4a17d09563","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.15a4d40dd.0.tgz","fileCount":38,"integrity":"sha512-0iHc1wFkkevNDFmTTGzVqBSnEk6wWGObdeIgjQfX0W42FFUM7ym8uywIHPepAo2Txwgsu7+65KsB8HiVi7jGyw==","signatures":[{"sig":"MEUCIQDTBdF5RMt87HuFk8QlSmZSQqPZOPSS4tCr3ub6+t5IKgIgB2Drmrcu3z1iSS82odCVtvtRIchZVEMODAqVp9uMFYA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGgg2CRA9TVsSAnZWagAATNAQAIXDNa+TIoyz49gFzbHl\n7GPH8DTLrL3DZNJm43ykvec6qotTdEPC8CJEJ7Hm9sQ/VXcbiDasCnuRGz6g\nq7vu1JL7GdIGauQ2Qb4hgUDWlMK1eNkU7g60rxGHcJSS7E3LNOctCL61zkz4\naIylUuAW+nSqPOcy02Br4ROxVXnhTjq8VJ3eqTq0+0BWVS1Rlav4n71gRw86\nCCQb6PaBhU0czVDXa7uOn6sdb75LSCSTJ8xRwOu/KtUlugp8FUTV8UJ27rOo\nyOb8p3Tly2oBdytlrn6HsMPhh5obKhJEnC3/tIFnZOOPy1SF0Aq1PNFtkvsH\nDjNSO9rjbzBldkUjHTpx8KtcMgkl5IjDQ3mc6Druf7AxiItK4Zbber1l5ahE\nsir5+tmUIH5SXU/Ru0uZQfAkf+aHbvKoEr1zmU0P5G2nPHj93G4/D4IXP2Y7\nWCf52wpjLyeAoDXrEunPOK2jzIZc6aMZ1VPLXTu2lt74Yf1wcFzqdYPcAPfy\nDSxbnV6tBCmvyC55SvBus5K5/7lWeL2ArXr5cpk8XrCs+fnVQpIwM3/vhJVP\nyTKLQkZhyxWxncyljoTkkxkoqYoiXM1zYE3PfHn2fR995NekbjRio8lriRtU\nxplS9L7YdxthSZ2tY1ErSu2gq0MHl6jviD23G3XLaD6Y8Evi5dBOf75+WtZt\nWBGI\r\n=sGXD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a6b5f072852f1f101d03fb492c57fc97f7f0ca9e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.15a4d40dd.0","@material/rtl":"10.0.0-canary.15a4d40dd.0","@material/base":"10.0.0-canary.15a4d40dd.0","@material/shape":"10.0.0-canary.15a4d40dd.0","@material/theme":"10.0.0-canary.15a4d40dd.0","@material/animation":"10.0.0-canary.15a4d40dd.0","@material/elevation":"10.0.0-canary.15a4d40dd.0","@material/typography":"10.0.0-canary.15a4d40dd.0","@material/feature-targeting":"10.0.0-canary.15a4d40dd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.15a4d40dd.0_1612318774270_0.1810718303939236","host":"s3://npm-registry-packages"}},"10.0.0-canary.7a003acf0.0":{"name":"@material/tooltip","version":"10.0.0-canary.7a003acf0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.7a003acf0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"43652b34e0ffcb10f4187284cd3d4c456237c0ca","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.7a003acf0.0.tgz","fileCount":38,"integrity":"sha512-os0WPoDYsgpajj6mZaTM8NDK2lY3WTfWgn4kDZhi5Frnf6S+hUXg9/8LR9XtIt9V7ly0dzUv7TiJo8V7tVbDCQ==","signatures":[{"sig":"MEUCICn90zIbvSMIHJt85KE0VnlaPATxlR2WYuG3M9hEQII/AiEAkE8fcTm6r+ajgqGGmyVE7BvLF4BjMEp0Jh4AzgzNZDo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG11eCRA9TVsSAnZWagAAk7kQAJwoGv/4w3j9XIpZUYxp\n687SHUJJffo/U7oMhG3MOPMzm1mAKV2PcJaBedIzZXs7KR1OwWNiVUxtjqHN\n+k7oblk9llCLrEEiay8UnkITGHH5ck2POm+cVyhehKWafu0OVwchHWOodMhZ\n9fWIX3mReoS9G2PUxa1H2d7Q0Vx1M9Z7piN4isGFl4/j1Nrr4Cd3L5+q/i1r\n3hVYWTQzMLw1k+EsOTs+ocS5FS4cX3x4tESdp52Ti3H7067SBMnRLUTPXgfo\nTNWe2N3tgUJuA4ZK1OU+aLwFyWwj3vzg6yhHtqGOqW5SCpAGlnu+7UXskMSj\n0eesHS/RxpBhYzL0kK0QH6li+iMH/go7E+c0+COmTY5PtWuYPCESrqVGrIHr\nZ8VHMzzTbGex1URvCIOLEQ2/WpnAMLvLFz81xak26VvlKClytgXVx+ldSHyO\naTpNxZzM98SrUkSCoGeNApcI4umpcpJh55onedwfbz42NpNgSkAL5ch2PgsP\nuTU4nwUtAs1Gu/T/+fh9lYhk1ldSVBe3nUnD1UY2V39izfNDx8eL3IRpkAhq\n7S8hp7XtpmrbPLCu69wYm363rmdBCbbx3wZ976kxdoHT/pRWAKm5tShJFWNT\nTw81SnLY0AXDHuiZxYbexIQUd3ODaIDqtvZcoL0aClc7zuGEfnR7WBP2DCoU\nFGQX\r\n=om9U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"50aca8110f6412e14432e118e1f9229dafb02d85","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.1","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.7a003acf0.0","@material/rtl":"10.0.0-canary.7a003acf0.0","@material/base":"10.0.0-canary.7a003acf0.0","@material/shape":"10.0.0-canary.7a003acf0.0","@material/theme":"10.0.0-canary.7a003acf0.0","@material/animation":"10.0.0-canary.7a003acf0.0","@material/elevation":"10.0.0-canary.7a003acf0.0","@material/typography":"10.0.0-canary.7a003acf0.0","@material/feature-targeting":"10.0.0-canary.7a003acf0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.7a003acf0.0_1612406110043_0.03299524762036077","host":"s3://npm-registry-packages"}},"10.0.0-canary.05f249666.0":{"name":"@material/tooltip","version":"10.0.0-canary.05f249666.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.05f249666.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"39c569708ab0cc26311c1ca28917ce2b8f31134b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.05f249666.0.tgz","fileCount":38,"integrity":"sha512-4CcR+fcoovndee4pj+M3I+FyiUTK8O4ic6dub/uM2RWzBrgR06/Gcg64Vt872Qp4qXeWSQv/vWVsLwwibJPsjQ==","signatures":[{"sig":"MEQCIH6Y+PoSgIQ2FAlMBlEJXlSuxWEELt3nwtr81s+iFu7rAiBgsc18ZFHwul8KAvIFxor/WY9hINBHoDUZBxx/+2FKwQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHDQdCRA9TVsSAnZWagAAb04P/iNhcuXmUGjeEE1IBOCy\n/n73MP18Z4dm4DObja1lCtwywQTG0YHyga1NlxUZ5+pvMJf5XT8PUo6uBBiC\n0mnSNHfpWsl6WFJLTI0gkG+GhwaX4vHU0/1Hn/QQ0WzSCPUvlEFDgZO9bYw4\n/WOkPyR/Owd4Uj+SpoYfPq2y5AQIfT0XiDSA00iztOBbcY8EZC5Cpr2slDYy\nLIjIP+E7jcE2FQN8pBpJf8441DRojqPInBBo8S37YBN0i7hySiQ0wJH7h4dv\n1O/4+Adzq58SogdpB+LGCTnaptvmMp48hG7ooH7oijnpG4oi/zuzi/tjOCsv\niJsSJ/Gw9Ca8rdKmYJAKLcyIkE2YMnOI5BQJVIr1l/57A+neKkgPVWcfzuGX\n0uBxWKj4Xpzbd5V2pnK+ODjgqvJPZzH4FaD7jq6pqncEO4/wZ2aWjbQwPp7K\nUppt0k5/nsdzmgCCrWAdF/O8qeEYiFOpMmNyHB/MoFjMVNFNBLjybzF+qpMx\n2ifXoFGEdmknQChB+fyUOLawTIv+WRGbE9U+bYaOkxw0QZRl5twOHfMeX0BT\nSqZSOt6rp8Vjtw9OREmm6IpB6VBw6+bZvK2dw4PCdqOkZ6ICTi16M6eTyWZB\n9qzH8lX/z4Vpv9bSNPwgYz3nMPIbkVkR4/U20By4bLSI3FI84QlscPXeFPO3\n6Dad\r\n=7AJG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6f1fffc7e905a3d49f007f288c26a4b5ea11dfd0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.05f249666.0","@material/rtl":"10.0.0-canary.05f249666.0","@material/base":"10.0.0-canary.05f249666.0","@material/shape":"10.0.0-canary.05f249666.0","@material/theme":"10.0.0-canary.05f249666.0","@material/animation":"10.0.0-canary.05f249666.0","@material/elevation":"10.0.0-canary.05f249666.0","@material/typography":"10.0.0-canary.05f249666.0","@material/feature-targeting":"10.0.0-canary.05f249666.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.05f249666.0_1612461085485_0.42267354947278646","host":"s3://npm-registry-packages"}},"10.0.0-canary.1a3a39629.0":{"name":"@material/tooltip","version":"10.0.0-canary.1a3a39629.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.1a3a39629.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"38f47344707afb13484f14d3e3e3f89ee9d1dc9b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.1a3a39629.0.tgz","fileCount":38,"integrity":"sha512-UfyNv7oQwH7VTasLQcd0PX3Vak8pzJhPa7wySEQx+XkONpueILqQiOB8aR2eUJF/v/RnhAqSg7OJDy2wcmAy4g==","signatures":[{"sig":"MEQCIE0tPTpSx5Hlg+Q6yXZ5XqbtcEo7ZnT1OpeieiJczPmYAiA3NAzdDNRk5GODJI4qsWJZJy+UQK3Lx77SQTHKlql1Zg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHECLCRA9TVsSAnZWagAAyZcP/1tcdtPtjLM5/d25Yvj1\nkRowH2a47RiqnfiLtxAkSnOv4pasRTKoMTcuIvTM4Rj940KQqNaHDF54vMs1\nyyU/HRqHiSDzgOWG8OIWXGlyhGnkoJN0R91sP/Fsyr3PuUgocNMEE+z0Idgw\nw6pG+7v789JSDF8BOELbfM5aYTyaSrPMOuPLMwjXI92LfpVO0KIb9J314O1o\nAqheYEDfSWYd3rRlzSnJClf8qQ/a7vvUffeCbQZZIeFRPXMCBhV96XqQcNpR\nfj0vnjYLEOU4sKiM/NJ1O/OxETfKHYPvUMqMpbGwTK+eaHmcgbv2ZPCt0XSV\nlGqK6lRs/CDYieb/j3pUDPO/cKra3ymHmqhz/ycq3zbIXV/+GuEGdwhxDgMb\ndzUppQ+m3xQlK1ty0SUziHMf/NGfP/TTvfhdktV1O+89S1rt2e0qLx/3qASj\nWVrxgF/Gftx7xMsSXGUn2CN2dnwgZofrwxP81wfr/A2C7VHS1DNyp/0L0kHV\nQH74f+Rm72R7NABIo41AhoSQSB1JPq/D+ezEJboPE/VrK5za+rBXl3TD3K9D\nnijwRR7GZvzs2za5fEE70PxdZbGcb+xh8KmYJZtp3B1+nMyPPe4P6xLz1AO2\nhgjm9S4EyQKc49ioy22rrmthKKoSkIvRBmOHQF106P7TuQjxVcVBXOg1ndzn\n5iph\r\n=5swk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"87d65275f85db5a2c4e630df10d231afaba36449","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.1a3a39629.0","@material/rtl":"10.0.0-canary.1a3a39629.0","@material/base":"10.0.0-canary.1a3a39629.0","@material/shape":"10.0.0-canary.1a3a39629.0","@material/theme":"10.0.0-canary.1a3a39629.0","@material/animation":"10.0.0-canary.1a3a39629.0","@material/elevation":"10.0.0-canary.1a3a39629.0","@material/typography":"10.0.0-canary.1a3a39629.0","@material/feature-targeting":"10.0.0-canary.1a3a39629.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.1a3a39629.0_1612464267279_0.2152442264022787","host":"s3://npm-registry-packages"}},"10.0.0-canary.8b1cdb1be.0":{"name":"@material/tooltip","version":"10.0.0-canary.8b1cdb1be.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.8b1cdb1be.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5356c458665061c206209e91262b536e2a21d718","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.8b1cdb1be.0.tgz","fileCount":38,"integrity":"sha512-W9WyAZMs40rnE63en5J+/pYb4g/ko60Nky16fNzDgb0jg0u8qgoEao6SozlFOr2DTEoeaYEsGm2wM3EsP7Q8RA==","signatures":[{"sig":"MEYCIQCPGJNTZZlhQWR4bizkuuIlT7ss+PGW01/0235fStrV0QIhAMtZe6TyIkT6iE9+0aFB8pgG524+c0/onp+kNuSUQmbW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHHbTCRA9TVsSAnZWagAAJqcP/RVVoKAsJgJIB/HizVOE\n1A7qhLLh7GhiYq70Q6HHXMUFdq+QPifnxnMqeJ0z73SPZ/Bqub7wRQHkErVN\n49hlpfJsDj5/Z6lzkyVoGo22+NmAZBWkK7fS9QcMgPreE0qCWKLDI/UORfQU\naTRoLQmNF/FcqD1pRKkyvS/TU4RrIaeesS+c6kw24xx80B9260bfH9S2/sCl\nRbn+8hCrU9yIiFMMpByvaF/mTK81C+R7dE5Yso1rOS6jSQegistq088NBlb8\n0MHJbelMJVR4HceCS/K6YU9MFLsqGGGneEUX8XhshpI6v7K5qdZaVrPQ3fUr\n+jxonMcNcYHeCEEBRYzrcyxoff03nCXeiSgbeCsl4gX5+9e6CzOkh8gWhJU1\n0f9JIbQFIeKyzCqbUjS7AZyv4HE2Z6j1f2s0IGYh1wdjr7YFj3ASxI0aWcbf\n6LHd7lJCgzJtuqXwx1oIkqT9SKvMMR+BL69RHJHhirPnHfjLCcsBjSOqFSqK\nMWcSaNJ9KL+Knz62uXFpz3BpxPvLo+VQN9ioSnC3/lWB/9wd+OSGwXiMHowW\n7DTJUP2yrBbIebA0khYAfHjGp5OjZAy6gpr4X98tGT5dav3KMRpBX60TxGbn\nxHgLYpO8CAv/09qYm6y0L6eCtHk3qR+hDYGGmOf60pz1WbGqlCNbLREXirhS\n43z6\r\n=0B41\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"73f8ad23c72c2fe32bd1a9e5e102b6aca8ce21d1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.8b1cdb1be.0","@material/rtl":"10.0.0-canary.8b1cdb1be.0","@material/base":"10.0.0-canary.8b1cdb1be.0","@material/shape":"10.0.0-canary.8b1cdb1be.0","@material/theme":"10.0.0-canary.8b1cdb1be.0","@material/animation":"10.0.0-canary.8b1cdb1be.0","@material/elevation":"10.0.0-canary.8b1cdb1be.0","@material/typography":"10.0.0-canary.8b1cdb1be.0","@material/feature-targeting":"10.0.0-canary.8b1cdb1be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.8b1cdb1be.0_1612478162787_0.6111349202928824","host":"s3://npm-registry-packages"}},"10.0.0-canary.8271f00f7.0":{"name":"@material/tooltip","version":"10.0.0-canary.8271f00f7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.8271f00f7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6c34dcdd5282f54465c8364d44fd54d5a3525f73","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.8271f00f7.0.tgz","fileCount":38,"integrity":"sha512-F4BPJ8mjpDvsWOOKzQv9o8SP1sHu3+XCEs/9PRIbT5qpYNywF0YxJIqRo65FQDILFXvh6GfyW6WbOaBmB6KBvw==","signatures":[{"sig":"MEQCIGIvATy3DF40feB5h+DFp+OjjzTLpzu1D5AFpLpAxExqAiBcnLkuAfThxIg75OQgGYifMwLcUY/dcEYBJJOCuliwUg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHHzXCRA9TVsSAnZWagAAP58P/ivmxvrzPDqEfcGslHRc\nF/ypAloAznYm/zcr+Lm31SjEikoa+xiKkiQfZIPdiHPSvuTYGuXgTk/iDmhS\nS2Bc2DLjOIqKHagf9fgyLBTbW8jlvmlIgd0k2EV1tPFpi3m2TquSVaz/4TdS\n/HOcuoUGA9/6WC43MQNxdb2ZUeaJlw+roM74kHD41VB/nXCCh2cIqhBzkpLB\n1xaYJ5F+c1ytAO7Lffo7q3jZhxe81HznSUk4kGInepS8NzHtYlCVGt5mJtsI\n+2lUIHoAdjIgnxIUL64fLAKW2GSPrMg4/wRVWLqakcf9ZHAjjPVdRM7dnkKj\ncPJ5+H2BtA96mt8Q8XxkAf9V4aRsbhF5VC/lfIpm0pDul2PCNcXZh+I/hpaR\nT8BfBX+9cU/2E0tdOqylXaMVX6fdIDHXru6ZJf1ZXS/jomwacCeSP4eoPR95\n1v+niocPRqf5R65CU/GQoFiFwtYtWOvIOyT4mD4oo2KYCy0QcZ9eJlP+HfWZ\nY7dGs765k/jbbigu2tG3GJcj/9oxUm3ExuG4ATCujnbZDn+P+TfJlgaqvnHM\nu8QjML5gVRa82qOelpzDHiL+nqYrngiI0DqbLoEIzm7kpAIeP/XUb8x+VfME\nthztlEdHgwFVSBkBqGeadB794ZjqosFGRIF2IHhneMxKzU41fXHRiT0CLcoZ\nKtVi\r\n=1fOb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e210c5292564fea23c9cedf08acd2b8ecf86e94d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.8271f00f7.0","@material/rtl":"10.0.0-canary.8271f00f7.0","@material/base":"10.0.0-canary.8271f00f7.0","@material/shape":"10.0.0-canary.8271f00f7.0","@material/theme":"10.0.0-canary.8271f00f7.0","@material/animation":"10.0.0-canary.8271f00f7.0","@material/elevation":"10.0.0-canary.8271f00f7.0","@material/typography":"10.0.0-canary.8271f00f7.0","@material/feature-targeting":"10.0.0-canary.8271f00f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.8271f00f7.0_1612479702796_0.130824749784324","host":"s3://npm-registry-packages"}},"10.0.0-canary.533092a90.0":{"name":"@material/tooltip","version":"10.0.0-canary.533092a90.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0-canary.533092a90.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a449340a2241910360a1903d12713367a9bd57c2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0-canary.533092a90.0.tgz","fileCount":38,"integrity":"sha512-FJ35Q6HZKV3xgxwtipI0X7uUgIx2gLyQQ+6tUoJLHb7AxtgWOIqpCw4gePXeJEQrhCZkAKJwxJQ80jJ9RdjyLA==","signatures":[{"sig":"MEUCIQDZCC19ibX+SbJxYEHDjyfHE39X6ufdDctIKediBe6rygIgQI0B7gqP2b1o97YgJ5LyLxCPRtbVnDqa7BGLIAVJm1U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHL/kCRA9TVsSAnZWagAA1AwP/R1zKbIXb8GmHP0dZshg\nQisJS3ilmuRtUtj4znR1Q/jjmjgj6CgiAOGn6ilDN1O0/wBtCMVO7TpvW7WI\nFxi+xBZS2gQ18+Q8oHuQue9PAV37OKPzAg9+jJKM93cLCycmBGdnq6gXSlMi\nHiCfaC+B8bRWgFpIHh/dxp65ZbYkL4jjZKNgUI4X9YU44ywhsuqf5s2dHQGS\npZqW+CAq7u4Lb7xDUikR1no8AVX8M421dD+bnRPBpf3qWhP3idZeWyFAFde/\n8elU4HTkiHNNX1qvvfkSR4rvPz1E65o2H9oIGghnVpKbKzgsZZrMWqHLUVS+\nrWGPxndcedk68TnWWI3Ctx4DP+kiCtoTmym/454VeKzlSvbNjs8W/aNJoOf+\nMRhDCvUHDrxDYCLcwcSmkEG/vEWhpGzn84nLjSFJaC4QSkswc3aOqORCUQRG\nNWTDVhrnwO82YWIkZRy54MCR0/fT/geJh5pPcmX0Vo47NkfSC4OUdFU5ZODP\npT5J1ZtGvccmvKX8/IxzF5jtPDvlN48iwR4Omwy8spUP8hI4donTV2Vpo+nc\neUTQgqomJvvE+vZWuldQ+GgpWdgKWxmnfiERI36LVA+JP170nA2jGwkha8Jl\nRMrp9fbJK826omSMuWAge3PHuFCbRwHq4tLJkjM7cnUoITYxUbUr0qlxQew0\n0aVE\r\n=AQuj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1f76aa244e85ddde7348716259e771c739c09f23","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"10.0.0-canary.533092a90.0","@material/rtl":"10.0.0-canary.533092a90.0","@material/base":"10.0.0-canary.533092a90.0","@material/shape":"10.0.0-canary.533092a90.0","@material/theme":"10.0.0-canary.533092a90.0","@material/animation":"10.0.0-canary.533092a90.0","@material/elevation":"10.0.0-canary.533092a90.0","@material/typography":"10.0.0-canary.533092a90.0","@material/feature-targeting":"10.0.0-canary.533092a90.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0-canary.533092a90.0_1612496867655_0.1316878554304015","host":"s3://npm-registry-packages"}},"11.0.0-canary.633a9fc7a.0":{"name":"@material/tooltip","version":"11.0.0-canary.633a9fc7a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.633a9fc7a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b1b49150d76fb5b377bdd75e505c8843dbd140b6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.633a9fc7a.0.tgz","fileCount":38,"integrity":"sha512-yKJxvLnWinrufsQNuq3bcWuliLZcSzQMjIcgSvM4p7f5XvIYQ6Ys1Jmjhy005yEYu6u/wYDOptOpSF4u6ekGjg==","signatures":[{"sig":"MEYCIQD5eJNiyw2OoHoDx0ZdeXxdNQ5zSbK079BDNCYB7AKSUgIhAMKo/f1bLPVCGfAlXMgTUgaTyQ9R6YdfHxJ3G01n9p9H","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHW/nCRA9TVsSAnZWagAA9WAP/i+i/VQ0DdSMEZ1o+epk\naEW9e6HO4f4l4TvwoDlCSBd7ntoHMqgGPbRAvk8x0+OWm7l3OAMGvcCSjxFR\nYe6mqn6R9mGpgHxwoyRrYkjDj8fEBcsWwgfeZAFVluvFQ9beIc2/al2wd5SX\nYo7+1l5GqqT6Ts9Qe9N6lKWU4/p5PmtKaFFAVoTOhiwwIm6iaPQEVmX3vPQg\n6fP/7j95NZeKTAzswWglEB8eplVixvsSmiBoLTDZxiZLKr9aR+3G+eWkdJCN\nCl6iIu9raKUvd9IJRCu3cb4nSpq7SYhZglqYyi5Bsq2t6tTr26BJ4u+6AV03\n2p1zfJaaUgHVKVNbeZu+oSUPnu6kQhvUGSyxOnpUlBSUf7rjOuKA/ZcuJf+j\nHhM5cdxUGLD5b9BLNJCQ07kCfwNENEyu9Mt2jhrk+Fp0NL0+FIUNWyyMWxFw\npZCimOVPoqxJNL7ydeBFpKvlfsOZ8GHl7FdTSaD23ImZTWHLqE1Pbn2BpzXF\n+q+KvX2oMbKMDCOXHMGc4PXZqYH/EDmp12dHl9TOjh/p4FDPR/RAgFA2hwHn\no8R9PYn7naTijXhAJOhq42wC4w4aP2KG7BupMBqR3ReDySuIi8+3/BwewF+r\nSzsZawLBOE4SPfa/10pHD6HLMWYlTbB8fPKsXwca9e7FvPa8sMTiCBCqmVgU\n1HQk\r\n=2ljb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9fe28e8829bc50c384861e340d551c0718dac053","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.633a9fc7a.0","@material/rtl":"11.0.0-canary.633a9fc7a.0","@material/base":"11.0.0-canary.633a9fc7a.0","@material/shape":"11.0.0-canary.633a9fc7a.0","@material/theme":"11.0.0-canary.633a9fc7a.0","@material/animation":"11.0.0-canary.633a9fc7a.0","@material/elevation":"11.0.0-canary.633a9fc7a.0","@material/typography":"11.0.0-canary.633a9fc7a.0","@material/feature-targeting":"11.0.0-canary.633a9fc7a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.633a9fc7a.0_1612541926735_0.8340715636889475","host":"s3://npm-registry-packages"}},"10.0.0":{"name":"@material/tooltip","version":"10.0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@10.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"485b125555314635bab6044d6e34bb05df443ac7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-10.0.0.tgz","fileCount":37,"integrity":"sha512-sH0c9ERNGZe+QaxRNQIFczKNu2y4IbDsuhb5MalY0XZ6jurpdm/1UxEBvrhquXkUUebJ0tPzbOJ214+LJVSh5A==","signatures":[{"sig":"MEQCIGUi6crQOzlmsn8qioAFucBv8d6IYuUBfSS9W682RJ4oAiAISajAr9IqvLgOPkHEp4Cs6DkN9JLLsjgOCNQnUg1KiQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":593002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHXA1CRA9TVsSAnZWagAA3R8P/3drc8WeFXl5dPhzSCGi\nJMeDMngxJOoTHQPKOxBxyqacFvJcZB9H6Tb/kzm3Km01EnU27YMaKzI9WSrd\nQHEcjwc27NkuOLK7WIbHd8lwbIV1vjqqEe2WTGDk/2sSVvTkk76OK9cfD6sW\nFUxUTQpIRZZFsZPUKtIziRLLfHBjlBD49jwFPPa+6z5aEPs+ePABF8p19u8s\nY/ratFKfURM3412Zn3cEu1qVVvylAXJoKktRQnh42Wjopa9p6ziw/gjY3BU9\nCgyghyZH+mVwGZuewC+dvCNfRPhVZN5tnbnzBvAp9+p6KPrl8a9NWJ8YgFEc\nuQvMUcUsq+ubhgXRMDsaerWT/AXV7CHBFYKU1XV8Z5rQe3rDfB37bguVOpeZ\nfk/ualv4iHLifnUlVYmKvIRS2B/ifIE1//HIC3vgDEIvGd0ihZy2aun3FTek\nJnPS/GVcdhu9bUrR5rEVjtReWg/fUb7JphJ3QrDSG0p8hHvkntkS1akSUX+n\n9A0iKSxJhyl9zQg5LEoqFArfvIK0PdnyUvr+U8f31+wklr0uDyWwQcDBlZ89\nGMrR8wlGs+gOkASUc9I9pkL+hFkfitNP0+4Xqsg8QuoVTehie4UrnswDJiuz\nYaYGziTL0Qukw3Mb/2jdaqkLgL89hZ1NGA78HsFDcVim1XxQ8RNg1yNstTEX\nyRaN\r\n=Ean9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","gitHead":"633a9fc7a98d0d9bdc177bc9ccbd49beb25bd5b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"^10.0.0","@material/rtl":"^10.0.0","@material/base":"^10.0.0","@material/shape":"^10.0.0","@material/theme":"^10.0.0","@material/animation":"^10.0.0","@material/elevation":"^10.0.0","@material/typography":"^10.0.0","@material/feature-targeting":"^10.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tooltip_10.0.0_1612542005450_0.6732926476926813","host":"s3://npm-registry-packages"}},"11.0.0-canary.b5227247d.0":{"name":"@material/tooltip","version":"11.0.0-canary.b5227247d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.b5227247d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"502b6c5c9a2583b9b7c1d18242b9fa21de226a8a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.b5227247d.0.tgz","fileCount":38,"integrity":"sha512-ut5uNNn4HNTM79NTjSdpM+oF2XMzQgYEIh3//6zztVEsQ296Kq76IcqI8xOyR83DZYe/VGUzex2YbiG1VR/FtA==","signatures":[{"sig":"MEQCIGq/6AH1VzKYqn1OWWklEIJZ4V8JBseafIJZ4C+9GsiDAiBGGDkDFVq8FqPrJNQHepkW9j6KgeIz8pz95cxvap9Wew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":593561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHYO0CRA9TVsSAnZWagAAcwUP/i0EbCQ8spA378+6j+0n\n/N2Dyni4enz6HbcYkVsyufE+4GZH6imoqwsmFFSJzdnqhu+ogDDy8c/VwyHw\nBgQ2oiSVaLobVacd9/KTMaFbske3Hjw3Cj5z1SS/xmOo/LoNCR9N3rHKDaYa\nFQNeAeN1m7zTKOZ216sZKv/nwxi4NRqm1TlakhEPm2Ll94WUSoLmpWcS1GTG\n7/pFCxI5HkN7jHsIbYAli65vGw17miVkP2AHiA3o5XjZx4WgLYtyOpHlnapQ\ngaGlcG1PqxfOBez3KHxi3NN3AQ5QqJeHE+dAeXnTnuSy6QBBxuKYnT/NkUDC\nnE60h+V+Bll5V8M+wbI6GU3peE/mcJGa0rhIwSZ0K81kGeRNquYsCtEdhkza\nidT4asUvZq8Q8MQvO2y8PUffFiDuJjejmBhfagCNqO1kpT3+8yvWFur4+vZm\nYvijr5wfGm5J9rKcRYlrxCbXwey511ClY5Uq89fj82dPM+uFpV33YMgn/uVv\nYnUBZMmf+prD4cz6NnEh6hI1YTi8OUgruJH5QZ/SMbPsPyRmTnvcszAipFoF\n9BkLqFBp/o90mLbyDLG5bwZBr2wJsW+HYtZCZwe4Toio/su270N64ahL6YP1\nqZbvsgyBDpI7rTQfBGGbP4rxv3uG4FkJ3qGDIRk/QrAGg/AfMj/YWlb4O0Nu\nyJTi\r\n=B39B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6f733c52a8cabe9fdd3ba4c35cb19e5526d8b312","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.b5227247d.0","@material/rtl":"11.0.0-canary.b5227247d.0","@material/base":"11.0.0-canary.b5227247d.0","@material/shape":"11.0.0-canary.b5227247d.0","@material/theme":"11.0.0-canary.b5227247d.0","@material/animation":"11.0.0-canary.b5227247d.0","@material/elevation":"11.0.0-canary.b5227247d.0","@material/typography":"11.0.0-canary.b5227247d.0","@material/feature-targeting":"11.0.0-canary.b5227247d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.b5227247d.0_1612546995583_0.07385912829565444","host":"s3://npm-registry-packages"}},"11.0.0-canary.95322b11e.0":{"name":"@material/tooltip","version":"11.0.0-canary.95322b11e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.95322b11e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d9dceaff6572b367913e2435eec9d6efcc7ed4c6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.95322b11e.0.tgz","fileCount":38,"integrity":"sha512-UzITCntRtVPpJlfOOp9UJZdQ5lOJBCekGiWxM9l8vfoWBBI4m/0MnraGCvxcd/k7GZ9bdIRi+yI1l+ALF/D4hg==","signatures":[{"sig":"MEUCIQCtj+xgvGv04uVimulcYjRHJAyut3cgAxu1+Z/yRB2jhAIgRPm2qLuAvd26nhy6Hh9fRL4OCB1OMRDNriRDjycdrLA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":593561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHdWdCRA9TVsSAnZWagAAbpYP/REyfAdPDlBVaC4gJgld\nkGwRzyaHqW5UuH+dCcTUiPveTcjQUU5xSYY0XNLpzeR3Hc3rmptoCScctHA7\nFSW+EpGRfqQ8BDT3fQclQWV+ViwiBWcO5PwrOaO8A0zJWdCAClWs8j8KFcFl\n/TjsDOAW+BukUWgtlnkbWVaCKuszYwxoK8mL35HHxUmkzJsxuRADSy8dWG5S\neDj5WAZVxpQN7iIfVHMsr1ZSUaooin20RoH+x01IoQJNYKVX3yXumV71nNMd\nwI6NDhRCWwjO9UVsXUtjt9LdYnsbt+EV+XGtUiqoVfYuCGQ40JUW94wTMGH6\npF4MPfcEdiuYsFbLKYKUZPM4fHSMWnCGZ/lT2mTuQTeDi4gYhBbwjUoHKtO+\n5USpD4v05CCMRL14Dmk1bXu98dhlpC0hPZWv4Q2J+dJOI9DodaqTVoNBiK6f\nEoDC1bg+Kvy0jWzznX+hDxiFBCCgK7DsKjy/FTLSZ6X53ynho86emPtJQGNj\namN0t9OO0DU7YgjEmg+VFEH9WWWWG4zjJAUkYdc3goIqjQRuv1Yk8rbLuOux\nuC5xTJO6N2iM6vsfWNzmlJKfwVk3jQ5O5QdpVrFUvDEnqIR3K/XOCZNt4pZ1\nK9L9XgotvNFE3Py79PaRrl99oBgAII+P8aOQl8Hw4cmEihhMBmSrlqO7ZOg6\nqRWM\r\n=wJ5F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"96cbc49ea4bd39eb1c275fdae68b6bae32b59ad9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.95322b11e.0","@material/rtl":"11.0.0-canary.95322b11e.0","@material/base":"11.0.0-canary.95322b11e.0","@material/shape":"11.0.0-canary.95322b11e.0","@material/theme":"11.0.0-canary.95322b11e.0","@material/animation":"11.0.0-canary.95322b11e.0","@material/elevation":"11.0.0-canary.95322b11e.0","@material/typography":"11.0.0-canary.95322b11e.0","@material/feature-targeting":"11.0.0-canary.95322b11e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.95322b11e.0_1612567964879_0.8162291516065681","host":"s3://npm-registry-packages"}},"11.0.0-canary.1f318ff0f.0":{"name":"@material/tooltip","version":"11.0.0-canary.1f318ff0f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.1f318ff0f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9cc621a8c6fd47b881ff2842d2f37018f1c38cf9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.1f318ff0f.0.tgz","fileCount":38,"integrity":"sha512-PMbHJ6Y9V0Lo11bqVEVWCZnEX188867SUn9f7O5f6JaAFnirP7CG5ZhPCmNs6jrYsAXbOtpRj7ZghnkHeMjw8Q==","signatures":[{"sig":"MEUCIQCgTflhxU5MogX0rZDf674tX0UDvZkMucOCHgjACIRmmwIgcVRCXsCcgE8X21xdt1JcX2lijloUrrV8BAgtIU+lT5s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":593561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHd1oCRA9TVsSAnZWagAAzHwP/2YqnN5YXILZ0EFyVvSy\nozk5UxpuexscVcNleXnXQT/lHjhtVj/bJtpnR1HhL9a+roUMjrGR/jCrqHKx\n4kW4kp2MuBg3B1DBTdXHZnr0a4jDbRLSbyGmHpDPk3QdKKokambazb29dpOO\nsck8mh5M1qGMiLsk+XEpiX9JIi9s9lGjNbht4vO8EG9nF2EWVILkMEr4dyBk\nvJ/D/KgFUvTsHtWrt/l2HaMcZxkQSgYDX6Dh2G8smYxnVJQVozUzsd4PwWE4\nRXQD0bioaxE+6FlyzZZ6QXmrx4Jzu2LCGwtY5mMfoSkEaYgc07SODIy3r+MJ\ncviXKzt1Vvs7RhCOaZP07apMobIEHsu+ei4Us8Dv4gcE/GQzsnRSe7BfIeZl\n8qXdl2mr02P8B6uk3gGG38VzX/d2ijZsFrOTacCgWOt34wqWHei4zj6Ac9G0\nBVlKqHtrc614ALzEOlbP+E5SUenl2IFtaTDxiU/hk0FLbjmXoh3szhmdS9cu\n486Rw83nuFXJZczbKgeCXeqljzdNAIDgF0sZspIR6U3rjq7KVi8r1zmUN91p\nQx+utZ9PI777QhANOo9cQjgCNoJ4mmyepJbcaE+dsYEGFh2zKvHsmLOW9mTV\nOhAIDJ+k2mtVp+Nb6CPUaDmhXKA/35TOErLdB2nF6v6s/kixwvNMFsbwKyZn\n/44F\r\n=K74t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fbdc53421d5701ba23a43e18a010bebd179dbae0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.1f318ff0f.0","@material/rtl":"11.0.0-canary.1f318ff0f.0","@material/base":"11.0.0-canary.1f318ff0f.0","@material/shape":"11.0.0-canary.1f318ff0f.0","@material/theme":"11.0.0-canary.1f318ff0f.0","@material/animation":"11.0.0-canary.1f318ff0f.0","@material/elevation":"11.0.0-canary.1f318ff0f.0","@material/typography":"11.0.0-canary.1f318ff0f.0","@material/feature-targeting":"11.0.0-canary.1f318ff0f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.1f318ff0f.0_1612569960018_0.8239159374731828","host":"s3://npm-registry-packages"}},"11.0.0-canary.ab12cf7a3.0":{"name":"@material/tooltip","version":"11.0.0-canary.ab12cf7a3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.ab12cf7a3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c54beafdf74e06a233f6fb0c969981da0ebc8df6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.ab12cf7a3.0.tgz","fileCount":38,"integrity":"sha512-CU7DWILiSskRBpHrb+vQqdldbeM6DwMceyHZc/2nDUK1sVnpkd4YGS+yoAJkgkp2RP2LVB1pQVvgtMnYnlq4lw==","signatures":[{"sig":"MEQCIC93bP6pcVSGWCwnqGshDNxa/sakKUrBV5nPOZEFBxBbAiBjx3zdimSuogrvHP8b7bctooRmGNq7DSnNN3BrO9WBwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":593561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIVMOCRA9TVsSAnZWagAAR58P/1hTygj9Nj/I/uCeizas\naEiWDgowF98qnQ41duVGEUO6rjD2NBPp+aYrqvjcO1uANznRZGJ3TIessWgi\n99fY3Z03DW5ToD5anQTwaalFqd1t7Q10OcBN6e+S5nJ4RbXtjg3H2fcMXjsA\n2uLaaiQCzmZ3EWYO9fh7d4COQ1b+XmfPMMoApdrl+BX1whIzwO7DvLqH3N7k\nJpLXHBR6YmnGMOYx77ouWKlqL3erdlZf6O3M8N0d54ah9J5+CgRRNKGpBDUh\nymK7p2+OHiMrOsSzq8WMSFigKCtxe9dz4MojZgBgAXt9tisGr0YNV83J4Of5\n+71MpNNVSuywigFUCgGbYRcKDs68BxwBdewPyMYd7/Hk8MtkM3vcYZOm5V79\ntMPhGvDtvVAN1cbOzyT9wvGTYhsSNFhyO6kNisHIZgtCIbi9+cu5bPzHgrYj\n7wKqy3Occ3TA4qFxr4lDvm/ixiE1Qv7cLrhJDnd+rTt7PuORQEmoBbb7TS8W\nEcNjb6dEEX7/zxpZD1RBuE1ppphp5cJmhCaNry1ukSMRdokDLLLJ9BE90pTb\nU17I/Z1VcP7mZHSCAIvlUlnED/3exsscHj8DmGq5shpChwkeqkPLMfLeHmN+\nip77g84EEKG9pofYjGwx7XEK9R9jITJHFQQLWBDPZ3DTGn3zI9iLpGcCfyUL\np6R6\r\n=T2qX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b1cf52745607ed664e2dca58a230a3b3849aa273","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.ab12cf7a3.0","@material/rtl":"11.0.0-canary.ab12cf7a3.0","@material/base":"11.0.0-canary.ab12cf7a3.0","@material/shape":"11.0.0-canary.ab12cf7a3.0","@material/theme":"11.0.0-canary.ab12cf7a3.0","@material/animation":"11.0.0-canary.ab12cf7a3.0","@material/elevation":"11.0.0-canary.ab12cf7a3.0","@material/typography":"11.0.0-canary.ab12cf7a3.0","@material/feature-targeting":"11.0.0-canary.ab12cf7a3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.ab12cf7a3.0_1612796685869_0.40459955972011086","host":"s3://npm-registry-packages"}},"11.0.0-canary.98db2c5ec.0":{"name":"@material/tooltip","version":"11.0.0-canary.98db2c5ec.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.98db2c5ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ba34e9581c0a827a9169c7e45ed9f0fffc049095","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.98db2c5ec.0.tgz","fileCount":38,"integrity":"sha512-e+SdnHUzO+hs1xOEMKvYVxf25OrJ3/HCDVIsbbOAkG1CHGU09tUz8SwsY/DOhMs6FD5P/CG97w+Sy1L+/un62w==","signatures":[{"sig":"MEUCIQDiFdEx9mUSmP/aZoIZQuQ9cctKwPBKsG5VwCTCRLNj/QIgUnLm7fmJVBVdlLfRpTisB0DtTJRZ1eh2o768hjameNI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":593598,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIVpZCRA9TVsSAnZWagAA10UQAINFo6DMHTK5P1GkE2Gr\nxtWs58jULi8kLkF1bG9ZPkU/yNMUaVtpSZjnXNuBuru2ZtpM7BYFLJYHVcwz\nnPFbOIhYm4Wyc/NVzQojIgIDsrnZZcFJGa2XRHVP8whzHUb+ISexYsPWfCKw\ngO+oCrkfKwv/uIXg+m4NQvVZhg8WJ3CT95OUNSA0b7f7O9OyYG8rDsTX7/Qt\npscSWCRceis0FO5FUk/EpKtlug/Q/zmHfY7U3x0bIs/7RFgT3+Df/JsY3IJY\n+hFGv0xNJHIIVBnl2xpTOZeKyEAuHkzpDd4hQTFzetPPjVYIjTAVlLF07DeX\nSCb2ZTq1p4tgQoTg5yJFRPQCcR4VH3MBcFXrxk3MRSln0CcWOYtlxqKW0tq7\nhuViRl2UBaD969n5jd6F/BBxqP0ns/PhjiTBFqxlwEkOIckLOw8aacTw6ILo\nKJ8CxcurH04KHv45JKC7aoQH5eQgVGf2vU8MlvpcpZdoYRAuAcjuYEfpMzhX\nhxXJQRjiUAnzYnslQkjY0wDZgVUI4Xfjf2JigYHhFPhFTLl5XtaRO+/Kb6Wb\npZLv6fPmXcHYIgP5SoHl9LlfqX7KJ4f7sVO+5AwloSBxNwuN1Ivm1Uqc+kio\nTMEohbTh2SZ8xrt6btbVFRWPoujeeLvK3WHmNLG7ZkiEYDSQ4WLzmXfq2VhM\n0578\r\n=S6Vz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"cc1b9da2cd7b871fe0f5c8370793e0ad9b1a5f1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.98db2c5ec.0","@material/rtl":"11.0.0-canary.98db2c5ec.0","@material/base":"11.0.0-canary.98db2c5ec.0","@material/shape":"11.0.0-canary.98db2c5ec.0","@material/theme":"11.0.0-canary.98db2c5ec.0","@material/animation":"11.0.0-canary.98db2c5ec.0","@material/elevation":"11.0.0-canary.98db2c5ec.0","@material/typography":"11.0.0-canary.98db2c5ec.0","@material/feature-targeting":"11.0.0-canary.98db2c5ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.98db2c5ec.0_1612798553148_0.9385614092832992","host":"s3://npm-registry-packages"}},"11.0.0-canary.1f86b9f6d.0":{"name":"@material/tooltip","version":"11.0.0-canary.1f86b9f6d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.1f86b9f6d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"25a48db6339df44d7bcae84dadea2369114a40c2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.1f86b9f6d.0.tgz","fileCount":38,"integrity":"sha512-yBvA9MfnplcxLJbkaK+OzEE5M4CHMHwzcGaVmmLvEEEsr5gq4fakbvvDCNfLZp5ebU2pE+54XBvUdZMfAxuIKA==","signatures":[{"sig":"MEQCIDayeyACipF+wRZZ9FrO4pxblGxeIxthKeaRxqPGfWGwAiAPI1NLUugHffLSqjMDvxljoDEFw2YS8KFK9Qyvu2dbKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":594634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIXJrCRA9TVsSAnZWagAAalEQAIUeBodYe3DEpQvOthco\nrobRux6IEkK4ZU8pnP/bnDR9SfnskP4O+tSYtlQbOXC0uRiPzVDoXJgZpkyk\nxOAlwIqmrtCFbZQkzMMHhin23TJaSJFmRLHi/6AOD4Ki5Dr3IzE1vIWbaitN\nC3JQfcuAILBpoGJa+jt7fZW1IeeqF3m87OY+Dl/hJ7sYkp3mV7ZXo6iea0Fb\nBWACy3GTh9cWIcTuz7zF4PD/9FOiCqJ/pjzL+cW18uWfSe9cdh3ZD/9kXFGQ\naF9tlzPPzo0pWIYAnKEEoFY0BKI4fWF62Y7FTQeFZSaNuRSrqwoOksPbqp9L\nIXIwcL8SbIZmbdobT/Zg4qYXWGG5kcrLR1ANI/K8N9k64IWu5izBQQi9YmrC\nxYsrAcJLs0b0zKcY97W/HwZtx5fVDJRuCJ8cFcoKMLS5jwZaCFIDRTlXcfFA\nCDzxA/RdqdzyUggQ1uEA3HtIC+NGbz08Tu2mjpHdncGjGPcns94unVqEPLIy\n24XPSUB7bseHsyJzyMzk6G7Q8w+XkKC1wv7o79jJv/hbxktrH13QYKckOMdK\nfaFFJE+/fVqV6zxBwIiQgTevdaujeDwub2MJE5jMH9zW2DCKXDBwr/rgxaot\n4BruSeEZ+qX1vT5qSaRtLX+UUolm+Epa9H8l8pIlVMR0D9+7w4HL6o/EXM3s\n7Tnk\r\n=qvOm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"aff88a7d3786743558ecb0dabd92c225698d2b93","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.1f86b9f6d.0","@material/rtl":"11.0.0-canary.1f86b9f6d.0","@material/base":"11.0.0-canary.1f86b9f6d.0","@material/shape":"11.0.0-canary.1f86b9f6d.0","@material/theme":"11.0.0-canary.1f86b9f6d.0","@material/animation":"11.0.0-canary.1f86b9f6d.0","@material/elevation":"11.0.0-canary.1f86b9f6d.0","@material/typography":"11.0.0-canary.1f86b9f6d.0","@material/feature-targeting":"11.0.0-canary.1f86b9f6d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.1f86b9f6d.0_1612804715416_0.12798390356489464","host":"s3://npm-registry-packages"}},"11.0.0-canary.aac8f5d9a.0":{"name":"@material/tooltip","version":"11.0.0-canary.aac8f5d9a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.aac8f5d9a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e55e3e838eea6f9adee3629be81b58c923ece50f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.aac8f5d9a.0.tgz","fileCount":38,"integrity":"sha512-iM4bBVzWQEggx/YaPtcGrbtZhtVibgrPZ3wFepbvv6SrAcDVwekjOZ12nNaak2zxFarXR0VcLicD23nkXHXTvw==","signatures":[{"sig":"MEUCIEff6o8/o4OboEWHMuNpprJHlNw1jme19t9Uo+YI+JQkAiEA6ec/xC0rCwichqgHwpA7xBqKmhFt4Q+iA/5hNhwMMh8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIXx+CRA9TVsSAnZWagAA1aMP+QF7toPfVO4L90s9TDN2\nynI9ou2XndbBzjuOkisoWfBW6LZu4veYUTSYj93R+d7ncAuowK1IhN775WOv\nkPf5Y5X2aBEtDaUPrkKdynPzYu5vqt1eQFeVWL6dQUhGXlv0CFg3uBi992t4\nFCKpwch4aAjoUMxAYKHmGlD1rk7Rom0sEQKcgd3PQciQA4JAf/rekxAv+Ghv\nMN9KIw1i1KT1qcFpLuAUS/FL1tLRzCKTCUO6oIHOnuIKhFH2cvMLq4zuD+Aa\nTZOUf+MYD+MJZPjtff1v0HM2bFiqR198C/k72vp4BotBeJAiy+FmEzOnk/mj\nSLeNd9LD06X1bz3JXShAMyi4X3cwrDjB/d2FswlW8eknhDpQrHu5IqJIo/OZ\nzAp48wOVRrr9P/cRgju3pbWS4XIjJk2VhuRVgv2ZtE5JQjGEXXZ7sMfIt+Ny\nfn99LII2/REvvX76ftj2M75rXIbq3X1kXShdaayTwksfyxIopgM1n1Au3KPy\ni66pI93qrMlQtkxF6JDjVRFe8EpmYay42kcaK0JoqAq9r5SV785FMgmQEPAJ\nnfaOeDJfSMFXa3ayYv5RQiprzCt/lvdsMlCnv4temHX9sdvWCLGPL7LRNWGD\nEhpNm1yPhkZZ8TkPWpxKHgmNlnx/NGap13Leb/GMnvSjUQRuN5KXIOObihfW\npnOF\r\n=7Nbz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5accfac22392cfbc1035dcad920093851b33cc79","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.aac8f5d9a.0","@material/rtl":"11.0.0-canary.aac8f5d9a.0","@material/base":"11.0.0-canary.aac8f5d9a.0","@material/shape":"11.0.0-canary.aac8f5d9a.0","@material/theme":"11.0.0-canary.aac8f5d9a.0","@material/animation":"11.0.0-canary.aac8f5d9a.0","@material/elevation":"11.0.0-canary.aac8f5d9a.0","@material/typography":"11.0.0-canary.aac8f5d9a.0","@material/feature-targeting":"11.0.0-canary.aac8f5d9a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.aac8f5d9a.0_1612807293634_0.12108293767162137","host":"s3://npm-registry-packages"}},"11.0.0-canary.750e18fc7.0":{"name":"@material/tooltip","version":"11.0.0-canary.750e18fc7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.750e18fc7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fb71994185eeabd7d06167853e1cef34c8f85c43","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.750e18fc7.0.tgz","fileCount":38,"integrity":"sha512-DLaRT+CRrMNBKv21rVqukVEL6Ppib18V/ZY/AUZFRfVnJ+rnq7w5OAP0nu2Y7n+eGgJv0kl7AjYnXUFZVfcNjQ==","signatures":[{"sig":"MEUCIQCv0qnZA2ruI/f61ayF4Ka9O4KuCF4sIOIS8SugPmhRRAIgP1TPBkvggch1JOCUHvrAc7V9xJqS0RI3o40GjJatb70=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIbA/CRA9TVsSAnZWagAARW4P/3efq+7kZODsfcZudWh/\nYJNH28yQUyovl506p/NPg5MRp7i1NQFpAGZBr+2pcLeve0dZrNCl5fy8DNI6\n3kT6SEldTrzrYX4cpioryDVAbZm/Zj0Cwqr6VrgsIH4PDlzVFfgVEHxKyGG4\n6LqPC+0pb9YCVNWQX8++9nQP+Qdjm6HIrHaQcRrK20ZPjHidP/SsX8FS8agW\nVE+8ETuxDOFC2I+TPmeiqDjt8449hqBOnIPrznL6s0piuu7LfbyyR0/EmZVI\nRX9Xl3A8tbF75V7idxfM2mib5Ye1JzNiV0e3J9kQh6wKUOtOalbTX2O+YhiM\nqFELVGrQfUj+VoU4bU/dgsHmrcdAPrsCd43mQvJHP0NehoOBIJzIDghFGXZb\nuQ7vtqml/HWAQMZko2psXf8uNt0q2F1JhI25xTKHMHwrvGGKectuNoGWuj7W\nN1VVuUtEzvQZnglXH2WDlW64qxJ8sc4n3SPJmro1JUCSTBCWG8rScxMrXTjZ\n/sVkqX12pbea6eE2HlUBaDKrOPxso3VBOdpoX5zGCrF3f+bjkNu6ijS823bu\nrmDtbLU+kaczV7PCgVCMfkdr8wUkOzekcYBE+KEbf35ROnRZXVl8uG02+blw\n9T8dixKsDMOGtbQNdsDuNA1RboNqP8K6Zn1Bvu1/XVNWwfRDj7zAMclO7JYO\nYE4F\r\n=/Y6j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1bab3bfc895c50d4159c7b24b69d3ab3a7eb9e72","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.750e18fc7.0","@material/rtl":"11.0.0-canary.750e18fc7.0","@material/base":"11.0.0-canary.750e18fc7.0","@material/shape":"11.0.0-canary.750e18fc7.0","@material/theme":"11.0.0-canary.750e18fc7.0","@material/animation":"11.0.0-canary.750e18fc7.0","@material/elevation":"11.0.0-canary.750e18fc7.0","@material/typography":"11.0.0-canary.750e18fc7.0","@material/feature-targeting":"11.0.0-canary.750e18fc7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.750e18fc7.0_1612820543162_0.9993743922692342","host":"s3://npm-registry-packages"}},"11.0.0-canary.b62b1266d.0":{"name":"@material/tooltip","version":"11.0.0-canary.b62b1266d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.b62b1266d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8cf901851bcf3317431b002e3a104e44fe587740","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.b62b1266d.0.tgz","fileCount":38,"integrity":"sha512-XkX/FekAUS+Yz+Oqi2IV6kEXzUIEKfIGOf6+hfQKUXbtvkE+iWPmf6QXOhb9t5AHzWYJowsFQcpdyiZZQgsr4A==","signatures":[{"sig":"MEUCIQDTAkUPWWtpo8hDYNus0s1lpspAoSTpLf7GNZ91aVvuMwIgalix64CdpIRA1Rk/2wEghnOi2ziJM8JEZNlvtYxq934=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIwRuCRA9TVsSAnZWagAAgD8P+waK3UnymA7J/km8YnQ5\nxuM2mr2fbysjk22X9tVHomvijbWXdBn7cV+hL3m/ySkP6AYYM907LF60D4Dw\nMHSFnb382E31/pX4GxhKz8UhOAVK92o6Av31sZlB8MW7HHkK+uTjnqmGT6yr\n+UCjWttjNEfHECWthdWtPp80oKJB/7LPwzozAG2adorQG9hmFdQnpKpIi0wU\nBNoPCtsoLY5/fkbRVKxjSA7Ht1IuP1Vr3fHmpfAUXx8abJvxlk3Ow2QK/aTF\nnry4r4/DOYR9LJAHXOdjiESPBeOf5ViN5akaMixWMHLeIBuedKQnjU55BJC6\nll+2JLmNpIuesBIL4OSepRauODiqhgawJZaUMxX3ns2Cg4F/ptwpmL5clmsz\nq+YjSpTLyj2XMeq3oNL5OOwAIXHCoUsnPRqxvaYiK+rgtFYfUm4gie8XbRBz\neGGoVvFMFNMznSzghdqR9YAPkAAOLIjDtHF60qCG6cnZwuraHf3Jb1Oc+woG\n227QyvOENhw+nvY4LAG+4MSRpfv9qNyJi/JhATcBmgHc3xc4opn11a/r7oWw\nFltpRQFGerjaRJDKlkPIMcfkcj3wVXrlZxJRG9+7cSMQp0tBH3pw5yrMfHKK\nhxVt2056W9py8JD/XYOMYgS9ih6Pwx8OXhYVHrcpMtFTOF8qF8pKRvBs3Di+\nMO9b\r\n=sPnD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2369de5a28b7ff8c15bb5f1b2ba96320e8a9126d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.b62b1266d.0","@material/rtl":"11.0.0-canary.b62b1266d.0","@material/base":"11.0.0-canary.b62b1266d.0","@material/shape":"11.0.0-canary.b62b1266d.0","@material/theme":"11.0.0-canary.b62b1266d.0","@material/animation":"11.0.0-canary.b62b1266d.0","@material/elevation":"11.0.0-canary.b62b1266d.0","@material/typography":"11.0.0-canary.b62b1266d.0","@material/feature-targeting":"11.0.0-canary.b62b1266d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.b62b1266d.0_1612907629979_0.5485979872448821","host":"s3://npm-registry-packages"}},"11.0.0-canary.a6b3101fb.0":{"name":"@material/tooltip","version":"11.0.0-canary.a6b3101fb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.a6b3101fb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"60a773a41ba8d7bf044636c004d9ba9942ff305d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.a6b3101fb.0.tgz","fileCount":38,"integrity":"sha512-xUs5CeqyXqlTn6ttEE+MGCmaaIwHNygyAQOwi6MzAkOMnhDYFORMvAELMMQjwIQcUsi9/dGzTwROcOnQdOI9XA==","signatures":[{"sig":"MEQCIDHXmdLqpeheFWm3FFdUMCvwtikggEveq/DacxTprMXPAiAmhzU92zsjv9T54cD2NV2M+6iog6u5oSZSqWIOdjx7KQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJbstCRA9TVsSAnZWagAAPBgP/izhuP3hPSy9BZz7RH17\nFHTaBYshqtimsM+51G3zYhRS+ikc2O3gosfXVGOiyeztVgk+XgqdrglhX4m3\n35PnlDbHoUxyMLofhMOemlCejnlMjbH5VU8I0cvwIKBJ0SmoHl7TRFELAUap\n56g3l7pkE131DvKgRf9jiC5y+JQtLf2fwn1VLa7z2YFJhtwoUfnOVbdLqYYO\nxeL5mGgZsx91A0Y3/bYc8aJgeBWerG1Zs0AQC0DYCPJaRj/hAvlGEVI1KeAm\nQW/1s1JRAoL/Ld3TSpV/RrE6ELGOMeQX9r9m/AwlChCqVBAjIQTo73LSX+y0\nhogVtZgVFj7Kmyhl4zGWS4Gr7ry5gkma1C/kqie3ke13o4F6+ACjGi+jfNK9\ngtlJPHIlFLOB8GV8QpNApTqtHAj7gIgAj8PZjDbj2ylchACUK9visX+ZXmE+\nsgwR5POP2lK4gOT2DlfllprVBEGAu+XOn2Ravg9XkBY0WyHJE7/zJvQyvvWw\nrF/aJLtd0/uxr0DHd2t+MOlQnVJhA22bu+1hBaw5jMivtRN7ZBTENeYil4G5\naWqzH+tInZlGcEw57r8RFGkMZ+8ikcILw4YjvXIbu0ezvWVeTdjZskkqqSSZ\niaz0WFzTjoSRDJs9oCWjN5LgEkAQ8qJebpqzjmaVG5gwKseVfMZqyxVCqNrB\nWFan\r\n=AUA1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4e94d35f86983ae07d81d1c7893ffdfca50c2afd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.a6b3101fb.0","@material/rtl":"11.0.0-canary.a6b3101fb.0","@material/base":"11.0.0-canary.a6b3101fb.0","@material/shape":"11.0.0-canary.a6b3101fb.0","@material/theme":"11.0.0-canary.a6b3101fb.0","@material/animation":"11.0.0-canary.a6b3101fb.0","@material/elevation":"11.0.0-canary.a6b3101fb.0","@material/typography":"11.0.0-canary.a6b3101fb.0","@material/feature-targeting":"11.0.0-canary.a6b3101fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.a6b3101fb.0_1613085484621_0.2951498826490413","host":"s3://npm-registry-packages"}},"11.0.0-canary.ed88df700.0":{"name":"@material/tooltip","version":"11.0.0-canary.ed88df700.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.ed88df700.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fa7d6d5d08777fbddf0b27ea94f957512536ed85","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.ed88df700.0.tgz","fileCount":38,"integrity":"sha512-W4/1xqJSykCQT5c4w/rh6czDotENeLOvYkx3FqoVlJgznMBjQ14I8ebJSb4RUxbV35karCsEd1MNHgq09QrKNA==","signatures":[{"sig":"MEUCIC42n4hYsawS93iZktrevw6/keWhf7tj4zfDL7r/3SN0AiEA63PDVs53/D8zLHm3D+OMBYtSic/0M2TK7emEI1+IHZk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJcbiCRA9TVsSAnZWagAAM2YP/2uIlWysFveO7faABalv\nnS8hLB1/EYxxTbyjV2SQshgN0zwecl6ED/L1Giq0gmvSObEqBAL0/nkGxcjH\n6KT7PfMoI/bQ7CLikkfHNKajWg8JwjKbOt54+sMdFBfV8qta7QgBgouNKXx/\n974tT7YTB2CA5DNxGwUhTwawN9nPTwdzvb9dKG588AYwUgp666468XX7DZ4+\nBt1g8ne0TDeZ+5emvgSZRoDieWVj/oK8MKvASDv2YAN4C1TJ3r8I7rYYRdXV\nmz6iFWZ1hmy3lpcdnT1hIeaSAZmSg9gqZCGMUNXkjxv3ux+NPV4W5FzAH++a\nUoAPOe3x3TiS4kR2t0vQLjp8U19MzAbe9VU5norHUesjZQYfHSh/5AU/92ok\nHpeix5yuvJjDSClLE/2rf+Nm14dsStpwUZHuB1ReaT1d9f29DejF6ZrmBzWk\nyt0qUfGk1x1D/ihbrJE6UFm6+SlnMbZbddO+3TlBsy27bxSpM9L2NzeWnRaQ\nUVa1u/3Furbu1/qkaANQHLoXcSZmrPnNUqkljfx124N7gAL3l4UQVdozwr3e\n62Fa28Hz7Or+7hFFmFw2ctSQQmnjMd32i7VRKnHJrFeUg7/r9ojz4fBuEWOo\nKxyKL+C0MeAA6mzvNBwM0E3CyIMRTK3wH4Cvu8sDKF6PO2eocXLgCuiFqhpC\nT5fu\r\n=76BB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9ee8b051c4fdfde9d63ea193e791d71e20094867","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.ed88df700.0","@material/rtl":"11.0.0-canary.ed88df700.0","@material/base":"11.0.0-canary.ed88df700.0","@material/shape":"11.0.0-canary.ed88df700.0","@material/theme":"11.0.0-canary.ed88df700.0","@material/animation":"11.0.0-canary.ed88df700.0","@material/elevation":"11.0.0-canary.ed88df700.0","@material/typography":"11.0.0-canary.ed88df700.0","@material/feature-targeting":"11.0.0-canary.ed88df700.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.ed88df700.0_1613088481625_0.6517748322278227","host":"s3://npm-registry-packages"}},"11.0.0-canary.d30efe6b4.0":{"name":"@material/tooltip","version":"11.0.0-canary.d30efe6b4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.d30efe6b4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6d28fc25e5ccff7b7b3b2df83703acf77f45b5b2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.d30efe6b4.0.tgz","fileCount":38,"integrity":"sha512-bc0GjwCoT4avEOKnMuc4PDoPMZeMqmCXsNu9HKo/Vp+szEeBBv/dYh1xUAvAFenxIw9KDXXfGzlNNrQ8ocNLdA==","signatures":[{"sig":"MEYCIQDecT/rIa8RsMX2xvjYM7bj9zpvm2nLt6Wpa88MLCbccAIhAI/racJJ/A64OK6Csrq/R1t4w6UDIwyLktpV5zUoz9vl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJesyCRA9TVsSAnZWagAAF9QP/0vWLCf9gVPCmZm9USKw\nJqcg9uaZ8hDeA2qonGGmZS3tBom8fLXU6dR3t17UhAc1ZAThvpm9sqfocihb\nez3E2jSaw3hCQLjrYNyLps0c+jlfN7SHTZhAtoojRyKabZsKg4WOgmlyMGYy\npP62dtbkiKzDxZVxcoB37z2zmWzuXupj6+w/xe0G0Buj3GzM6eaoCkbexF7o\nh4E87J+rhShNnUAQy2wAow0hFrmktOYGAokjQOAFXnNakn/p/6a2NA2byobW\nswyh73xp26q4QAPxwGAwclZ4qvcERPpYz9BoNGRbz6sm5+xj6DYELN6gTg8P\nul+n8pn94y33jNAas8n2YE8MAPiDjAts2BiT8ysGxsKMC7jQmczOwQ9YdfFg\nhuHCoJ1zK6fIcorBlsyyG1CXTak2dcdbqNSSShK/vp6eTAsT6Nc6+SIcHRSX\nvyVq1z+ceRdt93q/Zin6OomIo6gH0DxVewXcT6ZSXFcBNNx3O9NRJAadUKd6\ngj3E3xv3py3VRvbjDQnXWvkAEE7gNF7YCJ9gAyW83tILsRHLplGOccGtup3u\nRRcM4QznkOBehfu+Vb7k1IGQNYb29dZcxtEyZUjB2/7tIlhvf6oPmS+p6Ige\nXtGGyTJ5nsef9sBLhK6+pYax3EOJhKrnxfyv2tu3TNwh5+SOX4Y9TQ7CC1u/\niBFz\r\n=045d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0d2a46d4ab9ca5088511e4e0b5cf2b261e3e644f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.d30efe6b4.0","@material/rtl":"11.0.0-canary.d30efe6b4.0","@material/base":"11.0.0-canary.d30efe6b4.0","@material/shape":"11.0.0-canary.d30efe6b4.0","@material/theme":"11.0.0-canary.d30efe6b4.0","@material/animation":"11.0.0-canary.d30efe6b4.0","@material/elevation":"11.0.0-canary.d30efe6b4.0","@material/typography":"11.0.0-canary.d30efe6b4.0","@material/feature-targeting":"11.0.0-canary.d30efe6b4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.d30efe6b4.0_1613097777940_0.16763210609701007","host":"s3://npm-registry-packages"}},"11.0.0-canary.0393bdc4b.0":{"name":"@material/tooltip","version":"11.0.0-canary.0393bdc4b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.0393bdc4b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cb9976341a03f4bd156a08d73c2d73b597abdea6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.0393bdc4b.0.tgz","fileCount":38,"integrity":"sha512-HUj/9RK7+oUronV0GxdbNaXB/dFwIsNTjOLTFRkJ2CQdalTJACR20b5i8NJN8vqF4HHWFYQQs71WXuoElZfyXg==","signatures":[{"sig":"MEUCIQCe+xXntYIW4IOtBYmrDaJS6i2+fY8dRB3UCdNwGsDQmwIgY/j3QHKlgU8ojkg9WhEAcQcSaIEaHBQoN6hURqP9DN0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":595290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJgTBCRA9TVsSAnZWagAAuAEP/0mzrPCSAqwm09DCr8K9\nd+liQ/kysAIyBUoj1v5z9/Kpvsmiubf9QlvG2sZuak5wZipJF9RvpIikhLQn\nGJ7XL58voGN8K86a/lifvYfxlS9l2nppEvBHVb+djeBn8aw869xqyJZ0HFiX\nBbSpv6uJX8S7J666P1hNWZe7jsU7iIeBCsK437+TxC7t2xVYn6S4hKsibylR\nGbLe0vALrN/r6XP77nF4HQEGMaxxZkm4aZwP8ipHS3vfviDx03QgF0X7JfPj\nUp3lquSTnG8w12hKKkL+06gUZmWWdJdc9tnq+nIgJyKt3Y0UAmqqqfyPKrVJ\nnpvyob0ODL/d8eBG2Vx/QjoUm5jXMwdUBipueczjMOW4IYnEbRtXFbE69HEy\nDVSiwZeoD+5CaLgrOUzF1xGbvDZpM6Fwu2ylL2a7iWQ9AjgaZleqWnxlS0Ka\nnLJm1q4z0V/gq2ePwV8YvI/Oq+PqZ6vhqCr87GGLjA3ILrHS6kChokYnU6qu\n1vRbqTAz3PeXzYp6HoAeB8WM5U5Y0ur23gCB/L4R1cFHlRfKbApMK4MhqiaX\nMRXw4o2wR+6HEJLZJMEtK64hMorroLl0x1KUBqhdfKN/xSPdn2khHc9R6oe9\ncg7KLMSVh8kjhnRW3ImCzM/Gz4geg0u4XwMMO4JHSj3KkuxLDnKFfMajUVDY\n5ufA\r\n=yHRF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8f241a2f549ae5b1fefdbb0c93ddadbc1e1705a6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.0393bdc4b.0","@material/rtl":"11.0.0-canary.0393bdc4b.0","@material/base":"11.0.0-canary.0393bdc4b.0","@material/shape":"11.0.0-canary.0393bdc4b.0","@material/theme":"11.0.0-canary.0393bdc4b.0","@material/animation":"11.0.0-canary.0393bdc4b.0","@material/elevation":"11.0.0-canary.0393bdc4b.0","@material/typography":"11.0.0-canary.0393bdc4b.0","@material/feature-targeting":"11.0.0-canary.0393bdc4b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.0393bdc4b.0_1613104321368_0.16069169216938883","host":"s3://npm-registry-packages"}},"11.0.0-canary.7cd26af4d.0":{"name":"@material/tooltip","version":"11.0.0-canary.7cd26af4d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.7cd26af4d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c56d7ef5ed34f08ff25791de6070a3b27915e5b9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.7cd26af4d.0.tgz","fileCount":38,"integrity":"sha512-FgI3FdS16GKemoFs3L4fvcaVL6A2tIuVq3GFqi6zK4/fYihYZt54jG2m7OjddQILKLGBFlhjOMixuosSFCg8Fg==","signatures":[{"sig":"MEYCIQDQU7MibnaxuucINmVvT7KwFArvubX+DBCjiUL82VpKFQIhAJZv39FS0bAT5DZypFBRBbYyHQROU1sWH+qUROQKQTrR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603159,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJqYgCRA9TVsSAnZWagAAj1kQAKDiH8V4lzqm/3FSSc0J\niyBTwWw+QUMzWDaVKaQ6M0C84x+BEFs2nITsPUYpBk8wk2uXgJNHKqnXHnvl\nemHqvVvZhpHuiN7yJV/7yyZ+E6V6jXA6umB09KfJB8PNcl/NySJm5m7GlSy1\nOPOLvTl/S82SB9pt1PWUkWowD4KTxVeDyVjQXQHmiJQlh0ppwWvjE+vSl7c+\nHi6Qlw4evSEszrJ0jJoKPvsayCTBGmhyKiT3u9lgteRTYQ8Fa3bzo/XTKCts\n0mKgKJd8fiiXkAuqVIA6jv+I6MGP4gKlJP1e17b8QaWpFKZmBPD04gm4Oq+C\nrmWMtrQmwKHIth4DuoAMJbeSNbWJMQ417G7gaUQQIcCT/dqKRKVCLqZuzu8s\n/U9DbsefIKo2radqwbpntqYbgclmb7KALyZSakglKb/k7v2lwc1BNTO0e1P0\nB04ygArexQS8ABvbcqa0QYqldGoc7tNwquhR1izqpbX53LKT9zEEgxswvw1a\nq+VEfkgvHcnACG+ZC+IQrbE3CnO8R9sK4SD8TOTquYNDAWumgC4e+oix1MS2\n3tq9XDY3SVxtlLR4q4p3P1xKFia036TEibkCQoXXc7BpWKvYNe6o+13858jM\nfUOqACUW7O1IPk6EV8MQB+2zzXHHC31rFLxNqeOh1MJEJqIg7NKARzV7S1po\nNHZL\r\n=TJVl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"da78e237011a9e38abc623fed26601ad22a7426d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.7cd26af4d.0","@material/rtl":"11.0.0-canary.7cd26af4d.0","@material/base":"11.0.0-canary.7cd26af4d.0","@material/shape":"11.0.0-canary.7cd26af4d.0","@material/theme":"11.0.0-canary.7cd26af4d.0","@material/animation":"11.0.0-canary.7cd26af4d.0","@material/elevation":"11.0.0-canary.7cd26af4d.0","@material/typography":"11.0.0-canary.7cd26af4d.0","@material/feature-targeting":"11.0.0-canary.7cd26af4d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.7cd26af4d.0_1613145631855_0.3807452339425297","host":"s3://npm-registry-packages"}},"11.0.0-canary.71fe9a067.0":{"name":"@material/tooltip","version":"11.0.0-canary.71fe9a067.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.71fe9a067.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ad90ff9ae564975f2ebb85e5fe292d7b8118c682","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.71fe9a067.0.tgz","fileCount":38,"integrity":"sha512-DFOu+z4GD8JkUX3qjpmmBHnkecLj+ldK4Xh3N35bqOCE0KVo4AzEHpXqb43ElTcQJIc5vo4Doo/KM9q+BmfWvA==","signatures":[{"sig":"MEUCIQC6ajfsgD+UGoQGy8g6T+SiAn3hqScCgjtDu905Io84rQIgKVEzbs8/Z/nwVPj1/LsHQ4myaEKFeG1M9iekBIfiWaY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603159,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJq19CRA9TVsSAnZWagAAtA8QAIwDux3R0n0VIyHGCTP7\n34mqX30c5+ylkOoHrQ38QLsg6xv2omztMHNVYGklb279ELNaDR3PRDjDSxns\ndFexG0Ch9h++6/zlTWu7ORPXALuisUCW1jgEjWjKNST8VfTSEpLmR/fsXu7I\nj150aO6Ey/PvK6uwrxhCgzTfM9JPZ5Gsc7Lwhccw/8Jd6UblpLFpuPAfQCUX\nE5nbN8mK7nN2Mn/rWnLdvGZTY7ouF9C3eoVLwoc24WuTIZEomSwbI0vuod7u\ng8JRrouU75NgBRu98qJdKktwXsI+QG7ERcZVacNT2nouWEuGpM4iY1Sc8svI\n0oOeFWkqIgjMvFnHKxEJFE9FVFdPe/JqJ5vFs7lr4+gRCsNayucV/ag4T24S\nH0OLrG6WEW+p9xxZ1Ggz72/MJUy1AqeRktizBlzcmLkBfV6rfDIueXxufzPB\njK1H19aeGP2WXXAWcUexeVZcrcPvR5x7KoP4F94OQC1kRpiZ39Xc5RKDDu3d\nlksAlaPw3zoqme48zjf09aeZTnoxJDvqwxK2K//JqXB39EvMZQppoUb09wVS\nTpeU4STo4+kdcIZnYb8S0zvx8ybgYy83eTihSP6erqblfPleEBOLBNlOZ2Qr\nTc7se2iNcFDu4xgkpFJYswQQgPHRrjlzKDK/QbK3lK+DGitM6DQ+TJGPf4dm\nrS6W\r\n=1T2Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c79890da6d0bcf08c3d7c57e31df805b50394019","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.71fe9a067.0","@material/rtl":"11.0.0-canary.71fe9a067.0","@material/base":"11.0.0-canary.71fe9a067.0","@material/shape":"11.0.0-canary.71fe9a067.0","@material/theme":"11.0.0-canary.71fe9a067.0","@material/animation":"11.0.0-canary.71fe9a067.0","@material/elevation":"11.0.0-canary.71fe9a067.0","@material/typography":"11.0.0-canary.71fe9a067.0","@material/feature-targeting":"11.0.0-canary.71fe9a067.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.71fe9a067.0_1613147517194_0.2514211202479497","host":"s3://npm-registry-packages"}},"11.0.0-canary.0fd56a86b.0":{"name":"@material/tooltip","version":"11.0.0-canary.0fd56a86b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.0fd56a86b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0004456df174512cf04eae87b6df1438ebbc094f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.0fd56a86b.0.tgz","fileCount":38,"integrity":"sha512-Lwi3CVrJQvops37zMYBxJjAXpotLL2Fr/CYii4WNvfpAhddRcXVGyobin/ZeNp6PGmOBAqEOMFCw6QpwBk/ZOQ==","signatures":[{"sig":"MEUCIFsx0UlHTYvAtBQC298uY4rbdmDIrXCfkjOJ2OdrcQcXAiEAg5dEEAsR270WfkPyGI9A4MSCkDin/gp+xXIu9P3oxeA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603159,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJxmACRA9TVsSAnZWagAAWo0P/2Vn6Oovqqudw2bmR1H0\nFbGwe4uFUxmuZJ2U5MO+b0v37ryfEZX8gHxBh2TbH6BMwfjzkgs2RuKQez/h\njmeTiWQ9y5tDX5j7x7b8QXabXYUrCZProZ4dBRmLtPKoSic1JRaR6+NAwkoS\nCIInFe8wzqp6LzfppZdHGJjJIKK4hSYUUMGRa3o1Xo6DOBJP9ulCBwtATy41\nb7qHt5b+QYek11H9BCp26Q9BwyJug5UF6smqG3ZBqupx7tFHEvtFQYrecKnX\n0nG/PwxhjAgtFHfQBBnbu4/62e8PocD2yxS7yO5A/X4jzPf6Nnf3lCTe9Prd\nbULeVl67RB4eSWalvHk8bt/p0mNIje67/PhoDPLuDQ5UtyQbyCGC51XlgEpR\nT23eYIx+eCQhbc7CYbIwrxqQpvvB56O6Xm7gpjaBlVKjS4mkxyVBHcxSVW00\nnuvQ77fAjiRj/lmdyDKhs7Dcx/RwEmA3uw2q11TrXsvrhgRDfMRKgxnlAaZd\n2X9eCUR9q3PZcdW09Ln51xn+rjidW4IgvnzN6YBAkUQVWCaLTkzZeNXG0QLN\nSE2kqLGRvfZUWQx6brOCBto/WxP++2okWdsRUOo/HQIWJQLAhPrwP3OZAAdi\n8vx+AeiNLn451dhO+lScuOqNCLE1+KvvWCuvezVrD4jYOJ+A+k3VknDx3xhu\n8M8B\r\n=FNSS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b5d7e78bfa318c864343a15754f4c5ab98160ff6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.0fd56a86b.0","@material/rtl":"11.0.0-canary.0fd56a86b.0","@material/base":"11.0.0-canary.0fd56a86b.0","@material/shape":"11.0.0-canary.0fd56a86b.0","@material/theme":"11.0.0-canary.0fd56a86b.0","@material/animation":"11.0.0-canary.0fd56a86b.0","@material/elevation":"11.0.0-canary.0fd56a86b.0","@material/typography":"11.0.0-canary.0fd56a86b.0","@material/feature-targeting":"11.0.0-canary.0fd56a86b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.0fd56a86b.0_1613175168177_0.6004450176297049","host":"s3://npm-registry-packages"}},"11.0.0-canary.f19bbc4af.0":{"name":"@material/tooltip","version":"11.0.0-canary.f19bbc4af.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f19bbc4af.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"21e679f566d70b903d44c6dffc8ed45ccf914fd2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f19bbc4af.0.tgz","fileCount":38,"integrity":"sha512-gfqbG98t55RSiNuLWj9Af3Cfx25b3xqAtJR+bJ5bdUugGXmqflisdegLgxMEcMWADpArTuzIXiL0YAZj3qGX9A==","signatures":[{"sig":"MEUCIFoFKkoEZeMNZzkkoalalQjcFisO+3ki8VEyIaucOgAKAiEAlsmR/mB0aSCRPF5QUVzoQOoKzHBVIGqWVC48dRJNdSA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLER0CRA9TVsSAnZWagAAcmsP/1YfprAAxONr7Z+xHH/c\nX0gFpx6eTzETrUJfTxdKgXs/rTIvpBHT5NYMmWw60kdKlsYnAI6uJhgK93g3\nnKJFvtHZP2XS//IPvklqIL6mu1OKeL6Bxz/hEqgFSoWif5/bxa0gyFkVowdt\nGKOvZ6zRPvYVWAYhTe8a1ASfoJjNHsDGMJjV4MeYr7rop/KWj7eZ6kliKhYO\n4r301BvDooBqXsh5aPZkTzpGvOX4VVlrYUZ+5NIfQo6cUO2zosExsSN9tnEM\nit6uEK8fcs1EwHum43VVFVBHUW+yaYSy2pDaum6fn04e0XGevq5OdOu8JRxL\njYsTzVTgm0Bka2GgOo7E834uNVY7la0eIVeKnxv8cp0v/4VibhPXYJ7u0LPZ\nIut6RogdEbXknakxO2w2PBp1IYSPqx/0mmDDtUDoTHbERJ5duSm3vkyq2Jqh\nn/ga/eLoEWZd8jgn0YaEAS7Ac0rzPox845yARVlcfHOMYPAJ5nK6B8ahrzVj\nwchIfDlZFheq8gzlSnbdQiX9GJuYEbSo14AR6K51EWdwL23U3YJ32PRyToZ+\ndS5StdHaY/Wm70Qc1Lv7y6QzwfrBzr9MC6xEb03RD8dxtTLYp2COH8xQ/AOB\nA3pFNorXeHJo1F/1qx1koi1Fjpjkb4EWM9Kyc7l4xnHii8IGW4yiwacGOIh9\nDZQF\r\n=XCiK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"842729c260f5a3be9fec8618b41657a90e725af0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f19bbc4af.0","@material/rtl":"11.0.0-canary.f19bbc4af.0","@material/base":"11.0.0-canary.f19bbc4af.0","@material/shape":"11.0.0-canary.f19bbc4af.0","@material/theme":"11.0.0-canary.f19bbc4af.0","@material/animation":"11.0.0-canary.f19bbc4af.0","@material/elevation":"11.0.0-canary.f19bbc4af.0","@material/typography":"11.0.0-canary.f19bbc4af.0","@material/feature-targeting":"11.0.0-canary.f19bbc4af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f19bbc4af.0_1613513843663_0.1863597326306643","host":"s3://npm-registry-packages"}},"11.0.0-canary.f9cac96cc.0":{"name":"@material/tooltip","version":"11.0.0-canary.f9cac96cc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f9cac96cc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"745cc389e82f0f68436806cc8df9225a8439c495","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f9cac96cc.0.tgz","fileCount":38,"integrity":"sha512-N/OmZn0GxQkQmN3A0RrL+ha5izvLocV7gWoanXqcQynwCrE9wNJfKf58rjFtDbIcwrFrKGdhk+OK7P8g2rwLgw==","signatures":[{"sig":"MEUCIBsjFt7VgfPwjo/aPfyjsYP+R0xAMCvY1RLa2Vfk18aNAiEA/I9+HNBjuRSMQOp44qZpno6fLw5WhIfbD88547+KLfk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLUAZCRA9TVsSAnZWagAAtZUP/1ep02G7z6RxuwS0n0KT\nK838GeyNsmme2r3d9NBgIATglRjx+3FOFo4vg/rmXdu+sVh7Zd2EelwzSUMY\nhq6YZbD6Chw6UHTbcEevc+rhkPccBxjGA/yOdinF4yQu5TPgTRFBP1l9B8cr\nqIdXtuY67VX0c7fUNPN8I+Vf5Oo7w/AIwM+LbxJZ866t+cb2jB0odItdH6k5\ngOUeWcrbdVnlLrP7/DTYO1hwgIYjH0QtT2qM4f9VIF8GIdUEV+2Eytq0v8f2\nUCVq3PoSWHftc84IXf1KevnH3Xf9MP5Kfut8nep4mQ7Z2qPUmL4Ow4NZ1XeH\nrg9g9tkNc4lbO79AIyEBYN+tvn7Jb/KXtJNtpRES98rr/zpIX3kzR0cLBBI0\nm9rAx0PZ52mA3NQZzqBXicBhDLD403nwUTjDkIWcPKpcU/AkZPmXkpKEggzA\ndwGqHTjp1IUyi8joRxJ3k7zyOaoqxCagYLiKWFJeAZs6NIONNio82XKZd1my\niPet/dEwZv1Md3VL2uc7OOOU8InNj8/R0B0EgF+QPvCWrZ3GjtKjditUosq0\nme1DF9FCFjCb2fdn6hkSw0HMo3XXfE/Ib7+Pej223JYZNG6iIUiGNQDAV4xq\nFbVyR+7NzZM9k9UAl5CW0GcVrj+puVdGeGXUogFujlf/eSESd5fQHmV0+SMa\nFyK6\r\n=ogxG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"993e327235c8cd36a8c15095389eb149ada97cee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f9cac96cc.0","@material/rtl":"11.0.0-canary.f9cac96cc.0","@material/base":"11.0.0-canary.f9cac96cc.0","@material/shape":"11.0.0-canary.f9cac96cc.0","@material/theme":"11.0.0-canary.f9cac96cc.0","@material/animation":"11.0.0-canary.f9cac96cc.0","@material/elevation":"11.0.0-canary.f9cac96cc.0","@material/typography":"11.0.0-canary.f9cac96cc.0","@material/feature-targeting":"11.0.0-canary.f9cac96cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f9cac96cc.0_1613578265007_0.6897038674444289","host":"s3://npm-registry-packages"}},"11.0.0-canary.79ce0878b.0":{"name":"@material/tooltip","version":"11.0.0-canary.79ce0878b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.79ce0878b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3246943a8442f4239886829deccebf4a2600a11f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.79ce0878b.0.tgz","fileCount":38,"integrity":"sha512-hRcK+3QyB6DF/r1+hh+SajxtZtPwY0kWlh0xQeztkxTSN3uUQj3nsXjg9JbF5yAdm/uUl9jyVya1CI4PNyYVhw==","signatures":[{"sig":"MEUCIQCDQWbUZNKSN1iyOqkXp6xQRc0Pg4g2C7UWmmRi8FpNGwIgar2C5Z5P2ME6EbYmEpgxttBi2xc/J/drRpQropoWNaU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLW3TCRA9TVsSAnZWagAAILAP/261w+KCqVUA1DJVuV95\nErthVPqYKZ4HscGSzlTgtwrfVy14rDgrfBjQqDHQlyryHMn2YuRX0lg8uxvy\nCKFyi2LY9jG2KnRq8DTYA0V03ZTChVMq8CGlG2S4wb/WaAvH0pAD1cQylwLZ\nCHayVu0QfzlCb5R7TWar/n+h7F6GqV2t4FlEuM+4liQgmZZt3KH6q9fbbIMN\niKCb6qOH6idbfCETi9hPkCiQ2LctcDNOmmpJYMgSNWaS82v/saXbvCQ5oqTR\nHvUELbd4WBRosh5fRT/sPXK75ascT/JrbofZ1yQejHfNUuVSMJfJBneOtfxu\nMtDQUrDKJwqrMbiDGtYnInYXri51hTJIdJDH2OvgTHhnpIj+pX4hzUaTiNqs\nbTApYk0VSVP5/Bv+Ta8gvfp1WNLRpnqNpREZX5chVPCzYLQ0Bmqo2c/wW5Lj\nl6xDa2zksQhjn2nbNPKivUm2UutJZvqaeXKp+XxAYkl37AhmI12l+vWLTagv\nZYoCzYWr9dXAt+udqRQrTL57dtpBsI3Jqh+V6pg745UqOWpm4cbsl1R/Ez1W\nRkM75WjF8TrgPBWYFlFeQbFvHxoDtlzfeZjWbPquEflZ8VINPnuBYf3nlvtU\n16pbVmqXZpKndgJfoOfVW+oDp3Tva1nZO8p+lCRaAV2TEI91T5K80Vy/VrK+\n14t+\r\n=phKy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3941c218ed650b1d1767cd6b17652d4e1b5f7ac9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.79ce0878b.0","@material/rtl":"11.0.0-canary.79ce0878b.0","@material/base":"11.0.0-canary.79ce0878b.0","@material/shape":"11.0.0-canary.79ce0878b.0","@material/theme":"11.0.0-canary.79ce0878b.0","@material/animation":"11.0.0-canary.79ce0878b.0","@material/elevation":"11.0.0-canary.79ce0878b.0","@material/typography":"11.0.0-canary.79ce0878b.0","@material/feature-targeting":"11.0.0-canary.79ce0878b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.79ce0878b.0_1613589970779_0.7718989066066737","host":"s3://npm-registry-packages"}},"11.0.0-canary.d6e507b5b.0":{"name":"@material/tooltip","version":"11.0.0-canary.d6e507b5b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.d6e507b5b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ec6961c7ab11e28b9e49b35666038e0145ef257d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.d6e507b5b.0.tgz","fileCount":38,"integrity":"sha512-T6wWgOJOU2x6cK9equvDHntFirpCc+IC1SGNYxvvdV/8OHcxLwcD+4n0GUEPZnXq2gPCK/ibK3e1bo2zmPOCpQ==","signatures":[{"sig":"MEUCIQDq76jkNI0g3fDIPQWlMWYLaeTFvTcsPFS6NhDnUAM0xgIgSyXDJh0iwi3rShLp9WIHHyEoa42Xgh74BNiJn86/SD0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLXWNCRA9TVsSAnZWagAA4V8QAIUIrWyOpdRCPkAeS6vk\ngVEiBnGFeCqc4vp28fnOjFU4JOXoj7DEmRrmnnizSjnOP43XhB2vHMMP4PWE\nm9+Eeh+ckvul6RuGsRwoqTFYJ+HMfkPcBociM5xRP/NP2a/ejKsr0xSXH58S\nJj0f5ymOVTvK0XYT37++D4wNCK9wzxJluYve2Vlh4GFWGrJB0gwFzqRydCI7\nmt1+Mw0H5JQ+J5Sxw48THR87+RlF5dDRW4sM3rhhfuZdxjrgIr8RmtHgzpY5\nExo+E8EL5mJ+G8N+xKTaGkeLUYfWeqLFUOUq6txoUVcWQq5Rd+68E003cvM/\nqRAhoImczskPognirhWxzacwQ9OcWhz62Ewq4XkW2LY8Ttn0fJtL78FCmGkk\nD5xMoRKsJNsAVZiwDUhoerp4ufBBO1/sllV3PCa8qN5rWlWRxC2D9ukmo1S6\n2jMPl815owRSd4VY8TNfgtK2k/i3AosXS4z0wTKFY+E1cPJGjfQBvaQYs+R/\nCENuvjU2JNl2FBu2ldiAzduEoOJOysdhPz+UpSyjXzdMs0wRYN6JBh93KTF9\nqTxMyK1I+DBnrYv/qZnOzI4bVD+YR9OVRMwSAbSQMsYf4MrpSy24YdIoGnLZ\n+mPiNnrMzOqPiShHuURfeWIS7stH3IxwzWFQWX6tgE9MQlSv5+XtMZDk1Yi6\n/Fdj\r\n=om+I\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b20b73a4aa16995dcd0b73e46e4dc31f7914a367","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.d6e507b5b.0","@material/rtl":"11.0.0-canary.d6e507b5b.0","@material/base":"11.0.0-canary.d6e507b5b.0","@material/shape":"11.0.0-canary.d6e507b5b.0","@material/theme":"11.0.0-canary.d6e507b5b.0","@material/animation":"11.0.0-canary.d6e507b5b.0","@material/elevation":"11.0.0-canary.d6e507b5b.0","@material/typography":"11.0.0-canary.d6e507b5b.0","@material/feature-targeting":"11.0.0-canary.d6e507b5b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.d6e507b5b.0_1613591948657_0.2000680699906492","host":"s3://npm-registry-packages"}},"11.0.0-canary.f2658381b.0":{"name":"@material/tooltip","version":"11.0.0-canary.f2658381b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f2658381b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"22bd3ec84ca27297c89d3bc6f397e09cc53505a0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f2658381b.0.tgz","fileCount":38,"integrity":"sha512-5THuxrTllMdbqh6Gts1pNXaxnEsvZO3vB70dZdof0qXBaJAXw3U0MLyQSW/9to1odCw4nY9YjWSsMpRm+H4q0g==","signatures":[{"sig":"MEYCIQCWDcYpG7w0Kl4HHDr4pmnaPxmjVFZF6mu1XizEaQticgIhAPFo8e030OKNt6kv+FDRRBCZzQxX5J/4lREnDNARo3Fb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLZyhCRA9TVsSAnZWagAAUcUQAILGXz5D4vUuH/HJPxhV\nAXXZhxZgbkcdxNKFqmhv7ztF/7h84duFAXiKdi3QG0TLdZ2ooS7sWZUZH7ry\nP9S1XHozcrncuMX6s3TN0YfFoVAZLg8gSebQlLusRiews2247NDmz45ouz+a\n1UbQdhr4Fiel64G11OZ80+51PURk/3dt/2LntgmowQHJJhSl3a+HnuE4OJH/\nl/+lhTc+cBiTPfDzg9m4osHFUypERD11kEAUXiNabTSOpUxD1DMZ9PkPbPx/\n0c9B2FLMCPwyfViRhZObWWw6R3d8BuNfu3YYh4e2Y5Jv8T2Pe4i6yIFSiivG\n4QT2ptLrFAUB/jQzaJPq+u3pVi75vnSKgGnRBSlXGrnrC3zhNJn0AcbHYubN\njueFHwYWh75z5W62jL7rCqm/woqfevmNqVkSPfI7absYt7mqh1n2gJ7nKFfT\nCDUl9l+J7gFXtZpT1l7p7FMigUnH/S9F78xxPfEJMQsv8KIPY+PEHjHHJBnp\nHyU1RorKDu/cEDIFZk43Iom4Dysrwu0UPpFkKKrpzDJbMmE9cYqAA41G8obh\nTDdxRtsLOJmuTUghvGCKX1aqLvvAM0RbDzPa15ZzhR7bGbL8PDsaze/VsJTO\n8kU3C7/7TII4fBnLs0Iurbl5bcqmx4G+R0RiXAoNyTrA2LLYyO6oyq8I4AjB\nnDpL\r\n=quw4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bb1b60f60cf9b1a4184aa52e590bcb4003d3c09b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f2658381b.0","@material/rtl":"11.0.0-canary.f2658381b.0","@material/base":"11.0.0-canary.f2658381b.0","@material/shape":"11.0.0-canary.f2658381b.0","@material/theme":"11.0.0-canary.f2658381b.0","@material/animation":"11.0.0-canary.f2658381b.0","@material/elevation":"11.0.0-canary.f2658381b.0","@material/typography":"11.0.0-canary.f2658381b.0","@material/feature-targeting":"11.0.0-canary.f2658381b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f2658381b.0_1613601953079_0.5451589361158802","host":"s3://npm-registry-packages"}},"11.0.0-canary.97c4d4035.0":{"name":"@material/tooltip","version":"11.0.0-canary.97c4d4035.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.97c4d4035.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a6d1124680b4a7c25aa81c037c54173e9146de28","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.97c4d4035.0.tgz","fileCount":38,"integrity":"sha512-QB3G20KzJqKlrYqET11YsfJpjQA5p7WGhsNH8zPUD0JJ17810JvfeNsNNTV0BjKoJJmml+X/RcqGkKRhRW0WQA==","signatures":[{"sig":"MEYCIQDFyD7LMtlNdLvDrpyLrJY8DXHlAc9D/uC5X++4lrMMjwIhAJzZbtQlzadgtfa0rcjKxbaLV57Z87yL73c7dw/+K4uL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLdKTCRA9TVsSAnZWagAAaU8QAIURVznW2Ryv835ghlEc\n5LqcG7mDn/5pZ3MStTXcEgqGgvoXurKmz6fsK3MdD/FjvijsUg696Qt6TjZz\nlLVjjCJBp1zpzF3/lorVvUP0xYLsI2cd+fAFFbYab6U0EPPpZdpr0cnl3bP2\nWmYdoS78deZDw1DA9hAZV081+65AjVum5699m3ICNe7CZmSdb0+f0szRZE3i\nvQxLt8WltD30Xq5/w/aGOCtGqB0ZVuswP/OFQs+6o9lCri849oCEuykaYYCe\nPj3q77H4iGG81Ni20/ffd0WkSZxXEdN0pugtFf1z72R7oURcSHaTrTJup2Zz\nNO91w1KLhbkkvsWZCmv9VPXKbaMXKydCwGV90briIOX6DfXnS3p/hO2JVn3X\nXDQs3MO23HTFqrztZhJLPW9qt3a4RGUVc5oPKsV3XMpQJ7u8GQONR5gPamkj\n6GYWxnqAjykAb6THJ/m34ubbWIn8OgmXDI8MeaVIOQzkwgt+d6oxEioxVmSq\nkqQ6J9jCRqG2UyjVxwRHe94g80TYvvRbrD0v1AdPJrI8kLOcZMYiVgs5hSEh\nts9wgUEjeXsQ65iK7Hm9DNhhbk0Xj2yw4xMUkvCHIEpc3Iz6QiuRGXfLaG5d\nhMNnP9TnNC4S9zJJ5nFoHSnvE4njwUSamWyz+1b4jkW1L5xE67pL4YvzNWA8\nmBJN\r\n=xn5R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1d9a223ae17277dc00b76dbbc4263232d38e50c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.2","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.97c4d4035.0","@material/rtl":"11.0.0-canary.97c4d4035.0","@material/base":"11.0.0-canary.97c4d4035.0","@material/shape":"11.0.0-canary.97c4d4035.0","@material/theme":"11.0.0-canary.97c4d4035.0","@material/animation":"11.0.0-canary.97c4d4035.0","@material/elevation":"11.0.0-canary.97c4d4035.0","@material/typography":"11.0.0-canary.97c4d4035.0","@material/feature-targeting":"11.0.0-canary.97c4d4035.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.97c4d4035.0_1613615763222_0.0007285026056496058","host":"s3://npm-registry-packages"}},"11.0.0-canary.f5bb4648c.0":{"name":"@material/tooltip","version":"11.0.0-canary.f5bb4648c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f5bb4648c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ef3f751cb47f08ac12654f7d2f539fd5e43c8e8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f5bb4648c.0.tgz","fileCount":38,"integrity":"sha512-3/PvU8clqYSHbS+8PbHneN+uERR6rn2CM/kxH10pF3e6TFVGZEgnybsfjEzaTK9jpgV6COmN2wIHqurQ6o1A1g==","signatures":[{"sig":"MEUCIADayaq7kgp0egMO1gogvLxTFvIwNXlnBNi1knkRXAGJAiEA0E3Q4smZUfYfLHWlabpnjB92+/brsPhkaAdZFtwbrnk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLpCQCRA9TVsSAnZWagAAsXAQAI2GrFDxypera3j7LwdR\nC89R0iIhwHPwLR7DwNDMUfmD2EIJAIt0op/YO/1Sram6juU6/MIIVDfmWyJm\n38JiKoYoDS6J1gnA06ls5t4oMAA1jy3rRnWuxXUEwy1lp1plncL8wjvIxtr/\n8XoYXHJR1zeKh+H04QHQdpKQQZ+OGCv0JTZeodaqce0D8chGkV4hd4MNp/B/\nSbuSgFbQFJwpoSxCX1MIug4PQPHHwPJoBlWBBn/2C8ibylCmZYethyIAeQbi\n7tOaiNqlB6FuFi/7t9vHZtRr8+fPFmhM56PzAHrA2OAJgqNE1hzUrPWhjYPX\n3Jeka/JN+/UBUwa5RzRXhpWxbGvIWytHbXXendO8i/O/44khgZavEv99ij1/\nUDjceaUrV+n+dgaxUjUFLVerXCXRtkoZeXPN0x/ME67TA94JtkY534XnHBqz\n+4P9FgXI/Ff4TfTLeWvo5Y1xg/nL/GdkKbvh0V528y9vMHmc53v53Zj8NNtV\nAxLB/8RqOB6UMrE5gE+5iQXONxZqhHNsx1TAlJs3EdLB8fID9fkR90P9WjV3\nGXtS0n29k2b0wt1cN+0HIhczgSP22/SukZk8WizmBdgTqrBDWljDJUhcht/0\nye070T/z9gsBpjZi0rfRMkuL+jzM8TLtc2B9xmdr07BlHMvVmvKEcVkKbHMr\nPqsA\r\n=k7YH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3abc3c2f94ce48fd3a6cc689419e03b8f7769ce0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f5bb4648c.0","@material/rtl":"11.0.0-canary.f5bb4648c.0","@material/base":"11.0.0-canary.f5bb4648c.0","@material/shape":"11.0.0-canary.f5bb4648c.0","@material/theme":"11.0.0-canary.f5bb4648c.0","@material/animation":"11.0.0-canary.f5bb4648c.0","@material/elevation":"11.0.0-canary.f5bb4648c.0","@material/typography":"11.0.0-canary.f5bb4648c.0","@material/feature-targeting":"11.0.0-canary.f5bb4648c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f5bb4648c.0_1613664400063_0.7450778175472288","host":"s3://npm-registry-packages"}},"11.0.0-canary.302c7a960.0":{"name":"@material/tooltip","version":"11.0.0-canary.302c7a960.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.302c7a960.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"85754bede6a0c5c95642899f78354a8636798212","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.302c7a960.0.tgz","fileCount":38,"integrity":"sha512-UuHTI8XMdyk9SXLjZj7ihmXSYR4yVSKgPNyTajTYFmgx8mX4XYvTy327yJkQVufRpcvOp4XpQQa/kMcm+qJRHA==","signatures":[{"sig":"MEQCIHQaIvNt6cbT6EpHk4NVBRApM1gY0E6CVzjk4wbDE39pAiBi38w7mLd0zXkx75XrgNFoNPUC9gg2vpKSVbsSVc56EQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLrRaCRA9TVsSAnZWagAAkPQQAKP5L2j/QcsilMtIhDV6\ndSjIx1ERSJTEAO1DGuGyrXD9c+SKf34v1/kwhBAKV5nZKiB0ux4HWnYlz4zm\nSB83eTwzQ3hLICQ8LilZNVBF2uijU2ety8RVeL8PWx3LNbdtVRL3402RbxiG\ntDsYqhEp/ENqJFqqyiE+58045EedkhrPp4fVVtgLyDr7LgmnG8LFqiaMzyfk\nOaSp7iTUNWej3d5HpHxOT03MGFtCQhZaFYRLXp+LMpWZL+bYP+om0nzNNJY8\nBdDozRh3Qevq7otIwN15vZfnl4dqyYvkqG2hV9MJ5LwdMPtBIj1ERK/jrpd/\nxi2/NJ9382UU5/Op1lHUdMvUIv/TNLzU3IZ2CEO5373uR49ktl56lTnoGMrF\nKA7Cd6Ie6uQnDgKbqXfnH2EzGj/Rc2isW9GvbFG1Y36FtOWtY7dk4Qgc9voo\nVn4mb1u7juS1mFlUMMt2ouRVN0Ir5OV25Zk1DoptUiKmJVihLuJNX3tena98\nUOZvnctpaFfqQx12fyH0F27Z7dl1jjngf9EObrkYqLre1oc9+9SQVTUXCtQ0\n729nkMfn69vHyj2lSUWtl5zQ702EyT+aiyxwGXlnPzOZcEt2bChdsUi7QCCr\nrUIojJzSnn6bYbdUPrawdJOgvof7dGHa10JlMa4p+HvFkMHv1SCOUHAmxu+u\ntRcY\r\n=9xV7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b16c4cf1d0826970ff04a72b663f1838cf8c37d0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.302c7a960.0","@material/rtl":"11.0.0-canary.302c7a960.0","@material/base":"11.0.0-canary.302c7a960.0","@material/shape":"11.0.0-canary.302c7a960.0","@material/theme":"11.0.0-canary.302c7a960.0","@material/animation":"11.0.0-canary.302c7a960.0","@material/elevation":"11.0.0-canary.302c7a960.0","@material/typography":"11.0.0-canary.302c7a960.0","@material/feature-targeting":"11.0.0-canary.302c7a960.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.302c7a960.0_1613673562365_0.0010470238300219759","host":"s3://npm-registry-packages"}},"11.0.0-canary.aa0aaf026.0":{"name":"@material/tooltip","version":"11.0.0-canary.aa0aaf026.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.aa0aaf026.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a5472f2549877407f752ac9c624ab1f17641f33c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.aa0aaf026.0.tgz","fileCount":38,"integrity":"sha512-/9wbFNeh3l3u3GKhotpxloYUaVKBlTwQaZpCHmb82dnjqVCv8Se3ruFjZ6PPJdLAVrsVmxSqrMkfZe6fLyjm3w==","signatures":[{"sig":"MEYCIQDeKn70pHZZcJnmBiDJas/Wvv0DjDDvV9aDMPz0CwvlmAIhAM+Cmh/DACdceFcx2yPWsLxRBN/l03HseXLmisY5eK5I","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLr7zCRA9TVsSAnZWagAAHTYQAJZGh/IWzWLV8JOzIrr0\nEHtFXZdi2fevsphokeD4majFsz7WUg6AWCe+5OB7QmrbjuNbXsL/ACOGBk5D\nh/Y1qtb8c3q3A7SLI8VDTpR9iRmJjXbQtsmYIu1tFMBvd0kQaG24TqdDLPuz\nW3SMxK7I6Z2RFpmQUYr1F7YiJtwFUesg2s4HsbutT7MuJ+Uso7K3OpqaQ271\nhmAxtcvPPZSZdZFmSlRniFydxNyKn8xLmHFvhVmYGv5PGB6oH9WGPvGRiNbx\nFDD2tIVfUADcqvrx6RjnWK82PMlXf3SZI1yMAOUe05Kd/SnIHldDRrQX4zXA\nUqbSg2VH2OFAWMgh7Bi0EQLHp1vSTmv6rTe5gHWO2J6rBpU0POm5uOXRH9Lo\nDzVN0P5LaWE9MgFK4oNHoUkdhxACHGnRqx+B+RxtuKf/Je/c6BRdnVosEkjz\n7gFA6wFq26OrE3K7JC9Z5F198bT+hdU8nfo3qf3SaYlfJtTmdi8WSNjTpPZy\nNAuaY3Bm9jniS4jT19s5CRl4qYFgnBAw7zuBPC2rcCv6u5p7SJ+bK0yYJCyH\nURE7L25c+pt7XIFX+Iba+pQIigPYSx5+gr537UKHJBIO1eysPfjYNjSecaCK\n4Fjl4QtBDNXZCkwQwemb5npzObTc8pCp2sUl99457s4u2oOgYSt/iD/beQz8\n64z0\r\n=kddK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"de542de1d7c4c8f5f51199fe207ef527fc1265fe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.aa0aaf026.0","@material/rtl":"11.0.0-canary.aa0aaf026.0","@material/base":"11.0.0-canary.aa0aaf026.0","@material/shape":"11.0.0-canary.aa0aaf026.0","@material/theme":"11.0.0-canary.aa0aaf026.0","@material/animation":"11.0.0-canary.aa0aaf026.0","@material/elevation":"11.0.0-canary.aa0aaf026.0","@material/typography":"11.0.0-canary.aa0aaf026.0","@material/feature-targeting":"11.0.0-canary.aa0aaf026.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.aa0aaf026.0_1613676275002_0.6436834018569315","host":"s3://npm-registry-packages"}},"11.0.0-canary.07ff0c452.0":{"name":"@material/tooltip","version":"11.0.0-canary.07ff0c452.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.07ff0c452.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7fdadd67d9959c215f7a41642ad92d528bfc1a6d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.07ff0c452.0.tgz","fileCount":38,"integrity":"sha512-uZLDom5DLknNSpYZyTnjfTKNcKBlNLUvCAfhiHgNNPW9Ui+QzRFntgbMqQcWKUeJec6w9tJBBXXF6ycy0zGNUw==","signatures":[{"sig":"MEUCIFjoknIUB7rHE8MrUBjNZwqykp0Xo6C17BPVJKrPry/XAiEAmhID0b+l+8A8w6PIqtZmsBBT+K6ieIThcWvMRexMC78=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":607060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLsNxCRA9TVsSAnZWagAAuIwQAKRXW2IBlD2sohXw1JHG\nJ5ZKptTOUi+IWYv69z3fpW78xEGXD6PrpVObZZjes/OtzMsRBSvCu7kei9i+\nYAgNEnZ25k6wUbp1OeEgPbT2GmsExH0an3m39a5QlrPLNgZvUyhD2o88A0yT\ngOdkncFp8P67vTAiTD5rD2fz710enMMBUBmm/rlLTQYb3Mxg357Sz16tLSFk\n02I87UeZ9ou8fz/FAwPk969/YULuwYXVCrAR0/354DyOMmfd7WRnhsDCCbCt\n7eipsAptX7XnjI9/kDhtU64dlbhPJ63WXz2xMBOq9xoByuIe86vcIq2OkCSR\nRSN8ooNBKbuKTe7c2YQpvRnvS7J8IzDUH1gZlnj/mbLt1xSMz5Un1XfS+DC5\nMbMTbK0KQsTj1DDOFF50c4FYvk5+dMjHUz7XNY+oT4nIucFBaof2GVtRleRg\nu2bQDNx/v71d/9So2hv0VItXRSu75c0S1MKA1gVoeDDCIsslkkwj1g+VvxPp\nUz0FZY2aheAwMOP6W1O753olsYHrO1zsEnm+NMs7mSxhAYMQ2e1OZucfFMrq\nnxg1pcgqzSHj6r1hCARvfBzWoOjnorWDQJZh0Dx2hSd1aAJX90R8vOwMWz/F\nhCqxSbPgGK0+2zWLbpPWZMdQLHjFKQcIr43uhV1D2Yr7Vapcd4NZSHXkhLKq\no++H\r\n=RcmT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"52e3f1cc8fd4568a48ba4314f982d5613f53ef5b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.07ff0c452.0","@material/rtl":"11.0.0-canary.07ff0c452.0","@material/base":"11.0.0-canary.07ff0c452.0","@material/shape":"11.0.0-canary.07ff0c452.0","@material/theme":"11.0.0-canary.07ff0c452.0","@material/animation":"11.0.0-canary.07ff0c452.0","@material/elevation":"11.0.0-canary.07ff0c452.0","@material/typography":"11.0.0-canary.07ff0c452.0","@material/feature-targeting":"11.0.0-canary.07ff0c452.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.07ff0c452.0_1613677413661_0.17773773579650487","host":"s3://npm-registry-packages"}},"11.0.0-canary.bed7ecd3e.0":{"name":"@material/tooltip","version":"11.0.0-canary.bed7ecd3e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.bed7ecd3e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b0256ef7de9677a47c9fa5696b47776455e1a10","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.bed7ecd3e.0.tgz","fileCount":38,"integrity":"sha512-ALBEkksF2PJ88UDS+A3h+0FF7cquLObMZWvc3g5uuTguysfyPLGJj+xuGJW2tj/j/DtRKO7/iM/Gij3yLL8pnQ==","signatures":[{"sig":"MEUCIBiukkdYZWU8JvRmjXSDbOm+DrOFIwXv7DCrsXRdUf1WAiEA9TRe3jlYqgO/z0Pj072nMBdYDPo/2EU9XZSLulM+CRA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":607060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLvgnCRA9TVsSAnZWagAAl/0P/2dVqlPWWmK7pgbUPmdp\nFffJmw+UpwWEffIoZSkO+vwa52WGgln15iwei/Hw1Ov48sp2/QttFQj8nZ2v\nHEM4spef9G9momiYHNUzun8Eu+sODL8JNwyKYLZfnd29kC7aEzGYF2m2lGD5\nKKh0vevlQbnvwI/jdMu6Ud1wq3lgDa3TXu2ch3OYblhU1olyPGUS5/T4Yeip\n+If51IcN2X7Uvyv/egWODUHTyLx6ZhIBSA1cB0LvbnBLsp/XqHIm5ifGP6we\n09nMsWe/H+xXeWHDaDar+PTbQDZMVWhCdiNeWM/A699JQQV8pw63efFtny3J\nVpCtqFSc0jA+oErikTVkK/7GJQuEM8qGCPCKsn7i21fcBytXP+xw0vWgkSQ3\nGPJZZnXg3PtiT8u3vWnlXkMXBjfXNgU0sUwNcvmVQQ2fN5PdkbxPDy5n40vU\nOpfqpOnAN6i5y3Bay8PhFTdhQGSWVs4HsXEcayHCZ75RiQvgByZAeTm7Eh7J\n1PbCTOWGbCkvSyhWk5uaFHT0aSmvgU3/41O/mdNaOwJ+4AOi8TyeTXb3WcUx\nbe/YdAyB8WMcctZHsmKK+zi0LoI5cB68fP8XXk0OMw3opBG/Q9OaayeanKGv\nfg1arJ9tIGXuc3ciRvYA95uKsyD7eSM/tUTz7C1Iz9IhuwtZFDQZpdHl7oyK\nSZ3T\r\n=A66d\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c23b9ab547a5ebb36a108742217a017fed1886a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.bed7ecd3e.0","@material/rtl":"11.0.0-canary.bed7ecd3e.0","@material/base":"11.0.0-canary.bed7ecd3e.0","@material/shape":"11.0.0-canary.bed7ecd3e.0","@material/theme":"11.0.0-canary.bed7ecd3e.0","@material/animation":"11.0.0-canary.bed7ecd3e.0","@material/elevation":"11.0.0-canary.bed7ecd3e.0","@material/typography":"11.0.0-canary.bed7ecd3e.0","@material/feature-targeting":"11.0.0-canary.bed7ecd3e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.bed7ecd3e.0_1613690918706_0.7228349497963451","host":"s3://npm-registry-packages"}},"11.0.0-canary.06dead2d6.0":{"name":"@material/tooltip","version":"11.0.0-canary.06dead2d6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.06dead2d6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3b564ee479519df2e1236db70a33d25355e01ed1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.06dead2d6.0.tgz","fileCount":38,"integrity":"sha512-/hbRpjJJr4ERwGrgAF0QxwSJuEB7CVsRyePxE5qwhupExUZ5IE1OVs7cHVbKRMeh3HiyX2CZDt++aTaw+poz1A==","signatures":[{"sig":"MEYCIQDnsM6TyAF8xF83s53VagxWuEgvtKtSU4cJRoe2xMxXEAIhAJeKPcJ28m+b7EdGTI3a5sPkH7AqxqAZ7XX13kVJgAQN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":607060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLwhvCRA9TVsSAnZWagAAGP8P+QEUTrbJXZunc9cuN2/U\nSVc+9/UQfUWxn8sH2cyH0x6bG8Tb9pngCyQ4iroNYiGf957tTIwfiTS8p5hJ\nZ+icRhT6DFuuSa9leT9V6vg+vkcw9K2R14VyvT8XA4ULotjeqvFVfZsUVcny\nraKKg+dX6rYT+nuRkNR4z3L40aIF9zt9OcIlqEbfUH7PfUSrNMe75OYu9L1g\ns++jEvCct47ZqerO5dAqqRXSPDLGWJUrlUvSFJVv8ZWvbpjySVkA+FMy+Ahx\n/zL7OfaorBHInso40Y63/AnCXa1Xuw92Wcfn099hXe4ND06edfpMrPmUTzyO\neawtEm8siAiSGN2TJbhLewYVl/o8HJ784Yzkhx/u27t4lw3UOytpkZpYVyFj\nZJtl+1UOeCCcAc8NrreVSuO0yHeE9b/DhyR8WU9f3WqM4TuHkManeCMBxF5t\npL83tL82gm4sJPNUFi//2NNdK6Q/2dK5kaLCesX6vZb74NkPosgRC/FS0qN5\naNcidT5p+bbwdx3DO16FnmVAPMr4tMJWNutcE/m5/nbD1eIO+KqUploZeHli\nm7zVB98aoJq4OLVJSoWMbG43N0hSaLWujG4r+04xmKaqy25k62WZ0pCUYt9D\nvLw1BAv1LE8S8K/I/ax+tMCl/0TqYyWBHtmAN8lzB76k7FztgxnaEfmpXGKT\nCKoP\r\n=Jbof\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7458ca9f14be94c1a279bd594f262289d278bd39","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.06dead2d6.0","@material/rtl":"11.0.0-canary.06dead2d6.0","@material/base":"11.0.0-canary.06dead2d6.0","@material/shape":"11.0.0-canary.06dead2d6.0","@material/theme":"11.0.0-canary.06dead2d6.0","@material/animation":"11.0.0-canary.06dead2d6.0","@material/elevation":"11.0.0-canary.06dead2d6.0","@material/typography":"11.0.0-canary.06dead2d6.0","@material/feature-targeting":"11.0.0-canary.06dead2d6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.06dead2d6.0_1613695086600_0.6190041369409989","host":"s3://npm-registry-packages"}},"11.0.0-canary.cddb03553.0":{"name":"@material/tooltip","version":"11.0.0-canary.cddb03553.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.cddb03553.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"abc71f8e723135b723fcdee9838d117da300d14f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.cddb03553.0.tgz","fileCount":38,"integrity":"sha512-TEnwD1RVVUdZ7MpewqcDkjXs5GZuxqCTy0wU4z/ivBcBg22w7VpmK/HUvyJ3WPtSqrwflNoWlWxEM4hz/DnjWg==","signatures":[{"sig":"MEUCIQDJsc51QKJiPYCZooiOr1n2/6rezV/JLMY12fMEfFDsGAIgdIcIOMlM4x558v6IAcBB3vh+e+8pN6NzfO1oiLXrjYY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":607060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLy0DCRA9TVsSAnZWagAATeUP/1aa3bFx714YjKT8fEgf\nBde5tyBtl5qzpaUHtT9+o8jq3ZVNbpmkX0tS9Mxwi2ipZoh/OU7duswIFPhN\nPjHNWs100ONN1ZAZ7M0hCVjSd1XWkz/mM/ERuEkvJ4vwNfWqzwOtJc7dfasA\nHnxAKAxPSJFiriol7u/FENEOlUCMJJysf/FMHs3PNQKOxp9TnYBX4cucxKiF\nb+1b/+/Em32x918keNON3vhLaX/PPqA6eDsPmrN2iGcrQRVFiU09ISZuInSQ\nfQoeHuu3Jwb0FLF7nFMQm1n44QUTCcWpkXkkqSZxsRTEJ0I+rFxQ6fvBCfMX\ncIojDQGqKKCb4C71lF47vzWrKWTG+z8t3G6+SIHwgLgncm5plHb4RGjVXcDg\nZJMO/Dof/KLWE4TsvW3wISRZQ9+k+4n/YqGtAVJ6IlnGa3WlsWqORKBSlnXD\njHfyH/a7GMPWphS28DSPFiSEILCi9E/WLnO5dLX1W+O6pS6/DvqVrg/8GcMp\nv9OTma6hplku3J2wYaJ8G4Cn4OgPcl4+bMXP0fEnIOmB/LJWjlRBO+f+2ffk\nAdTWU1fyPfHP8LLUKQv9Q4icZoCzWRgyCtnuxTVVorQ8+5tpXVrb6RmsFjrI\nb+a46cbRu/QwyHMG+sgQpDDr3jj32W6F7L2M9lL4hKTK8uYJfpN+7qIVpAnN\nbsFs\r\n=gGwZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a8deff13e5978e42ae51f60c844f7ca0abf64b45","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.cddb03553.0","@material/rtl":"11.0.0-canary.cddb03553.0","@material/base":"11.0.0-canary.cddb03553.0","@material/shape":"11.0.0-canary.cddb03553.0","@material/theme":"11.0.0-canary.cddb03553.0","@material/animation":"11.0.0-canary.cddb03553.0","@material/elevation":"11.0.0-canary.cddb03553.0","@material/typography":"11.0.0-canary.cddb03553.0","@material/feature-targeting":"11.0.0-canary.cddb03553.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.cddb03553.0_1613704451319_0.6995044708871663","host":"s3://npm-registry-packages"}},"11.0.0-canary.d6d8d0476.0":{"name":"@material/tooltip","version":"11.0.0-canary.d6d8d0476.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.d6d8d0476.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"145be56a11ce40e11c11e401972df195cfe6a695","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.d6d8d0476.0.tgz","fileCount":38,"integrity":"sha512-fKBgwEmTyCiLKoHn9Q56HiGPLe0HAP+E1k7IhHERj1I5jbpIYHvrw1j30zSCetxHmNl0y++nCVDWEMNtHMswrw==","signatures":[{"sig":"MEUCIGztC5OXibXHVElT4p44E+HxGIW22gHeRcGMrSFD047XAiEAniDuNL+h2iUZJ9lpAo9WHMeZkj0NgK2d8i1jZhpevFY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":607060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL06pCRA9TVsSAnZWagAA5rQQAIpGb17Qt9pQ5SoGM/ud\nA4b9NAdqc58YyC44IiiABzNmwByGo0yiv4WbtjTQH76RVjaa4tWYdezOteYX\ntvmiu0xXNj3snEz5dVzi/MSvPAJ9Du9tMP0yujoK4bKUneH02Fwci9Ajd+Cj\nwmoUp9sHsQ8O6CLNLaCqvlBUpXrNsQCWy1Tz4hXfMqbsNKwrQmwJx8H19/bV\nVA8yFLRDqmnSPPlj/Co86pEjy9DYHGgbEfpDjB0p/M/Q0kiTc6mK+0c3RbcU\ng7QNo5RcyNF8uuT5DaZ3gV+lqc5UFXUaVzcUc09phNeo+CE9AoCUK+Zhf6Xn\ntST4MfQNT9mrn9D+sT6VnLyf2qSgICTOa7ZY57H+Jk1v92LXcK/Rztj+Odhs\nd9jEvqW/t0e7XxVldZOGBGcrzNNT2Ybtqd5K7EJxF+mvv30cmI6jyUmup7WM\nPSNVx0HszmSb9kf3luR/lH2jq/zJaSySnUjnJVR29msOuRsXD+N2DKskCNS6\nW1Lnh6rcfIqBo24/0Mbm8+jjt07YOPKqCykgEvO81rcKEgkoXzOZh5AUbMqS\ncRzFGQYigRDfWoBqo28rH7PSgItEs0xqSv9WlNW+GDIthvSetvPLc4SRZiW/\nvrwlMcrQyIu6usx9H2UonbH5t5FsSLthSiLVJuxSZ2QIsxdkJ4npOAN9nnLw\nGz1y\r\n=9LkP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"17aa6317e2c1a8109a8bae34e962d438f170f811","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.d6d8d0476.0","@material/rtl":"11.0.0-canary.d6d8d0476.0","@material/base":"11.0.0-canary.d6d8d0476.0","@material/shape":"11.0.0-canary.d6d8d0476.0","@material/theme":"11.0.0-canary.d6d8d0476.0","@material/animation":"11.0.0-canary.d6d8d0476.0","@material/elevation":"11.0.0-canary.d6d8d0476.0","@material/typography":"11.0.0-canary.d6d8d0476.0","@material/feature-targeting":"11.0.0-canary.d6d8d0476.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.d6d8d0476.0_1613713065412_0.740601679719858","host":"s3://npm-registry-packages"}},"11.0.0-canary.0b4a4b2eb.0":{"name":"@material/tooltip","version":"11.0.0-canary.0b4a4b2eb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.0b4a4b2eb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7e17459de69e0c91d20189dd05e64ac7b8037f43","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.0b4a4b2eb.0.tgz","fileCount":38,"integrity":"sha512-ZynWIz3gXimyQVXApbCxhpqsHfQsG0Db5Lmy8QM09I3fLqyOX1ipyghWqiUFJCE/KuU1ITtqMvXEmjiOFGsWaA==","signatures":[{"sig":"MEQCIC00iWYMwy3N7n/r5l+SUsgWpyyH6XvbHieSqTJpHXikAiBR7lOZN3QH+WiTKQ7yOsbiBcBZtnI0m1OPj+V8hSoX6Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611016,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL91sCRA9TVsSAnZWagAAUmYP/At2/S2DCU2TZGfajb7z\nyZ+USKg/dDn39wlsf56N+rUCZh6dvyPXbHXJEAjtqBUd1cX5+oqPtej/sTQF\nzPZdOJ6pLAp8v/zaXut3vP9qbFMwYTLjtKMk8pTEWFAe/s/nxFiFHXPKvhdT\naMZyCACdYJOW+bh8FA7OBN/bhkr+hPRQD9hpdtIAZ0bdPbdqJxYEcHHDTp6f\nKejo0HFUmHjMWvFl+DpzLRH9ZjSdQQNHroBbg/NQoAiC1roFuN08uf5q6Ahv\nM9N6B/OAZV25eNf04aEogFe168kq69i9VGlJIJz2Qn2bzYiLjn36MKoibTTP\nxZeD+HeofBMtyGkf0QtxvM/yd3dylsXSxH0OtBztTFVcfA3++vwr+dxR97Sg\nvJEnhHq9uDEB5LiXegeGuBX5/s5skcEKWBhA0wQudkN89mfXf9mtwY91ISzb\nB33+n7hirnlnDvV/MgGgmTbBKTinDSSIyTFT2rH1xI0A6FfDprEHELLyy6ub\nZRNCRxbVgh+Kc54s1Q28A9Qe62x4Y8BPeGEw3J8X/JFLvn+PMIPbp3OSwuCC\np+AD08hLqPHwgP+QrKsS7FZ6r0UNh5dhSR9sHL9vKcjq3vSC/eyWPfcWbtm5\nic6QltfJDhtvPUcacc7qia1pL6iF5EeO93b5TdAVvThwl9jQS2F3hbsVcSAp\nYbXM\r\n=V2T1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d96f438a60c2d44b9a3f9ec055d1dad78d316e6c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.0b4a4b2eb.0","@material/rtl":"11.0.0-canary.0b4a4b2eb.0","@material/base":"11.0.0-canary.0b4a4b2eb.0","@material/shape":"11.0.0-canary.0b4a4b2eb.0","@material/theme":"11.0.0-canary.0b4a4b2eb.0","@material/animation":"11.0.0-canary.0b4a4b2eb.0","@material/elevation":"11.0.0-canary.0b4a4b2eb.0","@material/typography":"11.0.0-canary.0b4a4b2eb.0","@material/feature-targeting":"11.0.0-canary.0b4a4b2eb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.0b4a4b2eb.0_1613749612253_0.1175625236516904","host":"s3://npm-registry-packages"}},"11.0.0-canary.3201cae47.0":{"name":"@material/tooltip","version":"11.0.0-canary.3201cae47.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.3201cae47.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3adbb361c0bbbc94a6471f1159f16cdb8ca00705","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.3201cae47.0.tgz","fileCount":38,"integrity":"sha512-dIj+UhIlALXBl+i+i6lhTet7hIOAQLd40CpKG+DLkT3pFOQO0G8hO9r79+sKu2ty1nPRZbxXBON62woH12UJpQ==","signatures":[{"sig":"MEUCIG4ByRJor8MhJP2Q6AdRVv38mFfGKSJL77tAuf3Xr8SKAiEA+u5g5JgJgXcsmMynJVuIkzlMOZ3pwG2XrMhlCpS0sY8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611016,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMENZCRA9TVsSAnZWagAA5rEP/2FMzWhwV7NFRoNNYgns\ntQGl7/PHURpSkQBzAUVpfo/wLuFX9JYSgxgOFeMfAMFfjMj7CgQGDlcp73gT\niPXFgGIj9iCKlp3egcznXyox0HIREy+2oWePy8EDcLXouDpB07uQiJ2CNNip\naYruFYk+IQaSVLKAJMrq5sr0lyLlfDypG3px20jNz9zD2tscr2VWjttYpLcd\n9KEwj9r3Mu1gywY5pw04AbFHrk/1PFJnbi4qgogxwJRMtvrc7ELGdqz9Oav6\nLDcL9umiDWKOXIfB8oX3Kx0dwih1sUVbCzKnd5FQ91mQNZaN4ZXLpIU6BZ0w\n1LHlob15Sr8qtju4Y+Wfh10RiLryxCE+RcL4pYpwxO9105lPn+qTeTElZ2Jl\nYmmx94gPhcJ/ctr6lXNQWdXDk2g5XFfn6m6s24ftSTIonT7Bak6aR7mblpyf\nT2PRHe1s4BfFY7kCNj3cClVzqj9+38tCDKG7ESOIfCKL8CShdS2NAs0KSoin\n6wPfPbIIGxqmTEjVohHOGK5Y9HwdRww1qhrbDhzHtJBhWCPsk7RhiervX0Xb\nEzml/AcPfrAnmTjnz/UIUWSn/SJVcTaM1sS/N/pOVLd+QyU1DTj5L5pF7Yp4\nBJXhOfEc3laOnTJQdnQRJZEfZ3LBC6MFhUmapT8crJXpKAuZKMlX7jUbv6Cg\nDoUF\r\n=evmg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"274d3ca7227bee74ffff3d46ddf3ae266226bca7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.3201cae47.0","@material/rtl":"11.0.0-canary.3201cae47.0","@material/base":"11.0.0-canary.3201cae47.0","@material/shape":"11.0.0-canary.3201cae47.0","@material/theme":"11.0.0-canary.3201cae47.0","@material/animation":"11.0.0-canary.3201cae47.0","@material/elevation":"11.0.0-canary.3201cae47.0","@material/typography":"11.0.0-canary.3201cae47.0","@material/feature-targeting":"11.0.0-canary.3201cae47.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.3201cae47.0_1613775705532_0.7810284841301138","host":"s3://npm-registry-packages"}},"11.0.0-canary.f1b1fd5d3.0":{"name":"@material/tooltip","version":"11.0.0-canary.f1b1fd5d3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f1b1fd5d3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e8ec7b254cf0591be79e91bae53ed8cf5154664a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f1b1fd5d3.0.tgz","fileCount":38,"integrity":"sha512-my/SU4Sz436rJ1zr65uE4MJiQWsTbcGDhrUWuiqtdN2DQfaTLQKRyiYDk3onW3nbATlhImzkJeFhITV4ZN80xg==","signatures":[{"sig":"MEUCIQCQex7ASQb976Q8qKoCsUPe6VkwMij6r53DpAsC0E0dSAIgY2sx38XNFoFAHXg9Ou/xE8TWskE3ZUxaMaPuWjkL/60=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611016,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNAsECRA9TVsSAnZWagAAIRIP+wazrKHVgj4m++A5wRH7\nhsfx2ZB2JsWEHfqRjY1n71QedCVd7PynVnBTTbbj/VmdC5hdaS2Gd971KG8u\nfdPtIbyuMazSged3GF6niX09eiArRr3K+iakFEmbA+VWluu9+/6tmPNxY2M2\n5B7QV7OYoeFQyJGuOT9RFgRV4pvbTCak/sk1ofoU3WCaxezXlPeVAbLzGTh5\nIDlZ+iFHtoNBuZPlj7DznvV8TF2dq5QPtG98F6AqS3MCGu06ie0kWdkhNfE4\n1B/CZs2hwKtWk9zQrnQDwxiwiHj/yZ7/sGrOeQFS3GuGB22d9Tm7aEnbvSHc\nu5OKySXj0ZQd4NdnRZih+tT0N4T8HuTtNnq4IOeGIqW6uRe4MHEbPDNuQX7T\ncywu6QW6SwfNF42aSkklXZ2OAlwaKO9ntuOoKo/lGjtjubQXGXqy/vCinilo\nNvgNkRkWEanq1m5iOgZkUEZhC9gQziLQ9ODaezUIKqvHHZ214kpk3PX7+GdX\nM4r1tIJlCG+3zWplePT5HtkWz2b+FX9jb1byLnZLwfnmb9KOXICa0gYlHrj1\nPD7Lw7yJnPopFlY9xcOJALLAKVCe1jhbkh2Ikg8Psls+unYKUeDRAcvsbG0H\nfTATPjz2SAn3iJE9X6obOU4AauElP3kNPfr1NM62B0wdRNhyD7cT/AGeK2L7\np8GZ\r\n=DESJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b73a5cc3b15b450664de92ee70312cc1e8b17304","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f1b1fd5d3.0","@material/rtl":"11.0.0-canary.f1b1fd5d3.0","@material/base":"11.0.0-canary.f1b1fd5d3.0","@material/shape":"11.0.0-canary.f1b1fd5d3.0","@material/theme":"11.0.0-canary.f1b1fd5d3.0","@material/animation":"11.0.0-canary.f1b1fd5d3.0","@material/elevation":"11.0.0-canary.f1b1fd5d3.0","@material/typography":"11.0.0-canary.f1b1fd5d3.0","@material/feature-targeting":"11.0.0-canary.f1b1fd5d3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f1b1fd5d3.0_1614023427714_0.7761330119813334","host":"s3://npm-registry-packages"}},"11.0.0-canary.7899e0fe0.0":{"name":"@material/tooltip","version":"11.0.0-canary.7899e0fe0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.7899e0fe0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"626476f0128d12c2e33335d0bc5c49c6d0d5c996","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.7899e0fe0.0.tgz","fileCount":38,"integrity":"sha512-LhU/vuZVc1hHuOlLgwgJLLCOv6NI7m3ECV7UuVujK4xpo/ZhAf5zoGCyPqspqGctpiW5LmVEAr3GEpE8ndleOg==","signatures":[{"sig":"MEYCIQDtg24xZi0RGW28+JaCx8PMkL4sFgAbNCkOpAOqLC8XfwIhAKG0OIogDM8G+SP0IQYzp0pJL3OepYOquijXi7cg0wJs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611016,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNDRXCRA9TVsSAnZWagAANOMP/iZEQNA7Tc6lVPL/vfl4\nQjBwJN5FgQ/KkPwn8zGoUflXWonUyHltjIATGX/8g5n53z5X9MZHWgiquyYR\nerV30DdYPx4jQxY/vhuZ66ZKlOBNPNU4RRo7qw2779z9oHT6VchZ2Bttw5b+\nKweTc6rWqXvWycL4070+Aq/JdI6k0bVOOs8lUFdtKYINgJWQ5bCf3DW5rdoI\n932N0nufGoDRxEbl42+N7JQxvK23rQ1BYeMveFOWcS399r1GeA/MmwTV0JfV\nTc6C+p5huE2Z+RehGJMcJrUgy0Yyr0ZkZII5qgQx+k7vqtjENNKfZ9ldlWhH\nsjUfP0Tr1GldsLFwKm2nBfe+bycVSNneQncmso+gENkPVmENu7MdR7l81Kue\npp/S1OWKickA1LlKuussCivP676nQ0qUs97BE/mS4OtAb6Q4/ue0pnwn13Ei\n+pnxzaL5L3FuyEUIEUjTNeY0UOmCn620/CQMVCF3XtZ5TUdo12p7CfrTkqYP\n5oa4pGzJbWbgRfKALkEuSWty59nlnRlSZ3le0hdVMFcre1L+IaXIUw3Nxfar\nK1s96UTDIYweZH84UeA/G+m18cioiPyjwTsro/+3YAltoMtHVBguVEZChCbj\nHpMPNNICF2gIe9xJOgGmAfmz7+Z0Y7puNGEWlOZ0LrpKcCchRdDyBo5rSCJP\nVP59\r\n=Xh/R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"73b260d2233a31311cff76e4c10438913b91c2ea","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.7899e0fe0.0","@material/rtl":"11.0.0-canary.7899e0fe0.0","@material/base":"11.0.0-canary.7899e0fe0.0","@material/shape":"11.0.0-canary.7899e0fe0.0","@material/theme":"11.0.0-canary.7899e0fe0.0","@material/animation":"11.0.0-canary.7899e0fe0.0","@material/elevation":"11.0.0-canary.7899e0fe0.0","@material/typography":"11.0.0-canary.7899e0fe0.0","@material/feature-targeting":"11.0.0-canary.7899e0fe0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.7899e0fe0.0_1614034007173_0.9041518400364559","host":"s3://npm-registry-packages"}},"11.0.0-canary.f19c86d13.0":{"name":"@material/tooltip","version":"11.0.0-canary.f19c86d13.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f19c86d13.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e5c00e4aa0f8647bd621595353bba14048fc717b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f19c86d13.0.tgz","fileCount":38,"integrity":"sha512-47SWtIy1Pe/4PrNXfo5eEBoiPJM1sUe53e0SXIBnag5viiq6nildnFKqN91kHwhyeKsUi43eJOceFu4gV4oD4Q==","signatures":[{"sig":"MEQCIAkBnRmhvUL2BoP0h17fOVwcVb26HjqP3P/iPQbM35G8AiABPt7PrdOjCHNpIkX92KxFpL8lg1tLAeM/1m8OYig8ww==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgND7eCRA9TVsSAnZWagAAS/MP/0IdyY8i0GA1101O1v9C\nuZwfJANfm7Jmdqf9hMudCjz4+C7I2bUhG6C4xQ5f0dYvXniN0gv9l3HGDgU0\nLm+UeA5TN+D42ccKecEc/9Mkmw31Gczivbo9Pdd+alJjxoDOZAsj0dLwLohm\nFp5/3GpI+Rutg6iT/YL8aDc0EIt0cCL+Qlrep3iNAQKGW+SrpDNaA+wkVTK6\nvf82ZJpOgJy+WlY8Ct9NJOq1CyxI9qhCU//WXe/slHauCYBPfE25MGJ6XXN/\nL/2nMGvmeyggIcMRGxHOcnAwiqaMEKzdPMQvKnhtPujn6aZg6dZEOtwWwz6r\nXubXYzOI+AzOZUp9WOMqsBtt9EM3zl7X/HQ32PSiUKeHvr9vTpuQjC4502v/\nqSbA7Iui05a4007LLOegaAtZ5p1kGG8rvrYBjbGiFeHn29GzgXYY16SRWW2K\nx6P7kudQaMqloVwzZ/1nSS9cMyZqhYaL149SIvaKvabtXGe1Gw8aUfQSKmqQ\n8BUOliEjGr1k46ewej3E3x2ytqFlTk1BYAmH2F7Zk60DOvNDd8uGUi6mbFRn\nTbVXHjgI8JBUfg2fxJKMXHl0gWqoxruB0vw6tbQJaub958SyxnzSY+7Yxcem\n/tpxErfbu6bQ3dvMMq3e5H7vVHQKnkg0TlqKT8a4KTPttYyre2I518V3/tIh\nRfG/\r\n=xSKj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a4b2b851fa6f3895a9e915d4bdc5b6b6715a4260","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f19c86d13.0","@material/rtl":"11.0.0-canary.f19c86d13.0","@material/base":"11.0.0-canary.f19c86d13.0","@material/shape":"11.0.0-canary.f19c86d13.0","@material/theme":"11.0.0-canary.f19c86d13.0","@material/animation":"11.0.0-canary.f19c86d13.0","@material/elevation":"11.0.0-canary.f19c86d13.0","@material/typography":"11.0.0-canary.f19c86d13.0","@material/feature-targeting":"11.0.0-canary.f19c86d13.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f19c86d13.0_1614036701580_0.41084470766516734","host":"s3://npm-registry-packages"}},"11.0.0-canary.60e892d79.0":{"name":"@material/tooltip","version":"11.0.0-canary.60e892d79.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.60e892d79.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2337cebf315332bb36418d6a0a7868787ba6e049","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.60e892d79.0.tgz","fileCount":38,"integrity":"sha512-2qbhgjmMYmwI5I8oRyvWklt5UzcDSsN6y1Z0nxkeHBk9H8O9z05cMYUdqIRhY1wLyhFt0TyAgZ9U4YcTXKn4ig==","signatures":[{"sig":"MEUCIBLnuI56S5O6HPnM/AE9NA11aufePN6gCK6RQM4rURGKAiEA0K47jAhV6KPbCXYHsA3k94csKCi7X4mCA2vUdPTFlKw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNFclCRA9TVsSAnZWagAAKdAQAJwYhCqW9xIb1t0Htqxr\n0nR8bL7l8dPh3orlx74u1Euan7mA4+K6oDbafRLi0Ng8O8/dCRH7htYAOz33\niwY9YxDAk4EBGFrT/OrhGK6w5/zgNlGcqd+V7Nn/chSD2ie8znFwT/akH1nN\n5xyLaL9uvySJZ86x3xDEgeawHwOecEzb9bRCScUtGEmqc4zn2+NzaDwO3oLI\nBmX6AmDGSeAnlkonF9YAW575XRy7UaG7OE6QEZ4/DIuK+VLVs80xKE5Yh/uI\nKF46bI8Xk124OcYkyns1bqVc44a2PPFLcyhSp7IRal5hWoTUb0bWc9A6XovK\nokmMdhruTgUK+fAUFzFUsunuHKHxZqLpzzc7d44X599qo5EVg0/mQbkNjhoJ\n1pZrgUSdx67iagQHbiNKfV90X7vbGhtOx7R0M133xsMVRZYPR8KzZ3XX1hbT\n3z0+ZOYNQ7oYW1Tk3Yd7koazK6Rvy50Zprbjq03MmCQ/VY0QtV+vhelNm1jb\nqsZ+7rftVJI/E4EI/bSHvV12n/5Przhu3rOq+rWEVFoJaqJYdM3NlMbuiPoR\nbP/dQVbiwFyoHku/zwTA1QPaXnJXZGvsCRsA+gkr3CUgcwhA+Lq/B1fUU7Q5\n7u/JluOFY70xjWhSzXRm0PtH86wO4L13ClTN7NEtHv/8d5cZk8T6vKzwp5XC\nphTl\r\n=wGhe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c94f9f392484897a962a9b7101ddc6d70e5df67e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.60e892d79.0","@material/rtl":"11.0.0-canary.60e892d79.0","@material/base":"11.0.0-canary.60e892d79.0","@material/shape":"11.0.0-canary.60e892d79.0","@material/theme":"11.0.0-canary.60e892d79.0","@material/animation":"11.0.0-canary.60e892d79.0","@material/elevation":"11.0.0-canary.60e892d79.0","@material/typography":"11.0.0-canary.60e892d79.0","@material/feature-targeting":"11.0.0-canary.60e892d79.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.60e892d79.0_1614042917136_0.8988780134611338","host":"s3://npm-registry-packages"}},"11.0.0-canary.c96bfa495.0":{"name":"@material/tooltip","version":"11.0.0-canary.c96bfa495.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.c96bfa495.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f5c65cd0b40b471a4eb25e0e375ed446ca8ec60","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.c96bfa495.0.tgz","fileCount":38,"integrity":"sha512-YtQ6QiHNn9PdPSY1XUX5taG7Ou+ISO3RIpJ4MaMCEtwXf/p2S9gt0qOXsnuzIgkWlL5Rz5lFQ8efjfzAATUiBg==","signatures":[{"sig":"MEUCIQDgMPP0x7hhyNxBOjQ2LsuVht8ajsvQOLXUARWyt41qpQIgPAvb+4ncII+XHa4HyZf0QnJjDfksBDV2uu6joX+LJXs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNVi5CRA9TVsSAnZWagAALaQP/jGh4s1YVb4CQd3TRdRs\n7T9EvdtslcGaoc0FJLJecSMyx8vbsDgD6F6dUry6Xgwxy5ZCwY6dcldoh94O\nhr+TMvF2aRvqYWNO5qxbm6PbUw+rk27byFpXR5PkeZ10HK23tbzf+cTYbJ6i\nqgFFYSTOjMAxsHgThs13rjou5j5IgzS0xUM5bXUap4HaZxEM13K46s2KTErE\nJb8IEG75+L0dEAROENEIlWSXhlV8xxVkz49acBj8qYuq/ZTJKSk27If4fBPb\nYaMRfuccOoHUxJpy7JDLBrkFUkrYmZk/QOM/x3TFJwP7Ka8/m3N1MAFeRQDm\npdxNhGmgH/DSBuTkIUJFJ4wspe8Mkz3pxYqz3x/CLL7rkKQEAoXEKLY9Gscc\n1q6vul23ANS54BYQTszjuwwAeDNx3BcnF4ipoyrNCypdzF8cvQ3i1S4OsG+w\nUt0Z5Ukhy44WeaeygDgFjej6UIa4jWT7YchC72x65AH0IQv4O/hpsIm41h/k\nTDC4bMplyTUkjfHg2mLBJk6FR99OHdwDOTzrptFr7gxhWOrj4IUjr/q73NO0\neMDYh1nf3Qw+85DXyvAaFqotQUnZzp+lCTjGwxdWupIedHH8GT6FzEUpIWpZ\ngs6vSxrgMhHBbu0KzSQX3vsc4N0gMzHqP2jIhaZoCbX92PGJ6q5h57k+OiqL\n/bJD\r\n=cPPs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1fd35f98370bc606c6677b7045a8acf16c0ea7a1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.c96bfa495.0","@material/rtl":"11.0.0-canary.c96bfa495.0","@material/base":"11.0.0-canary.c96bfa495.0","@material/shape":"11.0.0-canary.c96bfa495.0","@material/theme":"11.0.0-canary.c96bfa495.0","@material/animation":"11.0.0-canary.c96bfa495.0","@material/elevation":"11.0.0-canary.c96bfa495.0","@material/typography":"11.0.0-canary.c96bfa495.0","@material/feature-targeting":"11.0.0-canary.c96bfa495.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.c96bfa495.0_1614108856867_0.07030025953241381","host":"s3://npm-registry-packages"}},"11.0.0-canary.fa9b59f67.0":{"name":"@material/tooltip","version":"11.0.0-canary.fa9b59f67.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.fa9b59f67.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b50d723cc19a2646e3a498c4987efe1555addf0b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.fa9b59f67.0.tgz","fileCount":38,"integrity":"sha512-W3i92UDi6P0ifKgWSTpEkWzRGRODzZ78IgO1Mqxe6Q3H9AdkIi/NlOJpIp0s61eIusMNwisVLZM/KAO7FmT0ag==","signatures":[{"sig":"MEQCIDc2hLPo4WyBb8HuLzQm0olcNWq+N3fLgIlByRQtZ4NvAiARJtZl1pAfjAZNQtYQ8YvffIrfLh1Fmcl9KW5Ff/QCyg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNVkFCRA9TVsSAnZWagAA9k4P/Rl2HaB0QI+ub2uNSnrM\ny84DMM3qFc6O0B4WMvA2OF7qa20zLI355gqeSAIxSO2sb5xncqiW3RJiMVNU\n9R9SMYtbwes0fogybKS8umbhHlKCMENbDJ6OJgz+/K3yJBiZ0B+0Tz1tVyg3\nAxqJPtn/ia3vrSAFs3leWh4AGefRIMv8IZV8/97RuHf30Zzf8igqlu8GQ37o\n/v1zbJkeXSaAB5I1jkSvXiuEbwHeQvUVXN+XRq11EbaHXaGLlfHEMXvnJ+q9\nLhTdQkhE37Wl9UFcFyo1mlzQKCgs40LmsEm1iUERvnppTzgpRm54qzYrb+79\nq36JMZLvFMdDPnc7dZjlBmw9H8rNpnAsnQ2GTCGujqtGET1UqXCXuQDfCIK5\nJYuVuP/KYx2Ma3Yy96GAqU1KOGL/nRm4L3jivaHwaZsjTXQrHKh6st7oQnR5\noW79jTQv/+QlmceYcCtNnW2F5n+oHNOyS6ZQz6xM+VnaNQI3QYeDHmEhMEet\nhht+4Qm7rOw+t8DoL1c/gWZmGfm57mVANj4fXe+ekNRSd/a5IzNQ7hZZvOx/\nLs2hG5MjbPd0bZuFsuXBhOs5gnzhpGv4KK2o4sksCpiFYpS0G+MRZa369rcf\nx5+31yKfX+/8d5Tw49g1KEgr/S8DfuKaouF3NVXL8Q+5esRIIdE56Xz1y1XN\ng13F\r\n=ZliW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5fd97ca8b5906f3b3097bd333237976e3e93d192","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.fa9b59f67.0","@material/rtl":"11.0.0-canary.fa9b59f67.0","@material/base":"11.0.0-canary.fa9b59f67.0","@material/shape":"11.0.0-canary.fa9b59f67.0","@material/theme":"11.0.0-canary.fa9b59f67.0","@material/animation":"11.0.0-canary.fa9b59f67.0","@material/elevation":"11.0.0-canary.fa9b59f67.0","@material/typography":"11.0.0-canary.fa9b59f67.0","@material/feature-targeting":"11.0.0-canary.fa9b59f67.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.fa9b59f67.0_1614108932929_0.9074749280194727","host":"s3://npm-registry-packages"}},"11.0.0-canary.869e3497c.0":{"name":"@material/tooltip","version":"11.0.0-canary.869e3497c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.869e3497c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cde86642fdb961dacfed4a69d690d1c609904f47","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.869e3497c.0.tgz","fileCount":38,"integrity":"sha512-gW3GakJWdBrBZW3EuJIwEfRVNc5GjaasPVhgmEDMKjcBSqLPNN0eHfZAQvplL5EojuSM7aE0SOWlXzuXRP6u8w==","signatures":[{"sig":"MEUCIQC0en7S/KEBaRj0P+YZNT5aTBfD3nGRHovuDJwvjs3L5wIgTzmPmJpcUYLAo3drf5RB1D4PEEu3vAs0VBoJ1SE3hb4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNVkgCRA9TVsSAnZWagAA1hgQAISE7+l6eTObcjanfCQb\ncXn3mfK1BJUUvmWGTDLRFbzTAjYKgI6LL28l3Z+VW7pUqmBIKY0WYW2nqAVs\n3V6VulTbXkHl5Lz+JF8pbwU0tjIUdcwoRqcCXwgfH8rR+ucTgQ/b53Lv3jnN\nVPq610MpKRd6lVGy21YBkZk30OCUqRKLoFTIP9+FsYuTCahaPV+HEch3+3Xn\nx+I4v9OGQWP382rhmXiNpdhsazN4NEHhaUKktQS5l5J3tq7M1+Xvi2qjKRtd\nCs89Bj4lEaEXQEvZtcc6NgpXL16MpDDZ+/mQG93RJBVGDhu5G8+uPfkmkYgj\nWjIHBtza/M5Ip9yujKrPCkb3S4MBWW2dzPW91CpjKIt4DCISyYDs3/wYMwCT\nilVpPnByiaTNdav7+gCE3mifmM8Owp+jpTa2LCe7k9Ohjay96kg+iwuuVBb9\n9SVNOa5JIJGCpPC9cgVBtzh9qplkcYtCkQShBy/1SZuKrqVj4dM7ake7Nq5U\nEd+p9htz4UexB1pr43MJV7jqzDmggNkhJ+tYvvTw0v9GOYUkJ50LEnYhEvwV\nuO+SQ49HhZ7UKX6VQeMpqgkjyR0/f5pMW6pWQqSEZ+disKHrTifwBC1HkUlC\nlN6az0oAHplc960/0+es9kKrMfTioJARRCwD5ROIGXB+mbNwlaGU47M2XZH3\nGwUE\r\n=aRgG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2e1e116734dbd0e962ee4e11a9952ba9ee6684da","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.869e3497c.0","@material/rtl":"11.0.0-canary.869e3497c.0","@material/base":"11.0.0-canary.869e3497c.0","@material/shape":"11.0.0-canary.869e3497c.0","@material/theme":"11.0.0-canary.869e3497c.0","@material/animation":"11.0.0-canary.869e3497c.0","@material/elevation":"11.0.0-canary.869e3497c.0","@material/typography":"11.0.0-canary.869e3497c.0","@material/feature-targeting":"11.0.0-canary.869e3497c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.869e3497c.0_1614108960217_0.9527285779897123","host":"s3://npm-registry-packages"}},"11.0.0-canary.8ecd7c9a9.0":{"name":"@material/tooltip","version":"11.0.0-canary.8ecd7c9a9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.8ecd7c9a9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d32dc44ce614af8155531de5fb30d843164a540e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.8ecd7c9a9.0.tgz","fileCount":38,"integrity":"sha512-Ejf9HiehW4NvJI3aGUC9lbamhbe+GKPdiYqYzoYcqsVByTu+YR5H67hhEOAr8OzEbSjCWPJertD9KNZnSPSy2A==","signatures":[{"sig":"MEUCIQCmK9AFUkMVF/xNRYf+iosl9HT+zjXpDUBA79XUdoNOIwIgMGh/RIo6aAF8EoM+/qrHS733XFPyM3wVHiyiAclvhiI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNVzOCRA9TVsSAnZWagAAZZAP/jseG8UwOGysRdo13gWk\nFlCnYDMZAtQ7jQNTtq5sKZOf+7ac+hO0HhirmrLeMpR6QQ6l6CYAUJ8rJGwg\nTU2KFkCL1dciHbOidzTkeEXrBl+fH0d+nH3QtFw8/w2jdXW3h+CcFLVvEzP3\n/oMowdNCa3BOykQrbKZz+bBJMgUPPKRetUWzJpfLnBFEg0fSLlqwmAka5eAL\nLgDI87Ys58PNgOdT5iDp1wR4UDZP2tVoza6dvkhk3f2dALD/g7xkEoceYMKF\nY+gSsXzYWauqbG0ys7S7Vvf0N4g7S+IlM24AKFsVub0m3sj8RSpRrw06Wwr9\nnuCnsUNijljogYXaMQ4xWRIyEKt3D2YIkLadrpE98KJcdIJUQ5PYUDzZHMHp\nKWUdPNVlDnhVDJcxs7tjhaaKF7qtti85Wu2TK7D57/e6qLzt4jkFaS2muTDF\nqqnOU1JGbRwXdk81duuAPLrc0gWkjWV5Qb+KoxhI6v0QEb72QgyOGJHwQEhJ\ngH1ImuLtpGUXeh/Od21Nf0yG3jiIlBmAg98PzfCn9QpVk4T98AoYloSfaiUE\ngNFCkf1L+qqSuxRfMuxjd+JyxKXzk8Rh/6xh9FDzDaMCjxRjmB6c4gMkldP8\nWHFfNYraHcOO+x33wClbWzoGBtqYox3FfAyssCOtqfmTW5C2BQz2AK47ULXY\nG0zC\r\n=eInX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ec70d22f543f79f769bc5b509c9dc06cb8114af1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.8ecd7c9a9.0","@material/rtl":"11.0.0-canary.8ecd7c9a9.0","@material/base":"11.0.0-canary.8ecd7c9a9.0","@material/shape":"11.0.0-canary.8ecd7c9a9.0","@material/theme":"11.0.0-canary.8ecd7c9a9.0","@material/animation":"11.0.0-canary.8ecd7c9a9.0","@material/elevation":"11.0.0-canary.8ecd7c9a9.0","@material/typography":"11.0.0-canary.8ecd7c9a9.0","@material/feature-targeting":"11.0.0-canary.8ecd7c9a9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.8ecd7c9a9.0_1614109902408_0.3058323343721807","host":"s3://npm-registry-packages"}},"11.0.0-canary.9c85d505b.0":{"name":"@material/tooltip","version":"11.0.0-canary.9c85d505b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.9c85d505b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e4e5f95c0d078bb87ad4cc7d6e2a1a0b5985ebf1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.9c85d505b.0.tgz","fileCount":38,"integrity":"sha512-7SjY/+sdvWJ3a6y8Q+g6dzUYVRrHVz+GCkqv/usn8LlJSkT9RTpN9E/eOKYCcgX1ioeTIxho041KQLfpTLq2Ng==","signatures":[{"sig":"MEUCIQDdSBZA26kuV0HkEE8YTAPVJzQgd9dIu8T8ezNkBS0dBwIgF3aDDRz6A+b/BcoJfRBpnuCGwHLBRhhd7S2Fy5ZjBnM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNX7LCRA9TVsSAnZWagAAmFMP/RZA9FThcD1aRosO1DNG\nC7EwzxNdyJs49Kdz6bfN1ZhPZNAcXI6m6IIGj7e+9gtJAbckj+wGhKi8Hww7\nX3QxlzSfjI4FbTlYAENK25OBLxdDgcF2MlXvaxD9DtqeRAMZ5jGmWcnHCmme\nQ6BJtY5CMSofIQfobZjYDHv3JPKE2JYiH5G/NVUAoAVSzxUKTFCKWEjuuM4Z\n4KeMYNP0RIOleotmoXHPhZvjxWgP7xY7DnYWdh0w8oV9SGmNHf8L0n689fDU\n/lGhO4Cr/t2GbsJE7VbSJ/AVfPlp0xZjpP88lo0SOOWCb+3dpEDZwza/0FJ7\nEplF36KR2Ym+3DHCf2PRFEJPSmyqH27/HzDVIB+vpyDCf72ozpku7iZ7E+i1\n+okOUKp7IGUX2dhvx+pICzR+tX8vdqCvQyQkxurJZxkg/lwmUBmlsi51KgD1\nXAaxV8Ei/u1AfcLY1XPJy9e19lvaqL+ssfeXgN3SYoAgf4XBeq9HsKHjhOC7\nCOaeiygsZiYDTqmy6AGSGAACDUhfi32EHCWd/1cEts/hd7ZMHHYecQ49rdFd\nVSu5yft/i8aHCzKiCFv27PrrpTHmn7XXTGn4Jv2rp2GFr8tjlTVo6PzrYcN4\nHnbkuv0LZJA15TwRPg1N+h+WhMM7WfmTvjJ2lPfKfCGG5vDo6tfSWvImIHm0\nBnIy\r\n=NE64\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"374562c85250daef48b37a0e27a506a7e81c56d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.9c85d505b.0","@material/rtl":"11.0.0-canary.9c85d505b.0","@material/base":"11.0.0-canary.9c85d505b.0","@material/shape":"11.0.0-canary.9c85d505b.0","@material/theme":"11.0.0-canary.9c85d505b.0","@material/animation":"11.0.0-canary.9c85d505b.0","@material/elevation":"11.0.0-canary.9c85d505b.0","@material/typography":"11.0.0-canary.9c85d505b.0","@material/feature-targeting":"11.0.0-canary.9c85d505b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.9c85d505b.0_1614118602677_0.10718042322963006","host":"s3://npm-registry-packages"}},"11.0.0-canary.9f2e85fb8.0":{"name":"@material/tooltip","version":"11.0.0-canary.9f2e85fb8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.9f2e85fb8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2319925dc59859a96c82b99ef7206d86d717fac8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.9f2e85fb8.0.tgz","fileCount":38,"integrity":"sha512-VqpREHAP0aCXptHsuogzdtXh91rp9dZeYJqk5rRCn4ZqojadJJf5EkrlUmrq6buyVofQRHk6IpjHTlE+E0y1hg==","signatures":[{"sig":"MEUCIB4TVOzaPNlkxZeKi9mx+epb4tjXlln+/O5DxFH6e1DZAiEAjr12woV61apv4N8bWQBFxXlTWEqx5MfSzUoNTjvv5xs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNbChCRA9TVsSAnZWagAAWxcP/RsB9eyAYge/bDfDBXDx\nUL6N8knxD4pIqgTV4CxsLilsLh5J/CvJZR4euYr5DVNVb6QasDI1zgtFuBgg\nARj7+rQ2kpsjFFU/er9moglLKuoD9lJurke+zL9sIiAkhgLDz7d+pF3FSRfY\niFinFDyxxmH7dId4RmIZllqYA1Gse1hXFWkIoy4TZLmFWZ2WEMukXYQzv0iE\nRxMrWcErq1lkaTiXCabtQ2t13TaauUrJCPZPqoBhtp4sEvQVs2tQrk+zdzPR\nzQDso+Twc9vzykxrYfUJ1Nx1wSalcyOhMW3a4unXr/uZLreUr4YNyJtgKXo5\ntD1JeDXV6AI8h/LqGFjqV0E+KHYc65uGxT2Fe5LuAU9oez3SdpKAi17Kaw9+\ntEyUJ5VH1i4y0FxrZT1LisFKDu1sNI+zXC1hihEkiECnN9qYxTzsOkopiD6v\nWB3C2Y/TOmzK+WdWx104w/WE1Tr30DZ1tff8RQoN2LK8i4ZidiWkdxl2uxfK\nIb1XRZ9NfBLQVrWxsh7CV0EYaOomqoSgM6bU8BvtAC6y2fF/Zm0JCfUIWDGY\nC5XRXRLzQk90N3S+V49Yznh9DisbZp2UbmJLP0ZOAjdPdG79jwekZaXJ9JS0\nfeJhfPTVHyJtW18Tlx2SsrJOETfChsj5AQRDUcNYXaeAPVPLpPrKA+j5oUxT\nZv6R\r\n=xhon\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4dfe4e49ca9339b2914b3dfd9e5c12642a0fd60e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.9f2e85fb8.0","@material/rtl":"11.0.0-canary.9f2e85fb8.0","@material/base":"11.0.0-canary.9f2e85fb8.0","@material/shape":"11.0.0-canary.9f2e85fb8.0","@material/theme":"11.0.0-canary.9f2e85fb8.0","@material/animation":"11.0.0-canary.9f2e85fb8.0","@material/elevation":"11.0.0-canary.9f2e85fb8.0","@material/typography":"11.0.0-canary.9f2e85fb8.0","@material/feature-targeting":"11.0.0-canary.9f2e85fb8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.9f2e85fb8.0_1614131360917_0.4255926684802245","host":"s3://npm-registry-packages"}},"11.0.0-canary.19c4f29ef.0":{"name":"@material/tooltip","version":"11.0.0-canary.19c4f29ef.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.19c4f29ef.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dbf6a48a003222299f3fd3aebf4a3abeb3398a9f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.19c4f29ef.0.tgz","fileCount":38,"integrity":"sha512-wssyOf0rq8CHBB9CGhdGQZcg+1IJbQl4FMUg4HAMJwDB74au92h6vs+Kk0VqrdY9QwO/TNgpsFJGOvGlcNrQcw==","signatures":[{"sig":"MEQCIG4gtnvCWRlp9chU8tyTLMnM4uSHAa6maJNjdcOIrIOsAiBTRxxiGJVz5wm4cFv2yIm5ib6+Y58826g9h67XIG5AVg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN/k1CRA9TVsSAnZWagAArjEP/jYz3D7nWMspa3nHDVj4\nP8GsXsO+1p+gkjRAGuAbPYwAniNG/9+E6sJItfGP3L7bOtoM6y0ZsYQZgMft\nDVQkkSfAQFopvxKA5BS6+jJRtnOtRUhJ2Hp8H0/WbEYbGCS3yZ23b6jZsRZS\n+JFsCJgQJycM7Q/l2GzMiVrsMi8cJ4SIiL9vxS1plIl5zRYtCSTuCbyf6rD8\nELE5e2Rik3dk8VFq/crHzZE5adMYCoe0LgB+jbk3c7UPZsBsT5KoYiWiexe0\nprde/OjLY94w4xTL3nnH4VTEyU+ScnDUTqOEPDkr/txRXL7KIY6NCrJ7nGwM\n7AlEpVtiMNGR2ULh8cwNjm3Qr5I55jt0aw7JYjPj7v5eY/XlA8Ar4nscQFvV\nH6HHY9dfKz5eucPMkv4Ipvz2EpzG0KoCcG9a9lM/O/P/7/c462UMaOHCt62f\n7+71Cs/+iGcmhmjOQmaUR1MVlGUD7keP+QUlfPR99u67YZCjpAuavRSvp96D\nYfmlnUU5DFX9P4FeRH4wZCeK6yHp9JBIQpj4ou38jb7xBTbnnl7Gr/4ZjD/J\nzkTrEbmM8Fhb7L92S+4EiqDNl6KgH0NYs/K3mdvyx0yzG3WnlWTlI1G2IqCq\n2FWfjyTUjEpgSo1oO2ond0HAzqXJSs+CATmJJSQqz2dncj61rMvm+V3Lc12w\nlHPF\r\n=U2XE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"cf61b54810b37e81ab57d447f7d050104a2f6f46","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.19c4f29ef.0","@material/rtl":"11.0.0-canary.19c4f29ef.0","@material/base":"11.0.0-canary.19c4f29ef.0","@material/shape":"11.0.0-canary.19c4f29ef.0","@material/theme":"11.0.0-canary.19c4f29ef.0","@material/animation":"11.0.0-canary.19c4f29ef.0","@material/elevation":"11.0.0-canary.19c4f29ef.0","@material/typography":"11.0.0-canary.19c4f29ef.0","@material/feature-targeting":"11.0.0-canary.19c4f29ef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.19c4f29ef.0_1614281012764_0.19656296983844523","host":"s3://npm-registry-packages"}},"11.0.0-canary.63df6e9bf.0":{"name":"@material/tooltip","version":"11.0.0-canary.63df6e9bf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.63df6e9bf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cb678887a4e272479d6ba0ed67fb76656ea7ab86","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.63df6e9bf.0.tgz","fileCount":38,"integrity":"sha512-UsD5zdxRlF4oFevKbvXMAJEju4vhDwV/WwXMizIj8TJ+yjXXwO3vj82Gh9AxwY1h66bhUU7UBFcHGjoeeWMTGg==","signatures":[{"sig":"MEYCIQChJyfoWHhn2zDk1lTV3DMWdVOoRbbOtsH7r2rXL7ctDAIhAKu3pcRno/hx6cDnqF+qQgz8ZFBXrp1x+dJvZy7lSIsX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN/ylCRA9TVsSAnZWagAAcW4P+gLc8mIoDsUSrI1/YnE3\npuNRtQ285tj/PMeAYG1fO9I2S0X85ByUA0bWUn72y8R4VdNh0zG/P8peY0lb\nkWP2aRDvQ+GF86pebnpNSx5F7kCQDAsm3BKDq6/UtPoiMvxTK4QaPB4agOk5\nYMU2/i9tOdFDxyUjTiACF0rofh9E/lt7BusRJf4CydONI5IY3MuOi47Q0qXl\nW/19OihKOBNXxoVhtoLH0QSGt6SyMujvUWMcfJbQzop//5numkxSs5d4FLwx\nnIflEOIIqdtrjIyftfkUX4TQGmjB5j74w3Wbp/o51ojUBz6m4X7UspLlAbC6\nbu/BX6a7Muz/M1PZtVbxGt8CqI2xJg4IHTLtx1ugynN9G0PUZcNQ8yQ4fN6P\nctbkdM3n5qP7gudLlx4OUHl4+ZhctSOhw0VTV3joxhfiYbDmbpub78Xryv3H\nlWh59+x86Oor3xwO7GH+fCxpuMa9Kao+mbS9WT6E8HFQHZxDkOHhaAuTE8kQ\nfLuLjmpQGlsySokCPvCiQKAMTveuvnUUIGqXHwOdGvhJpki83+ZkjD67gQ+Z\n5O0Xr2fc4TNK95GQynq6BbAxVpUXMYKbt6mD6w5jQ+9+sUr5JEhNFXNt8MuJ\nfEaiMg2X3DfvwEUz73pMFOVyjG8MbmXZa5s2sOXQ6n6fn+OWu+gftDi0nq1d\noc3l\r\n=3PUR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6d11b414d4ea43b5c780988e2437ee30c9f1c0b3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.63df6e9bf.0","@material/rtl":"11.0.0-canary.63df6e9bf.0","@material/base":"11.0.0-canary.63df6e9bf.0","@material/shape":"11.0.0-canary.63df6e9bf.0","@material/theme":"11.0.0-canary.63df6e9bf.0","@material/animation":"11.0.0-canary.63df6e9bf.0","@material/elevation":"11.0.0-canary.63df6e9bf.0","@material/typography":"11.0.0-canary.63df6e9bf.0","@material/feature-targeting":"11.0.0-canary.63df6e9bf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.63df6e9bf.0_1614281892469_0.3166057592895397","host":"s3://npm-registry-packages"}},"11.0.0-canary.981ad970a.0":{"name":"@material/tooltip","version":"11.0.0-canary.981ad970a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.981ad970a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6f1875d5836e38284aa868f2b0c54ab09c4a38aa","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.981ad970a.0.tgz","fileCount":38,"integrity":"sha512-eGaeMjrQaLjdJRgSm/1W6WRMyr9IFOwiL7xUhVS6XRe/WVm/WFCwvQcuayYR3KEZKnOi1oljlI2v5dOpafiRLg==","signatures":[{"sig":"MEQCIB2/eb1aQN/rT1gqFssa1WsCoUYFMwK9wOm0XmXFN29oAiAux2828Er9yaijM3VY44DIfjBwIhlYCj1OPmJ5/XyATg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgODwdCRA9TVsSAnZWagAA91kP/1XDIYBF04h3qxuuRPpz\nbWbOm5Zuqudh56u8KDwpqj6IwnSdlYj7ctUl8O+Pjra0bCIujoAzqbHwfyLR\nkt3CQCXmlkXmmaSb+PZIxV4PHVgmJCW9Vts1KgVVvMq+QP/6FnmVwMrSjopF\n8KCyU5wP3FiKeRizC/uU3vrAAFYeS75n4qrs/QzgZiCazckHYG5hjQ/RBR1U\nSoqVlSU3RTj/zudfh6cu8TifKDCJTcMWax7rV218fzftZe+w7rP5rRqbQkS3\nJ9RpSTbBz25GIwe073ydL3vJLrP/SR2+AnAsyiffgzk/0f1kONz4HO1ApZC2\np47AFY3jhD7u/QVMS+nxXx2a4briCFMgMM3S6Dt1C+awuTgheTBNlcJr9bPK\nHrs82Q3/oGDump57WsIoL66jJuzjiTj0AZSI+KCfc+K2Hioom7ectOqfZHmx\nTYB9xqBa+Z/QFfBA2XB1Nzkp1nomp99VBPkR7Vt8b4BYfiPiYc+Oevg0Ss8j\n7Ay83HyKtBavgUyvGoIN3hKVDJtyumS16DsfoeVN1HCdc6XkVq7GedjezMVq\ndbpYPGxEtZbx4ghuIltBF5nzQSGXU8l7r52qS6qh6xupsQxARJusJjkgqRPt\nsvo5wH6nuRvrq7BW1GAEKLDf0pBMCK8ClGiHzGjHx5+P3cGK7ea/Pq7Lwfqj\n+ZKB\r\n=8xCu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0faf6e6b78f0c9b2c63f416ae85331d13aea198e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.981ad970a.0","@material/rtl":"11.0.0-canary.981ad970a.0","@material/base":"11.0.0-canary.981ad970a.0","@material/shape":"11.0.0-canary.981ad970a.0","@material/theme":"11.0.0-canary.981ad970a.0","@material/animation":"11.0.0-canary.981ad970a.0","@material/elevation":"11.0.0-canary.981ad970a.0","@material/typography":"11.0.0-canary.981ad970a.0","@material/feature-targeting":"11.0.0-canary.981ad970a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.981ad970a.0_1614298140274_0.4332669457426763","host":"s3://npm-registry-packages"}},"11.0.0-canary.f9c9e39d6.0":{"name":"@material/tooltip","version":"11.0.0-canary.f9c9e39d6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f9c9e39d6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c601623da5d8c46fcdc21ddb330694a415fce2cd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f9c9e39d6.0.tgz","fileCount":38,"integrity":"sha512-WSFTJc6e7BzMT7mmjtrG1PzyBNFEy5gjuG1LAc35ceHuR1ojwn99UKo1OfLA4k0DbVgEYvdAs8oXqDW4qjGsoA==","signatures":[{"sig":"MEQCIFS2RkqqjgEO/d+FzYiv5f0RLF5uz6JCuXSo4DmMEkrbAiAA1WDvZYycl+5qZ3zi4umKcncn329z0Q4Y2SAseGwb6A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOUB4CRA9TVsSAnZWagAAP9AP/1xK7WynN7oRtAO1BYoh\nBTSsjna5C8rtk0I6GgtwwltR8QbgmKEXez4XgEKESJ1xTgy15yIEaMNHgevp\n/ts5elCa0OEEnrHwGeYKE82OkrEQqXbdIxJLLCgef5uEC6wapjPCY3wfonh0\n05H3mOvlMmPo6ftL8rQ0Ez6RdePih+Jk+4WP2f0NsA1c+wEOUDsT3gt318LB\n44cPT9qlxiA7Cl3AJDMAJVndzJPKYF5ue/O/7ZbeDsXBQIcZ9s4qlQjWul/Z\nRb5PphaDWrBabxUhh1koVpqh8fOjWsnD/MixkPG+dIvuUbuNtLwHTP7aU4Yz\noag/oW3mSbW0yT6Sq142Y8wHpa8a2k8yLd4rKCxCxB0Uy9I9nE7dE2AvS5di\noHj2QJFgxgH6pjmz1EdKid3d8LP7XRGJQncvUnSieYfbC7SFzfiup9o2eZ7p\njtciBnVtXS/Rtqboi+q5W+8uGPwXiJmdLEYaPi8w6VTFS5KmYU3hK7QMrGNi\nB56zzx5mZlC/b/zRDun5IB4E2hZn6CdFYMdzl+WEVSXp3vRYobs+Rshd0EUi\n8Ctifg7uInfaJMXS3UCq8vKKezspk5q0LdQOSsufrwmJiG44BL2dR+jGGuB/\nP/BGVp8ktq710dUd/f/T7ZSNw03dFF3K8nIjxza9GqMu62Mp9YsGGg3W9ePY\nTF8d\r\n=UYoF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"81d489ae3f1defd63ee64de05a2a330040ae6406","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.f9c9e39d6.0","@material/rtl":"11.0.0-canary.f9c9e39d6.0","@material/base":"11.0.0-canary.f9c9e39d6.0","@material/shape":"11.0.0-canary.f9c9e39d6.0","@material/theme":"11.0.0-canary.f9c9e39d6.0","@material/animation":"11.0.0-canary.f9c9e39d6.0","@material/elevation":"11.0.0-canary.f9c9e39d6.0","@material/typography":"11.0.0-canary.f9c9e39d6.0","@material/feature-targeting":"11.0.0-canary.f9c9e39d6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f9c9e39d6.0_1614364791827_0.9611242727258451","host":"s3://npm-registry-packages"}},"11.0.0-canary.c97d7d881.0":{"name":"@material/tooltip","version":"11.0.0-canary.c97d7d881.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.c97d7d881.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5fa753b453ce1d8a6aa696fd8502b1dc296b4a60","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.c97d7d881.0.tgz","fileCount":38,"integrity":"sha512-rRnVun98pircUbEpOsTN1mMg6idQqoWiD0CW4+ZCqCdrQz18d1YpJPh8inA1WHfqFYRFYx2/cAmN/Pm7nG2Y3A==","signatures":[{"sig":"MEUCIQCTfO1VWCPYb8gdsKyAglJPBw0PB0ssDD3A7sEukisgyAIgSogbH27yeqiX7/4KT9G9hH+3GHtFjl5JMk66EaTvC1U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPVRxCRA9TVsSAnZWagAA0q4P+gPCPIAalbBfs5kRCYAp\nO4o3gIc3O3CeW7YGPwyOoT6Lm+vvo0ShHFndt2xZGFwT5YRQLxCgzHxreOeN\nLD39APH18G4dOgb7YwBWp/Ogl3UUdOf2Iog3QfpwG/Qx9AEuxeCs9t5heGTv\nyu7m4n/7tbO74XDgvl76tQtm16PkSu+Cxl0xiMa4N6BNwgCZU9fHutXKS6Ol\nAAjoNkAWYqkOAwcMLOAo0OaYrbRwwTOB2bgq6nDJu47cVNuDsPtgoZLcgWNY\nbgYOfbi3/mXXQ1yxmnU5Gc2FsqxZcIJ4KaDLAudtyrfn38AFhzOViVNES9Pb\nwUMuAwKYw5eulTmvGfPOuYiwH7jr1z1xyDqs8S53AtRZM9sZ/nfTDnR2HvTc\ngEX3kErfymDiLApIJLTG0b6JriaSJHLfS4umF+/xJ7ssvUxV/hAwOqyVO7V3\nspknCBD8IMo+DHsYoo30gxLvSBQb/t6YdKBzUKlnaXE3m3CwJ5s14EPTCoL5\nqX+KAV6BcuZnd+1SFiVOrGJtWP2MsPkvz4Cn8dYyJJENFzcl6tRqklm/Z5qs\nfQ7kQ0NZBpsDKT5ZU75mSuDCBwGYeu+6GtXtmxm0VxHNqoxzkr9e9JbAj3jk\nM6qeN23z3bi4YF0CxVQYgO9+nf3y1YupmNJGs3vdfUNT15OZT7s8CKbRY4+Q\nj/PM\r\n=Noxn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"27a49055320511cea9f431f9c62d44a6490bb64a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.c97d7d881.0","@material/rtl":"11.0.0-canary.c97d7d881.0","@material/base":"11.0.0-canary.c97d7d881.0","@material/shape":"11.0.0-canary.c97d7d881.0","@material/theme":"11.0.0-canary.c97d7d881.0","@material/animation":"11.0.0-canary.c97d7d881.0","@material/elevation":"11.0.0-canary.c97d7d881.0","@material/typography":"11.0.0-canary.c97d7d881.0","@material/feature-targeting":"11.0.0-canary.c97d7d881.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.c97d7d881.0_1614632049208_0.7675889847425568","host":"s3://npm-registry-packages"}},"11.0.0-canary.bf670dad7.0":{"name":"@material/tooltip","version":"11.0.0-canary.bf670dad7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.bf670dad7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"46e993f2d229b08ea00f7f37816bc983ce6b4457","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.bf670dad7.0.tgz","fileCount":38,"integrity":"sha512-rNfLsrtM2PByCKtSa+h4v/gOo9+atm49JbgusAarq/+CgKgeLdi831w+Oeb8/5KuR5SWdJVgi+yTpLXrveVr1w==","signatures":[{"sig":"MEQCID2p1uh+k7CKSkbAnfRbll+1gEFYCbcAHo8Ad3hL+8/xAiAoLa1zH4EyNwMrhCqfaJOxtC5plko3TOiuD1lK95B03w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPtaxCRA9TVsSAnZWagAAhmMP/1GKsJ3W5ci0RD61QC9Y\ngmK5qoNX/V4LbbvePsEi+NjIOCgjrGnH4yoUiLRElfFBLBB+zcwY3h1r985I\nUHMbu+zsbFXK4m4fETbqgGKT/GrKECb6ShdCmyetfLQfvEz7jHbYFIfadKxz\nz3EVnIndCxFF+9CDySFigy/f+orfBSVfAQjJtL8s2m5Z/53cpytEj9YyOO79\neeqAG22nO8uoAk/NYA7mNr9MeVZDsL4TBX2Kk4T9icc0QMRTn8a92tgI9piq\nR62y0GLAAfnZ1c69Uk/vnizx54D3UhoYrVHyajxL48CqAhUA6j23fIO26t0s\nF0cYpwqUCZyM2NVz+SmPLd9cR26q6uylXgDuEPfx/cnBhrheH3idMZ643hXc\nN4QTmLt6JWumFAEsyySXtgKPcvQ7jfxU4DJ5TumPB1pFZD4c5pXD5iLNiuY+\nojZ9TGaWL4UwJ3wSV+7R9HT5m8eZc7WBSFshOe67d/0QbaKloYhWQ7WaCbbW\nAfOU6gJw1wxSIAq2GfjslRrwpOS06VpTnFW4ZFfRTtrDaF0t/EdDcNS7Dbdy\nISyB4pkG2zSQUsfrwPmbeuZupfRHLHwAm/92me4t9d5OzFutXeoF6nbVmFuR\nm9JAeKb2HnUTLDgxvexHj/lP0lJq2MOaRsvqQPepmtdgqx3/7Wfb1FzkCEbu\nf173\r\n=nIAu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"61b03e5331bd5c886de5c4a57a4edc1b53878e47","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.bf670dad7.0","@material/rtl":"11.0.0-canary.bf670dad7.0","@material/base":"11.0.0-canary.bf670dad7.0","@material/shape":"11.0.0-canary.bf670dad7.0","@material/theme":"11.0.0-canary.bf670dad7.0","@material/animation":"11.0.0-canary.bf670dad7.0","@material/elevation":"11.0.0-canary.bf670dad7.0","@material/typography":"11.0.0-canary.bf670dad7.0","@material/feature-targeting":"11.0.0-canary.bf670dad7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.bf670dad7.0_1614730929070_0.4196403233785382","host":"s3://npm-registry-packages"}},"11.0.0-canary.c7d98fcde.0":{"name":"@material/tooltip","version":"11.0.0-canary.c7d98fcde.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.c7d98fcde.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"20d4efee7c45cbe11227ddf26d368e8828859e65","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.c7d98fcde.0.tgz","fileCount":38,"integrity":"sha512-OuvpPFS700KcoUob/Eiy9ORnoONXOW47cewE1hZbf2g83jKsrNsumZkiWN616Up4n1ld581NcRIJVNh7auFJPw==","signatures":[{"sig":"MEYCIQDy+2+VaOQO6et1Lecnpvum/x6RYuU+rd6i/W+d4/ANyQIhAJeMjXU7nG3yuFoWHOgxp4K2oTPfyvH/03tCtG+u7DRT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP/KKCRA9TVsSAnZWagAAVm8P/23sgJ72VCuHlNb1sRRX\nmVToCxfeU2QKsU8lcb2ap2XMugfGOKyfJD9EpMhgNKSCpz2shp3tR3k9HKWV\nzTGFovwzVcJwTCHXUPFPH88H5dlxYHtQ6OFheH09kyypnXAbCSYKirkQkLx+\nnf+L6uI9q7OCuefbCi7V5onFz0fuI4uTwoIewfvk8GZoSAju+WgusRau1iUj\nD7jWBysHyzmGw038ZbiYnBPfCLNjj8+KxRtNd+ns4IKOP1X44ywSPTrxc3wa\nsVnfP5QAf5p65RSJnhaSwG/l2sar7NyWfP0xVe/ETtHKTNjxO+Gt5Nzwnocg\nnFjkpvALta8BS4gHi4ADnEzvkoTT4cRpaAhCpgwawYbZKMvfuxzb+YU9Y51r\nBeEPRsp7SCQqpp5cq9COxWoT7VrQD3N5e9P0lnGKjOv2k72tkGFO5u5o136F\nHoWoRabNRT8CreBL3mgkGO3KS6ILdKdqxWyyiW628CU/+JSgMCkeTgPZaPc3\num1EPjFoMHxgZ0IuNSo8bteFaYVvoGs5QZkFXan1/jQTGEwNkWdKZbINBQZW\nsE041eNBzmUJBG0e3rbfFO8eKLG53uyD+4SN7qpht3RUIzwCV0DMiFp+7/wS\nl7wsHHTQRgZ4MJfvMEIWNWXOLfErkQl2ekfKtZJxBYy3h/HWC5td+wUgyzgV\nrCpt\r\n=g+kj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c5c4c5b417df34d141edcb1fd743d83d7a2b49cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^1.9.3","@material/dom":"11.0.0-canary.c7d98fcde.0","@material/rtl":"11.0.0-canary.c7d98fcde.0","@material/base":"11.0.0-canary.c7d98fcde.0","@material/shape":"11.0.0-canary.c7d98fcde.0","@material/theme":"11.0.0-canary.c7d98fcde.0","@material/animation":"11.0.0-canary.c7d98fcde.0","@material/elevation":"11.0.0-canary.c7d98fcde.0","@material/typography":"11.0.0-canary.c7d98fcde.0","@material/feature-targeting":"11.0.0-canary.c7d98fcde.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.c7d98fcde.0_1614803594394_0.8037202440323306","host":"s3://npm-registry-packages"}},"11.0.0-canary.4fef8bc1e.0":{"name":"@material/tooltip","version":"11.0.0-canary.4fef8bc1e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.4fef8bc1e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"80e80e17cd4d78450266e88b791e8bd3e0408257","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.4fef8bc1e.0.tgz","fileCount":38,"integrity":"sha512-dvx6vjk2gOhQJxPY9eTxShkz57kt8CO4dRbuW8VGaMZZQHrfy21iZcuJAAvA6UT/ZtrGe0daus7R7pGN843ryA==","signatures":[{"sig":"MEUCICB5EUCdWu4gktTm5otKjuI3o8TJkKz7vSmWeOOpNralAiEAtRoq65qVDz1ZSLXze3fP0HvWAWNd2MfGMKzeDR9CYjU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":611994,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQBraCRA9TVsSAnZWagAACvUP/2zmPnsrgKzC11BICyvY\nf8RIXTALT6N+yVKYUnIh7LulT1zK6q4/1xjac2TtBeEwFO4rNkldyjAk498M\nhIbiwfSWC9xn1x0dZxSNbH9uY2nM54B8Y47EmTfyu5OEjHromu7huRYnnBba\nH5ehkOh4LAgwG3xh+3oFxzto2RzthLYLQ6WBkvFL+SxmR6FowmIyDi0bSBqb\naTlRMIw+KbHyabAFiNVPb+U9cuZn7Bf5oEjIWOGLWhbvhS+epCKG6mecM/RS\nRlTNX5v+Kbkvj8EKAsMkiS4doMCFiDYN7IfGppVt0mxaPIo6iCiT8vZgzxmX\nFonf7VxGt3ix4RVNAbrqmh5yorit4xYGuCJmCMgkXGLi0nYVISspZqQ4W6pJ\nZgDiV3WTX9FFrYq5RZDX9cxFlf5SPpBXVH8BDbydBTZAC+uGj6FHJTanOFm0\ntu3o0jCU0LrCWA1LnBi11cocaUTFSSfU1M8rL8a/Giu9lktTM3CmqeJNSRfo\nk4hpV+6YxeyRhBi0UGrro8xkHUb8XSfk/O7u8BC8xb4sZHYJEVUJLBUgHkV0\nmJHjL5oeBLjQ2TxJhuYubpmdn8Ev4YMBa07I6WBYABlQvjUuIawD+C7YG7sE\nPb0il3pO13/LYaHfNKKAyy/4G9Rca3QgEQ0Ci0VUaCy+BBAgDZZOa9QuRB13\nTHCQ\r\n=ZuoN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"933905005f9c16276caed5327bc6ca581afabb6f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.4fef8bc1e.0","@material/rtl":"11.0.0-canary.4fef8bc1e.0","@material/base":"11.0.0-canary.4fef8bc1e.0","@material/shape":"11.0.0-canary.4fef8bc1e.0","@material/theme":"11.0.0-canary.4fef8bc1e.0","@material/animation":"11.0.0-canary.4fef8bc1e.0","@material/elevation":"11.0.0-canary.4fef8bc1e.0","@material/typography":"11.0.0-canary.4fef8bc1e.0","@material/feature-targeting":"11.0.0-canary.4fef8bc1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.4fef8bc1e.0_1614813913592_0.8341546744144748","host":"s3://npm-registry-packages"}},"11.0.0-canary.afae3a3ec.0":{"name":"@material/tooltip","version":"11.0.0-canary.afae3a3ec.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.afae3a3ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d9383e3a7ca509b79c8b1fd168e899c3daed6418","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.afae3a3ec.0.tgz","fileCount":38,"integrity":"sha512-VTcGcixZUQeiSatd7LVcKDCwA3bDQEPdGqFvlDU2fIPhaELYLSV6ekqiAVerEYeRiCy/4q+K3mAWMrqUCTd70A==","signatures":[{"sig":"MEQCIBqM7EX4529Lq11iG756b4rjXuhYRWddXy81d9ch7TtQAiB0LHnW5mHrcSovXNM/sjqXgdcUAnj3NWEii9+Ixn9+RQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":625425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQB8OCRA9TVsSAnZWagAAlHwP/3hjfxFAm/EcQehVsws9\ndOSrp2KZQU+azXmjgqhdV2Ii0z02036lI4kPZHJSHv5DYapUmhmZnXCSI3ZB\nfqCullT98pU082K2kHk3bDk0EVf+7+RnEZRNH5PA0ggf1vv6moo+uw6Xz3Xd\nyd+4bI8xq51O+sTPOZyLAssWCz7c5E03iFT5hPG+yNk0yGQwEHPH6elpMLby\nGprqgDaBdTpSFh1U84get8zrrUWhuiyWQZEWSgdHA4NcQs/WixYukAVJm818\neAhqVH7/WKTF2k6RPVE1YPm2WAAkTfoJsVXJ+YjiHZnF6qQ8UdJkH60Uz7l2\nPPuSfy3RhKj5RAgcbwlp+/ZzDCkbwunC7d3VRrnGcyG0udNHszgb0bf2s/uJ\nA0eFRdITXW1n7cFKTHf7aHoO5ttc9imCE0m5p+pTdnZk9xKrF+Sz8PbE/kJo\n/vyIi7awqwauFb+GLj57NUuCNMdASaFNgqSZTIN1HwnRQ3hGosAdHqPPl1w/\nrY2FbwbgANj71oPRHMt+XCaAKmlmYnsSVLf/bmYSCRHimDAv6E4XvOx0VReu\nTyO2X5bws/Nn3hm6pLIojbiBWmm7fOJ5GWl+sQ296Le9IzdGIrKEDWNAFWIK\na11geoSEObG20+njSlZnb2fTl3P61xigy40NStiFy61uST6HSUdt/yktPgtd\nQPME\r\n=kIFw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"054b07cc588568c82346f2cab8aa8948b77a80d9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.afae3a3ec.0","@material/rtl":"11.0.0-canary.afae3a3ec.0","@material/base":"11.0.0-canary.afae3a3ec.0","@material/shape":"11.0.0-canary.afae3a3ec.0","@material/theme":"11.0.0-canary.afae3a3ec.0","@material/animation":"11.0.0-canary.afae3a3ec.0","@material/elevation":"11.0.0-canary.afae3a3ec.0","@material/typography":"11.0.0-canary.afae3a3ec.0","@material/feature-targeting":"11.0.0-canary.afae3a3ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.afae3a3ec.0_1614814989988_0.4695523600490774","host":"s3://npm-registry-packages"}},"11.0.0-canary.0a0b10f22.0":{"name":"@material/tooltip","version":"11.0.0-canary.0a0b10f22.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.0a0b10f22.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"037f1821b883acd08b3aa4f1e579153f947b104d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.0a0b10f22.0.tgz","fileCount":38,"integrity":"sha512-+9+AmCGdpfhPxTTVTfcG+PqJv0oOKV+3Wb/fds8Msv8jEweEg4r5iEVdNJNxO2mlENuPo85U4RDEH2IqkaCNDw==","signatures":[{"sig":"MEYCIQCyEbl13iet+ecJk2hLR3F1PCktcKmTduHtTjYaYg75TAIhAILiUGYYunSJ/rnDwz+WCGaqlOaaGJYueh2nquV6oiMs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQCN0CRA9TVsSAnZWagAAjFQP/iuzWi3PYWvkCbXbuxW5\nJRygH0QE1SnZX+D252GvT943/PkwHKkKljYCMK4hX0Uv5iSokizahxB/IUuE\nRuXkt6Ci7sCmcxj2nK8dwVtxYvLp/CkNtD0orIWgnEKi8xsv/ws3y8JguIFj\nk9baga7aa3YmIw/3asGdmxKL+iaBrrjRFEC3aEUqCsTIe5uGkCinaYE6/Atb\n+UyvJgw+eeE7KKksAkG3HEtuWRi+fAMYuWsXgN4xcoGz4Zrw6kP7lxIRfMYQ\nuaitZP398GOCrhCizHUh2anZy5v9rJl4dchtrf5qGuHT8yH0VsQj6z4gBVPN\np4fsF0yOyH5oLqHb4tkVFQfcncyVAZ6BzLdgw1C8fm3qWx9QomdVM3zyGrBV\n0EdFUC7KlZjqj90wBXunOiEzic+6TbtB8Lqdr5RE0TtqG4Sj/u9oBHVpkZHw\n8EEhYMECn/RkHnDSt2THeXjapGTRNruVJOAvZ6i2+sJ/eH0B8oYz31XrMhUW\nZ4H56PJKszXZidLpJF1SuxQZqwiQG/TdvkprT7YipSpW0WAnKIKNLwdfEHqQ\nph2ovzQ61wz3jl4nkvYWZ0tgZFZJDF7fzhmyMLfq1fwmdEfVsUs2tMltekxb\nf1en2FG/AM+yuBfk0/K1SEo59x2LY2B05eOohbOzx7hoaI1UETqpovel9BSx\nqy8E\r\n=pUGh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5b560f4bc4c4b50a124c9432e81b3287bd348abe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.23.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.23.3","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0a0b10f22.0","@material/rtl":"11.0.0-canary.0a0b10f22.0","@material/base":"11.0.0-canary.0a0b10f22.0","@material/shape":"11.0.0-canary.0a0b10f22.0","@material/theme":"11.0.0-canary.0a0b10f22.0","@material/animation":"11.0.0-canary.0a0b10f22.0","@material/elevation":"11.0.0-canary.0a0b10f22.0","@material/typography":"11.0.0-canary.0a0b10f22.0","@material/feature-targeting":"11.0.0-canary.0a0b10f22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.0a0b10f22.0_1614816116317_0.01705057432536372","host":"s3://npm-registry-packages"}},"11.0.0-canary.6f678a91a.0":{"name":"@material/tooltip","version":"11.0.0-canary.6f678a91a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.6f678a91a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4b3faab939f8bfd2285cd048dd9fe0d555e9adfa","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.6f678a91a.0.tgz","fileCount":38,"integrity":"sha512-xNPhNUAL+EOVITGaEbesQ0bcR/2feg6tmwfBtslLOghpdGqxfjc8RAK66jCUBeCejMKtWKrxsr5ILvE1rYRm8g==","signatures":[{"sig":"MEUCIQCAUXh2HrM8+JEKAi4fyerDy8v7kJU3dEEiqMl+8lqw8wIgJLZkOVanz+78Vvi50jNgpZEb4MN9AFFUvA9bQgz/XbU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQSnECRA9TVsSAnZWagAAb7EP/RyWqmPMUSY3nb7Yky5K\nH2amTYz1ruLDA68Fae939dS/zVdgx9FIDswjZlfsfuUbbFHpwt2Z5ro/hyl9\nKz+hnLehHP5q0MTHbOQN8z9Or4vy9j2dDtWb71A9WiWRdyPC5H9wAXBQBDrk\n7Sj6LdWZ7jJuj/Apjp/d7M/js/WwhIer6ykqUcg9aO1/e1jGjKi1hOGOf+NK\nMRObWVSkqrYkDP5/eQnbgI0fwztFGCiwCf7yjmm5puFfJRM0vKySxn/1EqSK\nyFzHTPmPYxON5qszj7P9iYFkLX8Wzg7eV41FBwCNgJfoI2plA4yeOXTKM/AH\nCeDKWWPlTuIz3uPzq7OZQFreqb39q4WDxaKQOGHXJFL5Epz1ugOU0hbW2Kz3\n2B+jalE4Q0xqoB/pLMg6oTl3+CSfmeg1PVeglZXsu9mfX2VndcRG7M7DZUf5\n3MpRjPzC2VJ0rwjdbTaLYc5FvFupq+atW/rsM5chv73VU8AGrDJPgc4BOV0P\nYTePmtbxPPTtnwz4cqVtD6rtgMvvInxAPF7VRb7z2vqJqE4xZicYlvQMrT1P\nrq77lTxTmE2ZXU65ZGB26JUJkVALfwQMsytCWxxS8GueV6/rjdU2feowfOca\nRLI7n0cwTkLOITucPGdvcr0T+zLT27OOXuCjAYOfvZlScoB/TQJCgiBXKoDJ\ncz/u\r\n=EfTz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"863e8a04081286602f8b0c9bf446655b9399e8c6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.6f678a91a.0","@material/rtl":"11.0.0-canary.6f678a91a.0","@material/base":"11.0.0-canary.6f678a91a.0","@material/shape":"11.0.0-canary.6f678a91a.0","@material/theme":"11.0.0-canary.6f678a91a.0","@material/animation":"11.0.0-canary.6f678a91a.0","@material/elevation":"11.0.0-canary.6f678a91a.0","@material/typography":"11.0.0-canary.6f678a91a.0","@material/feature-targeting":"11.0.0-canary.6f678a91a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.6f678a91a.0_1614883267632_0.03328065990629936","host":"s3://npm-registry-packages"}},"11.0.0-canary.f5f1b613c.0":{"name":"@material/tooltip","version":"11.0.0-canary.f5f1b613c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f5f1b613c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"71b4cee555c1bf6a3e0d8c52d58981bcd68976a7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f5f1b613c.0.tgz","fileCount":38,"integrity":"sha512-+g1aoIFlR9Zczh/4V2SWVNzltLtjFWbPkzWM1e2SB2tbV9diJMb++oKo6//eLzsbx/hBkXA6k7GSykewqBaIbg==","signatures":[{"sig":"MEYCIQCG87fbBEQXQYoFOXhrUc6nAdZstItUaQZNMbhhrZFoVgIhAJJ47cKzdYycblAeZ5haJpspQyjJKUUYFSC126wu3fdQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQUgUCRA9TVsSAnZWagAAOdcP/ilK8hObB8pvBbq4AlEl\nukzf4gAqRSbD6+XEbKaMsCMKyvJSCne+BnE+hSbvDXQfUq0g8jI1kBo+G7jK\nesayzygb/sDxxDKib6hk8YzLU4v4Bc7giOrg2hY8ciWCIy5fql8GPmMciTk9\nxdKn5tzrqM47jgZyN7QcPNckbsMS8/cDi+0SjPfJk1SYq9vhplo3TLxxgYMd\nEBCyIpxj9/Kx5WxGYGXOVaOMSeUlhvR3y8QViESSh5C926GgtOQ1L7BCHMX7\nj2cgnVsR+rIp3EvHcmdwdmoAM6R4hbQodOOV0tScgoVXxvdk9XFomUw0f0Bk\nwJFFyQcHFz7a/HGszjZMYGOJATb0j5ZPqUa9Z/QDRWWeG5ZM/yoaaCRynSCi\nrrdMHgsK54V2qUbbmvtiUnUuNCzPasAJxgz1gK1hyrYBBSlGmgjKCbNGrl3M\nni4NAVfFOOxnHDGzQgt5YSG8Ce5SyP+e1Gd5BxiqU/pNR+Em1vVL8ynWE94S\nvLzKtFrrgWtb4t+TTKNlDIw8C04zr9HOmRFsrqCT0BEF1KnlWtYERTbG+RK9\nF7qt94AbqZXO8hfoj2aZf+ib5XsHmOvDJuIra6/BizZl5HIYZjui4Krq7BNI\niGCHMJHhoGV4IDoT1AAVAK9MTr1rraC0D4AdETcxlfI1SdRC1I1KU7dvCePS\n7QpE\r\n=wMf1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"20e2000d9ec732c7cdd0b5c15381f0a55f778036","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f5f1b613c.0","@material/rtl":"11.0.0-canary.f5f1b613c.0","@material/base":"11.0.0-canary.f5f1b613c.0","@material/shape":"11.0.0-canary.f5f1b613c.0","@material/theme":"11.0.0-canary.f5f1b613c.0","@material/animation":"11.0.0-canary.f5f1b613c.0","@material/elevation":"11.0.0-canary.f5f1b613c.0","@material/typography":"11.0.0-canary.f5f1b613c.0","@material/feature-targeting":"11.0.0-canary.f5f1b613c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f5f1b613c.0_1614891028045_0.3361465391994063","host":"s3://npm-registry-packages"}},"11.0.0-canary.606e767ef.0":{"name":"@material/tooltip","version":"11.0.0-canary.606e767ef.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.606e767ef.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f914017c31ae2dc636a71790c330dea7ef577174","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.606e767ef.0.tgz","fileCount":38,"integrity":"sha512-0VMK3ueDYlBxqBn5/WRmGTBt/du03kkRuHgD2tssAMqxpipHcv3TwElUVYfsDxztWoPnDQFp3/7KyivdDo2yOw==","signatures":[{"sig":"MEUCIGO9uhGK2VLWACl/+ynjELG+ExwypIbokjagv6wfccHlAiEAxnJp+vXBq6qXW3tTnAW4+solvpneQcwcV+RJCoQZCB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQVVGCRA9TVsSAnZWagAAg0cQAIHBzhzhTew9Q7I2mNZn\nid6E28ydFS73YO3ja4R5kffY8Q+Jk54wNtoQ2DG/Dwz160DKae+ghAUTY8sS\nLbFzXeS+rQG6x9AcS4Q+WYUmXFMfGANHYRSW2okI4y9y/b0wxzm0WIABZgNy\nztdq1mlFbB3A2ZvKByznfARzsRtOUcuEz46xO2kqvYqSC3HlT1E7i41vrHTg\nPIvUdmdzVWlbrd/uWbit3VBUog8ZXYkhC8IXLCdHzTA5I2qPero1IIO3l0bZ\nLa5vLXbtHNzAzpWBpBUMKDRBR8ag57SQdujKwdUBSspYOKcdLhrzPCo3Q0Bl\n7oO3gQYLEAeh8p8zYx+WjLUavFZWA9Y7ZlUGS+S8IPHMB2QOT6dYk0lEd0Jp\nFPoK2jaDOjaCsy9vvkeYrIOrj0yCao+UZ3N7jOSsU4k7tg5DxZfjLLWBaI/S\nMJRP2xtYwCvgVglO8fE2voAiIklqdt87Xjl5BKGqfAMwZScP6DtvFX9f6Hu8\nGIRam75yk5C4v43liTr4pqOul2/8WfCoVS7JOnFUPvHtf1kL0inSYEg8OytW\nZbpOurIzCdmY2ohTw4G0RKmnXlCAmmGUIpN3WJ/h7ds2eudaPGveF4A7oZP7\nVuUSOL088pI+0Zcre6aDB8i2kpdl3khNJferqxapU0A3CRe19/G6RbV80wX7\npsrg\r\n=+L3/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"34c41b3553e1ca4ee49c0c36a1685f3f462d33ce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.606e767ef.0","@material/rtl":"11.0.0-canary.606e767ef.0","@material/base":"11.0.0-canary.606e767ef.0","@material/shape":"11.0.0-canary.606e767ef.0","@material/theme":"11.0.0-canary.606e767ef.0","@material/animation":"11.0.0-canary.606e767ef.0","@material/elevation":"11.0.0-canary.606e767ef.0","@material/typography":"11.0.0-canary.606e767ef.0","@material/feature-targeting":"11.0.0-canary.606e767ef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.606e767ef.0_1614894405520_0.3728492340701528","host":"s3://npm-registry-packages"}},"11.0.0-canary.f77a4dd1a.0":{"name":"@material/tooltip","version":"11.0.0-canary.f77a4dd1a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f77a4dd1a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7427f81c8f550f38ad15e89a649df79576f51cea","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f77a4dd1a.0.tgz","fileCount":38,"integrity":"sha512-4wCc5/gYcGMsofWRxu8m6PlWXUFGAYEs9Ry11D3M1xEKDCJlBxqvLxO2YBFDEyGRmEAZrFCTZ9mE6PT/6lS+JQ==","signatures":[{"sig":"MEQCIBrYxSvIY7F2jXGItBxT+iukmbcdheOtYUDHzwQteQo2AiBgMh4m6HtGguw5KyBOYn95aLKWY5dBsw94q+vCPCI3cA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQwfZCRA9TVsSAnZWagAA2TQP/04eAWL8+dw2JFhT6GXS\nhJrePcDzh28llbEOjgujIsehYNUKScQYG/koBza4WgcNSB0j3wTWvnw10jSF\njrUwXYb98rKkliQsY5kbKPD4UkV5IaifuxnoxpgnDciz0UYFpgZzUN+WUjbu\nraABEpcqTD/14ETXCDgmbXJkOgEozFIyZRk+ZPcICGJGLchyU/IpRmxwiDel\nv6Mtpr2AjSygaID6bfVLcg+ebkugr8Stsk0daP49Mi8A3dvjbI+HpsP/nlSs\n7qAYoK7a19kPE85SL5ddR/S+9RM8clOjHl1NELR5mfMtTuTaE/fdNzng437k\n3CpBUWgnsnol4tqUcd2hoZ0yWxBk8eAHilmMXOUFAAY5loVkDM/8kcWScA+y\npzPxHYUSeOc1xSkviZvDMs7Vv2vw0ZDHefX2fXbhlaVw3CmLh1OYed8RWryJ\nrvxIWtV5mp3zhtD7qHhsRMxPqj1RhVQs4Jpx62gW26vvnn4pKTBdEiS6lmOw\nDsWPKRiNj/DQgV+eMPTURbdwBYYBPe/rN186ZsPqOs6v4oMS0fRo6w45Zc8Y\n1riI2zErNc3XsFqswocixFqEd/k/jBHcbYnpDZWE6gZUTXjU4xhZRxlwVVBB\nxqIiBxf3FvxSVpMZRObMo1mgAjZVMxaU0xFdAcf/yOTBw4uOa4DWkbZ+ceeo\nwTKY\r\n=K4FU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9a729bc3e368dfd8685190e8460ffef16eac8947","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f77a4dd1a.0","@material/rtl":"11.0.0-canary.f77a4dd1a.0","@material/base":"11.0.0-canary.f77a4dd1a.0","@material/shape":"11.0.0-canary.f77a4dd1a.0","@material/theme":"11.0.0-canary.f77a4dd1a.0","@material/animation":"11.0.0-canary.f77a4dd1a.0","@material/elevation":"11.0.0-canary.f77a4dd1a.0","@material/typography":"11.0.0-canary.f77a4dd1a.0","@material/feature-targeting":"11.0.0-canary.f77a4dd1a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f77a4dd1a.0_1615005656897_0.2065241849971886","host":"s3://npm-registry-packages"}},"11.0.0-canary.2d6ba2c23.0":{"name":"@material/tooltip","version":"11.0.0-canary.2d6ba2c23.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.2d6ba2c23.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95abe6544d75be110bad661db81b5f11791d200f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.2d6ba2c23.0.tgz","fileCount":38,"integrity":"sha512-CBpwKV7pxYZhkDer+I3yZxu2fEu6tnAWJEmaKigDqjIu7smuJz+EdH5vocJa+aLsdOTyLAbJr3wXNIVUM1T0zQ==","signatures":[{"sig":"MEQCIHnyCSvJgekOBXEKYxxGxrWWyqpdGJcN8RXTL1DJMFbCAiA6qbQY8s+GBennK1R30EjnAzjCXLPcxxDp4A/9pRxqcQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRqj1CRA9TVsSAnZWagAA2gcP/RloqgdzgyYvPrgt7oTo\nTbP3b78dreSSF7vmpri98pnFMnudVxogM7VxjWO8sLTRRMI1iy54/zMLKV26\n8OWFQUNW807j98Itxu4EXsLkrHr7S3CDzxY7yRNPPsJxGsodj3rUwK7VCeoI\nvH9iRap39Z5ZbYNtEjFyfCsSsEI4pV7sC8TuPaBKzpJgnzJhSrsEAb9J6p0i\nHZD0vAvGyOMBcLcUiwk7uRghpEK+mi6NfY3M+tPnqQpQckQ3uXFgJLspl65P\nUhzecw/STjBoQCT2SbE7quB+XYaoFVXci0rJSdlzaelfzZfraxmrv/p8WKGO\nK0vRzoOx2yiXd0CO2d+dJ7v1ur+9Vwklkom8mwseHR84yVxQ6A7nRTkWJupj\n/4kI4FNS3xgB9tayF3/wCp4jsbIpeptFYyF1BXHfKvjvBmgCPdIfYLyBjOqo\n0bC70EVqAdup4hV/BJUCXGYCG8MDOzlbxqWwaJJ+rfyRba4le/K+I65LaTYb\n5FR3xT7vRU2JntarIeKOI6jY+23Y4iuQR8nhAErSkmSb3HmNocqIU57qrRJn\nuIaxGXQjQy3RTy0jfjXDfimbwqyHjG1E28ivMEsrPO+NEMFcTrulFianQZ4T\nObZsnbNLnOqkEc/+27wldOAMbO4N0v3RVRIsrX5bJJX6wfXx+1UTp0ipR14a\naGMp\r\n=jkoR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a0b889753d981e10bf70b9bcaead70c1549cf865","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.2d6ba2c23.0","@material/rtl":"11.0.0-canary.2d6ba2c23.0","@material/base":"11.0.0-canary.2d6ba2c23.0","@material/shape":"11.0.0-canary.2d6ba2c23.0","@material/theme":"11.0.0-canary.2d6ba2c23.0","@material/animation":"11.0.0-canary.2d6ba2c23.0","@material/elevation":"11.0.0-canary.2d6ba2c23.0","@material/typography":"11.0.0-canary.2d6ba2c23.0","@material/feature-targeting":"11.0.0-canary.2d6ba2c23.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.2d6ba2c23.0_1615243508482_0.17543485854991192","host":"s3://npm-registry-packages"}},"11.0.0-canary.7522dcaca.0":{"name":"@material/tooltip","version":"11.0.0-canary.7522dcaca.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.7522dcaca.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c9d0eae12440289f90fb1c6a625b4cbb4a0a8278","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.7522dcaca.0.tgz","fileCount":38,"integrity":"sha512-Dnt1mVc87ECqVemGxroHfIzDrrcPfUkmWbn/R3pL7j0/S+J7y1kXns/XLWUk5R64CtqIMI1cjZSuiLsxWGQCaw==","signatures":[{"sig":"MEUCIDI44taAzPUB5NM3uguMbmE2bDcUIU9o+7nM0qaHGxsnAiEAoE2CbquFo8pw9MLQGm+X+mw98zXMscWGs0KfjXxNSU0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRsExCRA9TVsSAnZWagAAMiIQAIKjCWro4k0s2gvrDmz9\nmz0jBjxgUm2I3k8ko/X19l0VETI3fvpZqeksNps44b7v/ixWJCGzcWTLwWLJ\neLA7Kml74zljNWxpwEO9YtplXrqUOKj9dwfRhjpq31iTJ+63YyPQMpEccfMY\n+WG/chZ0TwNpEO0AvVeQleDTMFoqPSogJ2tliUsxpAsK0qWlfI3ZFfdGC5lZ\nI2KS9LGYf+Px96iArFXLEF2XcJUGGoiOsHZjfErwkID0368wc/XM1c8+zpBn\nkSRff3Cf3j7P6ybau0cSzt1bBMhjqFk8E0C+D4wfd39wfHlB4NKYcD6X8Nkf\nnVxgjI/kqMU7zAM/PikDDbIajj/CgUXlKNQ4FH+A8xUT+CYri7VC+55uN3KS\n4FTfZMolBIcwn9uXMw89iLDdVIpQ7Adypnq5rTWgZlSbv7+irxY2TruZrtL7\nwZekrxifkbSLF5axLZcIDeD5s5aanjDqr5CJEV0WkmS8VuD0WvT5AEp3Dca2\nh4+2NSCA4abj9yp4YxxWU57k9kh4ckpzEb2hL9Id9WJx1knurLF8DSZ83X1J\nz+mxQbw0pRixzirezE/NKNUSCgfQqePcV/vnpZYK9GfA8rlVfB7T7m1Px/mF\ntqaXSFhMQh/0HoUUHm6Tn7L0X9Qqa83DSgbP7Dg0kszMq/O4tFb3X/UCp8/y\nhJsY\r\n=nLXz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6e73ae404aecb0602a5da37f40b650181ac48062","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.7522dcaca.0","@material/rtl":"11.0.0-canary.7522dcaca.0","@material/base":"11.0.0-canary.7522dcaca.0","@material/shape":"11.0.0-canary.7522dcaca.0","@material/theme":"11.0.0-canary.7522dcaca.0","@material/animation":"11.0.0-canary.7522dcaca.0","@material/elevation":"11.0.0-canary.7522dcaca.0","@material/typography":"11.0.0-canary.7522dcaca.0","@material/feature-targeting":"11.0.0-canary.7522dcaca.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.7522dcaca.0_1615249712320_0.9834544968218633","host":"s3://npm-registry-packages"}},"11.0.0-canary.5c0ab7401.0":{"name":"@material/tooltip","version":"11.0.0-canary.5c0ab7401.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.5c0ab7401.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"83b9416cfebb9e299bde2beef5219d7a5e3f43e5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.5c0ab7401.0.tgz","fileCount":38,"integrity":"sha512-91CytSqRs5ZHQcIgATkTysTQGZ7HX3sATk7hrpdBTuiptC0HyxoyYZNS2G2g0xB9+d1fFU09k5ca1B36PG6VNA==","signatures":[{"sig":"MEQCIG/mUv7MBRkgkNr9apm+sAuCvWCe8zYe/jwQh5l74tLoAiBJB1evj83qlEv5l+dgEfJDUnOAOhZUwCO9K3l4GR3C8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgR/xjCRA9TVsSAnZWagAAIZUP/RYTwawF6j73wXAsIbHr\ncUqrrKH++fHnJl0qqLjZ5/nxN1s7sSsMHw0ykwwd3wmcLTVnsNbbDto/Y88m\n8P7DoiJVtFl45LvfZyMqUp8lVU72oU9mRSqI5/7+H6tTTHTDbuBANv+Ugejh\n5bY7pgXMwxjt+xRsnYlSqnYL2jI9fBp1chT1653zbDsumact3HeFcmIdIHX6\n2Oui6jrWhIm/k3cc025rlaQaOf33/s1qnDaUD9EsPpTXW8sjuNDdT/PNtMck\nIQQs+DCGLrKQMCOqisNJ8QMhRgzzEWJvXZstQR3QYHfQHmpsdqOK4XwTB4rQ\nm32vF7qWThZGSv34PHeq7PSv0moTzX5fz4Y8OOETCp+X9bqOnFs3YRUNTR2l\nDS/KA4SpYmpb7MdGW/V0iez+oDfv94cqLx7OzEUdZqLANjmWtaL+te2hOzue\ncmhaHRcGfztInQPG+LMzR+R7PdMMi8RTfRxen2DyiVFNRJpVj5wYwiyjTXCg\nZZ1Mm0sJO7V018AyxBHowt7PGWIEhECdbfwDitFA9aG6iF7u6/gQDqbDMMNL\njE1IkBMLgfh1MikV8qOPN47K/VCkweVGVd3P9jXdnml/WPTMIqQYLF/7xKDQ\nx0m7nsDR8VvI2vBMMzyWtJ85GNzCwBhbL8V8vx++9Uf7WNgQXtbtAdIWCvDD\naKeQ\r\n=XS8C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"95ff5a1121ca15128776896b8e4759594ec51246","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.5c0ab7401.0","@material/rtl":"11.0.0-canary.5c0ab7401.0","@material/base":"11.0.0-canary.5c0ab7401.0","@material/shape":"11.0.0-canary.5c0ab7401.0","@material/theme":"11.0.0-canary.5c0ab7401.0","@material/animation":"11.0.0-canary.5c0ab7401.0","@material/elevation":"11.0.0-canary.5c0ab7401.0","@material/typography":"11.0.0-canary.5c0ab7401.0","@material/feature-targeting":"11.0.0-canary.5c0ab7401.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.5c0ab7401.0_1615330402948_0.6762946012766011","host":"s3://npm-registry-packages"}},"11.0.0-canary.59010b6dc.0":{"name":"@material/tooltip","version":"11.0.0-canary.59010b6dc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.59010b6dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9d1b4d9a1b0e673866a8103927bed2bc95fa5cc7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.59010b6dc.0.tgz","fileCount":38,"integrity":"sha512-burDeYGTqNOysZp/WCtMOfa9A4EV4okgXC5kejQS3RKMqKWK3vyw1sFWKbumsrxAkZMv5wm/W0PQvLEK3AR1Rw==","signatures":[{"sig":"MEUCIQC9VRjCHn+2/iiKJus3Of4P4x+PXaPJ5tYq4h+kcYAQdgIgK4Ip+O+wB+OUMZJMBmHzqVpvm80JG7lgcnLjZVEz9s0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSPq0CRA9TVsSAnZWagAA5x8P/0nMeG1G4kA0wNEAx65D\n74tJg6o3fToZiAlSXiJ55RlEjNY9l8WSj11RJam6rODr48NQnEyB2Sus3uLy\n2UV7CjNUwoRy6v0G/zY/6pLB4MPx0jzT2S9KmPAC2sp23bzmtC2hFIovmvCe\nKqHOIfxnCh0Hp3tZoTV3PdObxESavOGKy9+v7+9niprF75UqWoxoFZt+rdo4\nFq+2JblgaPut3M2xIanJTrFnihwmbcipdCKKdGFW0R9kLhS2fMEWiBddTXu4\n1d2EIqIW9VRozgGOB9WuBjUz5nUvZ5zUIwZUFjDqXcGW5Fika4yS1F2f4yIE\nc669+YIRDbvW0bEXv6yhUvDXQUa1+S5CN5f0fRjg/gubh8p4FKNOspFDNWoQ\nu68hp+2LbFApj4CZV4biv8COBH8gdwPqp2KTt1iePI4myRUCbTrR/sd5qLBo\nQmvPEak0X1Iqg41F4FxZ6BhbKWiN+84zhzsIu8nuxrlf/E50DBfPS1yDnKdZ\nN6puTrMg3GhhoRfhpToIMjbJCcQJkrbbkF9hvrFoLgitQ/B4111TnHDlbx8t\nCaHL+bnH0Aa/ZBBjxcXqyTchfAObdEeobDnp43ZV+eaazYpnjsC1bZnFbly7\nyFFTWVb12Tr9sTHbKrFDcJ4al6uxNLyqLL/Ht256kWDF0gve7d88WDyeTM18\nUqZX\r\n=WePt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e697574285a5102f4c1e5002a85ae33a3bf2210b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.59010b6dc.0","@material/rtl":"11.0.0-canary.59010b6dc.0","@material/base":"11.0.0-canary.59010b6dc.0","@material/shape":"11.0.0-canary.59010b6dc.0","@material/theme":"11.0.0-canary.59010b6dc.0","@material/animation":"11.0.0-canary.59010b6dc.0","@material/elevation":"11.0.0-canary.59010b6dc.0","@material/typography":"11.0.0-canary.59010b6dc.0","@material/feature-targeting":"11.0.0-canary.59010b6dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.59010b6dc.0_1615395507674_0.539719600421813","host":"s3://npm-registry-packages"}},"11.0.0-canary.9e52f5544.0":{"name":"@material/tooltip","version":"11.0.0-canary.9e52f5544.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.9e52f5544.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c6756485fd16b87921f2ffdb6e43fc4d0e971526","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.9e52f5544.0.tgz","fileCount":38,"integrity":"sha512-ozGOyBEvEOtDyoUFTg3T9oZ43jxG12Ev6aIDddVj0+IBeRRcWMEPQooI7azF7Ru9fgjZE3FvoNl/VLVhiXtCLA==","signatures":[{"sig":"MEQCIBq2uEzaUnsk6wswwreTcDBsrbUdDbBzwWPoAmkDsBx1AiBVdzYYKGSEn3cNz2Nh6Gzn1VIi1c1MCIO0fzzPkig9Yw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSVWNCRA9TVsSAnZWagAAnTwP/20Ji3rYNBA7lNtqaiy5\nkwr5L07OVB6U03GTRR0mmPwOSk8lsQvIUIhLIf9RfUCr8nfUJgDHAEW2U6c4\ny0x73jJ80hDb/EC+ISZaowuQ+GrJ8GB501Z+4m15e5ixu2/MJE9+xEWVmBxS\nGy8LMrGCVenSAMTSeCXJtEbj2+JYa6u4jIGPP1FGw3rgP6aCrH2rsxbe6Rk6\n9h/UhE8kRBSB6PxY2ZxQgSLw/7OvXjvrm0Is95EDD++86b8RaSgWjY41MuYM\nEyUlijBSCn2G5Sxgm6C5Rg0X0pTPYue3T1OyLU65bWzcSkTAOkXbmhDZeG1X\nrQIXzXjeNpnyFFbjng4mi0HpMv/1fAJOo13WV2cuOxmigloYgu9TcGaj3Txl\nxD8BHSYQLWT6p9HgC5dBzmSda02rjn4xXd1iy9GNCT55ePSnkkKBAJEe2c4T\n5c/SR3R08mrkC/5QAz0BwxRCygXZ5Zfrwh8RYVITL9C4gImHbccjL/MxjKaj\ndOSson0YJ35GDClKJO8p6aS5lqTmw1wqWd0VgLQwrCp2PtYl49PtbXFQXFkR\nXXAdEeCJRgDrkW2saItKUEQTdEGOkYCMjMFWxtWNUhvpC87fH4QKL677rX+M\nSuEJkv+Snx3zRrwz4KXjuCRuO+Swn4iKtC/16CBYSIZ6UXp2FNAVcYqjJwt9\nNLah\r\n=Zb/U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4763f125770ec8e3a6ea4d8f1f5f607371847e45","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.9e52f5544.0","@material/rtl":"11.0.0-canary.9e52f5544.0","@material/base":"11.0.0-canary.9e52f5544.0","@material/shape":"11.0.0-canary.9e52f5544.0","@material/theme":"11.0.0-canary.9e52f5544.0","@material/animation":"11.0.0-canary.9e52f5544.0","@material/elevation":"11.0.0-canary.9e52f5544.0","@material/typography":"11.0.0-canary.9e52f5544.0","@material/feature-targeting":"11.0.0-canary.9e52f5544.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.9e52f5544.0_1615418764416_0.5508974540847575","host":"s3://npm-registry-packages"}},"11.0.0-canary.a678806f5.0":{"name":"@material/tooltip","version":"11.0.0-canary.a678806f5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.a678806f5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36a836cab5e7bd8aac56b957bc6a8bc6c54ff98d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.a678806f5.0.tgz","fileCount":38,"integrity":"sha512-ve5UqTpqslwhxP9OktBAVXGk22tHQ5wVuRDvd2fABGbd21zWV8scLyB7bKcl45CT3qDJSgJNJUczXPsvpd8YhQ==","signatures":[{"sig":"MEYCIQD+aRX30HgJIkNoN5vbL+5uJcCgdmNdgbfTXiJsGbAmlwIhALQWOtQK8rPn01LmwmbluvRRxrAwjJJ1Y2hE8hUHI9K1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSXd2CRA9TVsSAnZWagAAvksP/A8sEg9pJ+8Q6n3OiTMQ\nBle8ao06k8VaiF+/zbPr8kzxjUNZ6LDN9SrclXqq0bVbGYYN2jpkLFCWRIyh\nIC74BNTDsSZ9sJ/mQOPWEpqqMGkBg+mG2RzqhHWz1tuFQuRjrl3otPZwrwKx\nNGSjWXBsEHawwnsfkdJf1VrHsD8hsV2xCXfN2reWc1jBlnVO8llJkaMTNyT9\nfyep8Rd2IXXeuXyBHUKw+/0qKlBtLElicQC5vWmnbpI4NtwOAzyEokqrLigB\nEpyU3vjNUrnVb5q9j0dUFr4GsKEuG4uIJuuPMd5MjdpPU0NUXN9ZfFS7ALjX\nVwUg5IpK1n/zKJkUwPehr2J25h8zUdidiRN6b8kE3Na2U/upWfPx91ORb5f2\nNA4DD7QeDQARGZXwvZuVKLymPgL1k0xlnCF1KqYZ0C9+tVjG7sunIt5gGLFa\ndCwDkYAGJXB4kgTFpQHXpZzWekIm1FlK8mgm2S6LZ+/Z2fAAipoMPYiZONhG\ne2k2kzX/81BuEsOi3b1pWSva9cxAV430vHuoPSPi0woGvOO/n2k/dn6PcoSD\nOljkCU2LFShhvI6hwkeqM2BqSILUkTpSmKfJdFC+bQTLKX5TmQf9g4IDp/gX\naktmnpM4Msc2jh4+EGqYxgnYnon75GLly1hXrlzO7+FObho4uhu1dJlxBA7h\ns8Pf\r\n=lZRr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a724ed1e64d54989ee4c27c71935f90fd5614f3e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.a678806f5.0","@material/rtl":"11.0.0-canary.a678806f5.0","@material/base":"11.0.0-canary.a678806f5.0","@material/shape":"11.0.0-canary.a678806f5.0","@material/theme":"11.0.0-canary.a678806f5.0","@material/animation":"11.0.0-canary.a678806f5.0","@material/elevation":"11.0.0-canary.a678806f5.0","@material/typography":"11.0.0-canary.a678806f5.0","@material/feature-targeting":"11.0.0-canary.a678806f5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.a678806f5.0_1615427445508_0.6642294184648878","host":"s3://npm-registry-packages"}},"11.0.0-canary.b2d22df5b.0":{"name":"@material/tooltip","version":"11.0.0-canary.b2d22df5b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.b2d22df5b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"74273b90e132595c7752ea468989bccc42a35022","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.b2d22df5b.0.tgz","fileCount":38,"integrity":"sha512-JWf93QoqgpFQjG5BSi/Ohx43uG0QvV+atpge2SDk9UvIpXcFeC8hVIqkJ2L8b8ROxTp7nZeUhQJBIytuZsfvyA==","signatures":[{"sig":"MEYCIQCAbTnRJWyJdQD6ENa34NOOM0ZKuLIiHXkmiCI9NuoodAIhALJrKkVCGfs5pKKJ2vmriwk1skn7sWh1BLU2QiCNnaAL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSk1zCRA9TVsSAnZWagAAYcIP/jFpF+8DlnGhEqIT2Erw\njFQZKiSvJEIzK+Q8l/b5W/ddnsLw5jaXXqa6CRD3bXwmEFTFhYEE1TUkHnYn\nQm6t+nGn13oCGblnBr26IaRJ6wpkqgJAImuKM72QOByy1r5hajsrHrAnKtWB\nLBigKTi7k7r4e0PPLYX1f10CzJwcRKCZtax3pyU8f97AcK6iryOlGTHSL/mf\nVFUswF6CNm8Bz4gZbIBc98evmOJIgzqX4BXXqOqwTTBcm7da1tb2Z2YYzjMQ\nDvvnYavHBhZBC7ocehtXCsybQnKNis/t2pugsNkt8OOy2Pt6BR2UET6dhsgt\neulvmDWPXiPjTLdeO2fNd7skMZBR639BZxPelWBkRGhsfCS4eJ/A3IgsC484\n/LM7sPLVR1qD89qfXkr6T1AQgk+29ZLQYvdwxYeRCCEPf9mSbqjTmNcHMAjZ\n0+iuh+LcWkeQbtWnSQOwIXcPNAdparzAYnlYKfa58ypeY/xLLe6ElPHz3IaD\nBB/uLb4JUDbci1Wh/lpLRAMFDmTI4Jkj8OJ80icucrQW4eLfBOlFroYiM6Zi\ntnBzdwtc3HKaEaAtUSfGrPXfDbig/xkEwDX4LwJlLEY+2vy6AmYlkNGB5IaX\nxeSiCRCBdJl1N28w8vl6EU68gQbQCNOs0KPatKjgcEWEQyAJXZ6Ug263E81X\nhYLu\r\n=38/f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5c38fa8d841f5b293e55e4a22202bc6ea8220874","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.b2d22df5b.0","@material/rtl":"11.0.0-canary.b2d22df5b.0","@material/base":"11.0.0-canary.b2d22df5b.0","@material/shape":"11.0.0-canary.b2d22df5b.0","@material/theme":"11.0.0-canary.b2d22df5b.0","@material/animation":"11.0.0-canary.b2d22df5b.0","@material/elevation":"11.0.0-canary.b2d22df5b.0","@material/typography":"11.0.0-canary.b2d22df5b.0","@material/feature-targeting":"11.0.0-canary.b2d22df5b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.b2d22df5b.0_1615482226487_0.3566261244417579","host":"s3://npm-registry-packages"}},"11.0.0-canary.81911b707.0":{"name":"@material/tooltip","version":"11.0.0-canary.81911b707.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.81911b707.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"803be65ff97c39d5fa550d2c5904815917b09d80","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.81911b707.0.tgz","fileCount":38,"integrity":"sha512-B4VHVzsQz5OQ8zE2YQ/JuETx1a7A79cqKrJ5mylDDS6pxrDqqI4fsAphtYMFl62ON12GIjbUsUQ1ZhC0xt4jeA==","signatures":[{"sig":"MEUCIHOXt1zZRsOel+Y+9oMBkp4k0sECqpZCGeKdwmU3H+LsAiEAn6QNbkbH5YwAxlWW4l/qn928Jsd8agRLfyd8I4TqI9w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSmBSCRA9TVsSAnZWagAAgB0QAJquLZxZKaevSp/+MlIp\nbjkhoxz3z2TvakAkIFfXg62cWau9lkWozp6xlp83KXpmp0huLVlkRYw4+FTM\nz+K82qjMjli3C0m50f1no1Se56qH/NR6soluZ7J6G9zjObnWq1lfe+CmUUHb\nod5hpLxVXA/IXiIb7knN1n8aQawOtSucqK9/j30qjl6IAikA8EvfrwQRn9Gg\nI+lIYBiD2NJyCuCI0mtHePgVJqMbeULud58F4FJZh3I/CIxKhLRO41udV5x/\nnw+DtaU7tieS/Zt8YHqctJBRPflEbmmBbT7Oo8JiIilPgcxin7HGPMtg/+3Z\nW1yxhpt69F5aGQIu17Aey5Qrb12t545Gmu8r8dh0eGGLU9eRMALg0ZBtGah9\n7Uq+AjMFUEMUhCjZp8C+EzHcu5zyGF6KRwGge6LFO+M3ZqCI8iMU27urRsrV\ndv9anbHCyG2MougAEtERxqx/g1S7m00krJu2MegkGSHoPzGDN0lG2iPh3207\n9aCSZ99ReGEPvkBV1JFqqgEK/Nu5mk9DiHWFKrN6kddC3EuTmZGBlOZuTRQU\nvz3a+462O/5DZl3PjAYFTrMU/xpDvO3MYfe36j2hMIRWymRO6UlWLuM/cjki\nTIceYm151eSZtL9KzGYXIhHXrGiwBaAUhL9YOKsD8lxBlHm0VY0eAHStKhwV\nAfNi\r\n=QJAb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3c1bd5b1d6d6453c4f616633e1d16b1fe0812814","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.81911b707.0","@material/rtl":"11.0.0-canary.81911b707.0","@material/base":"11.0.0-canary.81911b707.0","@material/shape":"11.0.0-canary.81911b707.0","@material/theme":"11.0.0-canary.81911b707.0","@material/animation":"11.0.0-canary.81911b707.0","@material/elevation":"11.0.0-canary.81911b707.0","@material/typography":"11.0.0-canary.81911b707.0","@material/feature-targeting":"11.0.0-canary.81911b707.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.81911b707.0_1615487058447_0.9911011805321226","host":"s3://npm-registry-packages"}},"11.0.0-canary.9eeb35c38.0":{"name":"@material/tooltip","version":"11.0.0-canary.9eeb35c38.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.9eeb35c38.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f19b617bac40ad943a3f366a0d6803d620dd612f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.9eeb35c38.0.tgz","fileCount":38,"integrity":"sha512-g5J632cs6QpVH4R+a7WQWtplBMqaqxNZ/hueFl6VDP/4dXrjYIQBcUwZt2vdFWia3NlsSbZ58UVYpTNHt5WN8A==","signatures":[{"sig":"MEQCIH7IwehzejCYknrlJQawZjbGspPqWhELNHq9QYs2dXLsAiB3JKd3JZ758T3zE0YevZdGqg6OAF/KbTVdBFNzFNqZFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSnGNCRA9TVsSAnZWagAABlEP/R28jkA19fZVrZpWYgQ7\naYktN/87YcxqcmarigWcokW92fJTUuiIlqAcfNfVjmz4AKtEOJ3r3vbZiirU\nhJF8QGdBEgsfHk7C0VCySi/Oglhrdn3HAHsyhJhnZdpSZJIPBtHPJAiVxqKC\nCFi3TzokLJwzPmpBJMdK5jDqyj4AGZEiefheUfr8xkGcfaxl2OczEPKA/3fr\nnVD1NZhRU9F8mEgsSoF3ElgbA9CHfB2KPvXw0i+jb9jo1Npat6BHCuCH118h\npEIRPPXIM9oHA1PxsCyF5Ec75ogQOuT6ZCf94OCK2wy8Ohlsw82gkvfuDYP/\nPTAz11Sr9KaPGtHZ1HDVxW8ndNi7HYW9KSyHXcaLZXcWpjp+Sscs0J4e9cmf\nMCAvx7oDz5wTliHHjIHWg0r+lJqx9j+VRSYCK4UfM8HtIQCpSFPrIKQ/5pch\n0SwBfNZzP1VSzAr/3keT8nyryImGd6YA8IuJG4s43HtCa5wU6/JuPp3hqLmF\n1zdfMvkpLmSC50QdEBh4IERZHu0osIergwKbI/XWVtuC6V48d6wWXMYHbUIz\nWgmJtg6t3sqefw3tS0W/k6/sV0WZKhFIHpebKZ/9tGmntF+OkboQnYCR15SP\neKdRiRmWgkQE3ZAS+jouzWRgi2LIjC2l5JV91tBOL8ajysU52Jq2yJjJ9iNS\nVG9x\r\n=Wunv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"147a2a556e5155bedce0b0f267f64c26cf87d0bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.9eeb35c38.0","@material/rtl":"11.0.0-canary.9eeb35c38.0","@material/base":"11.0.0-canary.9eeb35c38.0","@material/shape":"11.0.0-canary.9eeb35c38.0","@material/theme":"11.0.0-canary.9eeb35c38.0","@material/animation":"11.0.0-canary.9eeb35c38.0","@material/elevation":"11.0.0-canary.9eeb35c38.0","@material/typography":"11.0.0-canary.9eeb35c38.0","@material/feature-targeting":"11.0.0-canary.9eeb35c38.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.9eeb35c38.0_1615491469510_0.25977714868643664","host":"s3://npm-registry-packages"}},"11.0.0-canary.12be3e95a.0":{"name":"@material/tooltip","version":"11.0.0-canary.12be3e95a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.12be3e95a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dc16bc9491031db4e6144a4200a0b784590009ec","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.12be3e95a.0.tgz","fileCount":38,"integrity":"sha512-PI7bSaOSlpvB8dX+ZrsAuTS3i34wHHdC9i3N8sOXKcr9I0Po/rs0yrlDR7dJv+65TZ8ixHFh+ucn80I2NAKN2g==","signatures":[{"sig":"MEUCIQCHGFrodrzWynaudNIc5GMisRf4/U56Zhl+Ntjr/pSepQIgSstkD3exq8xq5kaxSu6CgfNzrpmKNYzRRWSMidBExGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSndWCRA9TVsSAnZWagAAZVQP/iWf5sZePvSMzBPUkM5E\nrG1a0eNskKd/QrRNVOjDGzcj6vO/HdUhhFMZDoAdroPiu4AKIF388xDclubb\ndQ08mJwpGbXzugP/N1HDDqedyQtFYWTkXGjFvGcXElm4r95wV43iqHz+AbMD\nLQLLmtqqCgHyo63exhz6I66+QUxXFtR+nxyEz9B2FnLQ2cfeBaZniwcfr45g\n4pI0/q8uMbbgd2QEuZEjlkOcWUCerRHH8vDMW373ST2q/zgkuoXHJ98bVE5R\n4HfN4B6OeUA9Y3vsH5NFxloYTrfh9iz4XMurWY4iPVkNO7Irt7QKf3X/vYjl\n4Dd5onWyz5PsRHYy4RBWmrE8mPhhl0/rCT4x17Nx3uNzfuUI9W4CPYQ6g8P6\nzgqnQo9EnfIKdDQ76dv3Cg9Ya/SZtdxpQ/IKS3q1ZDgz7ydTR2KhzsIRfFwM\nfQYZ66bMEWOVC6AiJpub94ozOdLJtyiFymo6r/C/1jeYkmBridPFR1Ntu7WJ\ns23Sjw5LF2MzgArGKKBmUCoqZHTbwhOd3Zui7E5lB9XLMDyhn1TWwUoiI/9K\nBu56pSg+GT6ZcCBeufGp5XBcxsJKbkIJ3MW1ulExCzefeA/rPky1zDfJnXh6\nUV+X51zbcGZ6YQwA0CDCSmrvoC4ikJNaMZdpSpIcXOTLgV3ZKGDAMagHFWiI\n9ud3\r\n=qy0W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"883077446617b632d698e09818dc9d5903a7586e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.12be3e95a.0","@material/rtl":"11.0.0-canary.12be3e95a.0","@material/base":"11.0.0-canary.12be3e95a.0","@material/shape":"11.0.0-canary.12be3e95a.0","@material/theme":"11.0.0-canary.12be3e95a.0","@material/animation":"11.0.0-canary.12be3e95a.0","@material/elevation":"11.0.0-canary.12be3e95a.0","@material/typography":"11.0.0-canary.12be3e95a.0","@material/feature-targeting":"11.0.0-canary.12be3e95a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.12be3e95a.0_1615492949851_0.6446711545904453","host":"s3://npm-registry-packages"}},"11.0.0-canary.e683bdf4a.0":{"name":"@material/tooltip","version":"11.0.0-canary.e683bdf4a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.e683bdf4a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a6214246b26c43d415ae22fe04ff8205cbc93045","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.e683bdf4a.0.tgz","fileCount":38,"integrity":"sha512-KiEYRmdu9OLOtZO0n/mjz3PuzhjNvLAf9hXOB/Q0rPRYwLFQKMkld/63wAZy45k01HtLtJaVO1HY2+hx7ELeng==","signatures":[{"sig":"MEUCIQDPkqofE+Dpn1JNirFKcjIDB+NxqBIeM0HTvJQWjS4rqAIgTYgI6GK/ud2vPMJsaAVZk88dGImUohECLcg1b+m5b74=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSnkbCRA9TVsSAnZWagAAjasQAISPnhotB76FBKK0NAmu\nbgc2vxp3JdikOiILmLt6IPetS1l30mkgiqr9j2DbXy55DmN58KIeGdWBvMzg\nYuuzqdIQ0WGw3jSmOD8qxvpH0WveAEFicvpsOfrJHYr0A7yAUJ3swniJwOMd\no6hPHptTzANKRh4L9KWgM2fBh5/3Gl1aAtJvoZ8WMfz36meQioSiA+5uCVEX\nO7bATAnmwWwXDqJw/qFFnQlODmWGQpIAycOjrHTM0iTGqg/CVu+96jKmw+PS\n9Pszn8m8LUxiCS786WHfqi/v9h+UX1dvFNlEhqR/vUyEHTfCdHQpdGomUQuE\nCJCPWDFq38ehkl1zaqYUvoQy7zQUchktUW0k+OQr/MHN4fsW7u3bBVriXx3g\nMq0HzUCY+kfjCBvWl2MC5JCu1OMR0CtooU6Sejr3BDQAj3kFPYAMLJf0OmIP\nKSCnL7W43gmrRZgxKdGvRS6HUs0ePXlPASi3wlsWJg365nRx6O69xikPdXVR\n+vuDqOpme6tH0xcm+vHx+hPu8o2qC7AMpk5X8FJfHUE5RpGyCO2vC7+1HiyP\n2BvcZpzoo5RGRsVLL7OKWQhQwVjKF1GWuiDs9EqcdV7BrxeHmDj77Hvpdsc8\n96kfn7rmmafgDxkeXBjDn+DGl8m1FlcJ+nS8PWC4405xbhKS1M2SbxmyWTwc\n5pOY\r\n=qyF8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0323fd7f39f825f8717fba8542628d111777ae35","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.e683bdf4a.0","@material/rtl":"11.0.0-canary.e683bdf4a.0","@material/base":"11.0.0-canary.e683bdf4a.0","@material/shape":"11.0.0-canary.e683bdf4a.0","@material/theme":"11.0.0-canary.e683bdf4a.0","@material/animation":"11.0.0-canary.e683bdf4a.0","@material/elevation":"11.0.0-canary.e683bdf4a.0","@material/typography":"11.0.0-canary.e683bdf4a.0","@material/feature-targeting":"11.0.0-canary.e683bdf4a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.e683bdf4a.0_1615493402538_0.772273179057325","host":"s3://npm-registry-packages"}},"11.0.0-canary.a07b6d486.0":{"name":"@material/tooltip","version":"11.0.0-canary.a07b6d486.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.a07b6d486.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bf85dcab40e9409c696c4bfd60807519ad6ae79a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.a07b6d486.0.tgz","fileCount":38,"integrity":"sha512-soqF19jlpn35eE5YelnUBhnKAuk9reTYvTQjTAv8fei5+KJRsSeHEn/m91qirL/Q5r/4Um5anlUc1/SkpkW4uw==","signatures":[{"sig":"MEUCID5WNSk/rrGfgaJclVG00al1pnvqSgMzlevqZEKXHVMfAiEAobsVMPLkJvuCOQ9ZI1TKLd4hHAmVs0wr/smRcOYVZCY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSn7MCRA9TVsSAnZWagAA93wP/RCWkge1ZWjB/y7Etmo1\nunMFRzr4Z2f/1TFVAYvAJ2OnH6wb2kZKmZbj3wdRAT4vvgPCkyTWsn57u9GR\npx5K8PVrgDd3NLkPtdJTOIT2Q142XWO8J01DhThMS6wRlFUbwXp5Do9FC3Pj\ngJ24zZ5fGueRMBgz0y80+2ZHzMyEowdZ9+zucRlOm41JstcURHJHFZnpTspY\n1JRQMiMlARNVpi3IwcoYaHQqYqjIZ2sWanYMAbhT7pWc1an4vz3/ZC+G1WAP\ny//Dp1QwZFZTuRy9ANr0A65my1j6mu7ihLt90rCAD9TD+d88/uGMgKUMUU6H\nW/D5KIbmzRhK7pDSXTVajP4Y0oHVThMg9MB7jCPaEjSVBj++LXXL6Nm10yIY\nVgnW2gKivBnavLTg6e/zyj8X3DJ0utrMTc4cvCt2ibEwDVcejs0hw+EmcoIp\nDgbHFLinvYmXJtf/izy6lwjwYnTUyjSaBQCSoKAqTL+aIbRA0zGdYNnZnLH0\nPZ5jpMCrvQx7HIoKcopLMeaYN6lPewAx/v2wWkBz4DZz/dkc2Av1nvE2g+Xb\nJ3zqWO1/xWmIymDH1vsZag3OeYA6HWxQOH2guIua5emNDa5ttxjgH3BQR99G\n2v+VilolSY4QQRvjwqt3aqswKDsUsAm0rjMhX37UY6WVrKqnB45fX6ij2dG6\nwk7m\r\n=daPT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"425bbecac77849f8786f0a32de18a168e1874c9b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.a07b6d486.0","@material/rtl":"11.0.0-canary.a07b6d486.0","@material/base":"11.0.0-canary.a07b6d486.0","@material/shape":"11.0.0-canary.a07b6d486.0","@material/theme":"11.0.0-canary.a07b6d486.0","@material/animation":"11.0.0-canary.a07b6d486.0","@material/elevation":"11.0.0-canary.a07b6d486.0","@material/typography":"11.0.0-canary.a07b6d486.0","@material/feature-targeting":"11.0.0-canary.a07b6d486.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.a07b6d486.0_1615494860245_0.15070700565275352","host":"s3://npm-registry-packages"}},"11.0.0-canary.1e0653477.0":{"name":"@material/tooltip","version":"11.0.0-canary.1e0653477.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.1e0653477.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f23f120d822721835350e080cec95ab3234b8b73","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.1e0653477.0.tgz","fileCount":38,"integrity":"sha512-Kik2KT4C4ViQAbb9z+cWs9oZW3eXyAOjaPer9F6hBUoiwjkDOijwmAgBJFjbmKtNZ+PaeNF5IgvS2iTNgKrMtA==","signatures":[{"sig":"MEUCIBYZtJjfPgTFOaKYHmqxi33LVI3d0n2ZWa3XOwzIAhJFAiEA93O5t+WwQXlX568KbJIUzIQxIKZ9136p2QmqTXxVzEk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSoB0CRA9TVsSAnZWagAAFZkP/isTvbQex+q5s0b4R+Q7\nUnkY5HP1kGOt8DAYYdYt79HYLLWdcukRiZlvOIVRRMttmLoDXFdF66KvQKX1\ndStMluzHlp9RDXUYxx88wt2vt7NmvCHrhySJZKu+31Pb/u1KdWJz6AXkrQ+n\n8zVuhOgJhZos8Hjoae1fkhn4e3Bjc0FcKq8lz6/BtL8/GNHENAXbaHoWZGxa\ngAtp2S8UVtieHAlXrD+ggDD2JDrLDg/llnJtmMaZT1QK4ZFoZazm0926uOX+\n/7A16XTrBZDmf+y8iq+F/3qaq4Gh5UtCoteGZXmKrcgln5sviKoWXFBnDmFg\ntbcdPHIN6BFxSVXJ4jwtl4J4riH/tJwRWMMpY0flzW1lOMDh20gcMNUOQhq6\nD8tKDJthO3G3tcIQ6e2kpQmDsesbeA3ofLbKLaUdUzGNE/L/ROTk3FrOz49v\nQ4WLwCYwUawnnKDTbMoY/k3+PElOdr0TT9IGrZYtOtqiawvqGU4HAkIDxigo\ngb5ve01kQWEgHJa19CcROWswDlk8sNKxZXELn33Qlx8FVv4hSHiBO31rx4sB\nnoeA0qrj+0f4Pawqa34ULlwY4zEbPQqxZ+vNSHeOmWyzEuJSY0ljNeWFp6mm\n/JzQMcCdMmZM5hMfIflb4rlaCy/MxZ3YGBYGQljdzoTR7lvElkuDPMUQ3XkV\nItwd\r\n=CKEk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6130e0fb82d7c39da4ae1e02df8f0851da419fba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.1e0653477.0","@material/rtl":"11.0.0-canary.1e0653477.0","@material/base":"11.0.0-canary.1e0653477.0","@material/shape":"11.0.0-canary.1e0653477.0","@material/theme":"11.0.0-canary.1e0653477.0","@material/animation":"11.0.0-canary.1e0653477.0","@material/elevation":"11.0.0-canary.1e0653477.0","@material/typography":"11.0.0-canary.1e0653477.0","@material/feature-targeting":"11.0.0-canary.1e0653477.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.1e0653477.0_1615495283773_0.9209903335050902","host":"s3://npm-registry-packages"}},"11.0.0-canary.148e8cfcc.0":{"name":"@material/tooltip","version":"11.0.0-canary.148e8cfcc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.148e8cfcc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d21f23d62f0b005ee20e136334c23a3205d41b06","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.148e8cfcc.0.tgz","fileCount":38,"integrity":"sha512-N8g3eC9nKb8M4usec/0hrSTHFowtrgDAb4ZUJ4f9Ya6M/coV4AU5ztKEOqjftY1sgt+IoIvvJKe5khOrIkiINg==","signatures":[{"sig":"MEUCIEZ+JHSopBjSiKSwyZN9zqBmFODd6wMZoeCgM/PaL57OAiEAh/aJ5UBzG2DCaHrZelYB54N07mD//yXEQzHuTZ4TEeE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSp19CRA9TVsSAnZWagAA8mkP/0iTkSDAqFN7JfbNzwY8\n25jmKSyI9X0GLo+KpM45pQWEscLnsUPUMMinhMIJV8AEX0cM5PZBd/WuSK30\n8o2pkc5h+Yq5cQwlSpGFYbpIffpCQVzmypTg8QYpshWJte9upQ4OI6F1JjuD\n5BD1/ywy1M0rgLzyFG/mCawxLv6AaWokPQmjBXCddFAO+CqqYkQFlSS/ugzF\nMambRhbKExnVnmE259FEs6FQaaFUZY5+pWPEHYnUF0bUcnY5yr/aa7KGjl49\nJp6j/5nB6VlImyXqbjbsSme7NEQ2XzjuUVD3PYDBV0qluu6sO1QQj2J9KfH8\nLvp2m/mSXcCPfs+G1uxQ/A66Ep0qU4hYH0klt+6Ch93bVmj/5F0JDp5Zn6kZ\nea+dfOaL0vmjBkXj3JtrAGMBR4IsECh8CCmKCutdp7xjHJqwwrSiBL2cO4Te\nO3fDA9gxIGqCIt6wPNnCfOVVQ0Ijf3E83nJXp76i6RoggOGrYiPoVTBxh1C8\nUungQ1Wa5tPDdQSZ2q2vHqfvS7TDPxQ+Z4z9Y0kc0BDwwp3K/b1kYYx7k1Ch\neSSFHFsODiJl7Uk7iuJqva8xhQsXt/PTtnKXMlNx9t6wi42IcDUoMSH39JD1\nmdwIkwZ/BYux3F3rDRGtZR6euZXXRMNVgcj3In4YqAGWae5HShkX2Sc6v3V1\nfHT8\r\n=zWY7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2e686ac2d72b7a249bc4deb8b09742bba99ce581","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.148e8cfcc.0","@material/rtl":"11.0.0-canary.148e8cfcc.0","@material/base":"11.0.0-canary.148e8cfcc.0","@material/shape":"11.0.0-canary.148e8cfcc.0","@material/theme":"11.0.0-canary.148e8cfcc.0","@material/animation":"11.0.0-canary.148e8cfcc.0","@material/elevation":"11.0.0-canary.148e8cfcc.0","@material/typography":"11.0.0-canary.148e8cfcc.0","@material/feature-targeting":"11.0.0-canary.148e8cfcc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.148e8cfcc.0_1615502717371_0.5415191173221838","host":"s3://npm-registry-packages"}},"11.0.0-canary.73a227194.0":{"name":"@material/tooltip","version":"11.0.0-canary.73a227194.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.73a227194.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"55b5d3e5bdd318c1046909a69e3c3fb2dc7feb58","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.73a227194.0.tgz","fileCount":38,"integrity":"sha512-HFNDpHmRuT2v61xFSq3oLmNusQvIx/tUWl+W5r5UpncTY9zW9LpCjzfgrXm1mQnyzpbjJPIPopZk7ISaDF21ug==","signatures":[{"sig":"MEUCIQCQKYlHcnbQPw68WU11v4LHxHGGi1d3YDCUD4MnTCp9XwIgZ9WD8Mg5vGTQ6pkYDHP5oygjX24qKwt+FWAjNttQDpQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSrTiCRA9TVsSAnZWagAAxpAP/RVPC0BpIJ7ie7f/a0SB\nNXiqOxIV3i0S4Sp4Xps08s8FXhCVVVWQaaXWgVqynYO4gSRjzpP51KC+mrj+\ne9fvcKyZvzqu5CnW7auDHaLjaOdSPLWOkiJ3sWBFXWNB2doiSmim3xKOC2Z+\nsWao2KlH4PGSGneNhwdZmcLljfB4ysCi72xvSp1ZUZv7CunvRsw6ZAijIIuB\nSobo31tPxlFvN4xPzjxli6tcZv8eSi66tP5Z1ZZnRjTaHj0eMXoc/Au8ZoPB\n9EqPtqq4s8zcaSMRp9OCBAkFpwNPFufuR4jvcJLi1lR6PjNYJ3OXwITwjEAe\nFHnBCdTFNYK4sn/Ug0RYmfFLatsfwxzFgu1CpvT0vRlZDxrwSQXwry2Yky7m\nU2E41r2WqwgFpPxA0xY6lCqio5+cyGSE7ZAREmLzxGv+Y1OpGTk00t4Y9fBs\nKIqXNtFLP1+vpY9waf9JRDbjQVwDUUE0S6fMNXQfeInVz0YL+YaTVIkK3rIH\nNxZKGJGEVaDacqhBQ6yCKqlHcWUFsan0jMjJX7CsMPvgRDdPepP2uXY5nmMm\npoLwgjZxvg1gyG+MvG+C0EeAQGvBXIojcL0Cga8vadD0QANfYG01B5gFOnsJ\nGR/CEANnMKy6bRpHj0tHDlyz7bns0b89PRbm3iDhEB8yeiVWZ9F2GGmyxBGe\nB62g\r\n=rsGb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3bb5344393057d23abf5414ff61402a5091ac74b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.73a227194.0","@material/rtl":"11.0.0-canary.73a227194.0","@material/base":"11.0.0-canary.73a227194.0","@material/shape":"11.0.0-canary.73a227194.0","@material/theme":"11.0.0-canary.73a227194.0","@material/animation":"11.0.0-canary.73a227194.0","@material/elevation":"11.0.0-canary.73a227194.0","@material/typography":"11.0.0-canary.73a227194.0","@material/feature-targeting":"11.0.0-canary.73a227194.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.73a227194.0_1615508705693_0.8029629985798541","host":"s3://npm-registry-packages"}},"11.0.0-canary.f8579b7ea.0":{"name":"@material/tooltip","version":"11.0.0-canary.f8579b7ea.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f8579b7ea.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"01c97ae7a1ad7506ed439072a4433dbe799fdb83","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f8579b7ea.0.tgz","fileCount":38,"integrity":"sha512-4deOJZLkY7xMkXI4RW0otk58tGuUjcUjAWONYi00EClfwlmwEsPLlh2RR5aKI9kWercYem3KdfiCZtDnJFWheA==","signatures":[{"sig":"MEQCID+nlEjQrMWwVeBhChrcdhHp5nK3B2P4WTfRSEOoh9gxAiBiQ24B2wGMeoKyjPEnteoOdc4y8H0N9XhRk2D/Ttjz0Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTB2RCRA9TVsSAnZWagAA5jsP/25czPYhtLNb0qmv2A5y\ndTynSrcyFSWNoDEo0x/rnD9mn1L1jaOyyiBm6L5NxUia1FlqTizlotjJdGhp\newRxKzXk/2F586csG7xMvN8JmdAuQICNt1rJeVh2yRRuje5TqSjEIGYapqwf\npra0TO9oKhVYi5RaOyOiV7f8jCuO538am2cKhzvipjgIbLSTojTB0CtZ9rG8\nwI66pZWTDoKhmMwRknaWCX6WXJ+TP6t9tyM8Yuk0hB96fa4IgYSP65b2N3no\ncAFzK5IPQrbNsgDNaskLdH5EkIEWHpsf0NzVmazvtzwQqpPbyPNQkoRhdGlc\nIhfJYVXZyoj/i1nirUiFsoXfSqlL+tLQH4YMd89y4QHq7E/numZuiEEjVajz\nQykTJcJkhgsulMwbVvutijLGfKYTXilHcIAAEvGOb9uTFKIhWh+Xap8EuwDt\nsFGrDBdrNciR6nawyAZC+AaHKfn+b3rf/UUUAcqYrJokbj4cJK3noMTybRAb\nGdu2yVLhFDH6Bwca/MT0hgUeCYouBLmbncaDeUeBYxXRAT36Xt0Q4DO2PfWv\ns4MeN0bZAdMvJuKVjoLgdz3gBswbit/D/GD3nhvh/0pMM6+MCbpSbBbf/zMk\nLn9YpkT7XhDj3RbFxkznt08xDW8oHP1LXdVALpnxSdjH18GmqRyQ7Sg58ppL\n0bJO\r\n=NFx0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8b1a0816c0d3a68a851c5e6a199c4a9ff75cce07","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f8579b7ea.0","@material/rtl":"11.0.0-canary.f8579b7ea.0","@material/base":"11.0.0-canary.f8579b7ea.0","@material/shape":"11.0.0-canary.f8579b7ea.0","@material/theme":"11.0.0-canary.f8579b7ea.0","@material/animation":"11.0.0-canary.f8579b7ea.0","@material/elevation":"11.0.0-canary.f8579b7ea.0","@material/typography":"11.0.0-canary.f8579b7ea.0","@material/feature-targeting":"11.0.0-canary.f8579b7ea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f8579b7ea.0_1615601041066_0.17798387554606632","host":"s3://npm-registry-packages"}},"11.0.0-canary.d2a39d300.0":{"name":"@material/tooltip","version":"11.0.0-canary.d2a39d300.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.d2a39d300.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bb4f0bca831901bac2d6c4c567ff28c41846be87","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.d2a39d300.0.tgz","fileCount":38,"integrity":"sha512-gNV9D6kp0itZbnrQc9s+8A40lN0pUYXu9ZrJ8IF5Ko6itqpexEHqDhNwMLa44QfhQERK224Jy4oAq8fSD/6GlA==","signatures":[{"sig":"MEUCIQDfXTHqapLSC4J6CALo0+z4sMB8j1IEmSA87Npw3ZbmXwIgRbGgKal/w386s6fa4lNtDRGPRxNJLDGBW+AlJNE7gIY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT/1yCRA9TVsSAnZWagAAFuwP/1ZesBV7tyPa3YmXUWVd\nePPniQrS+lfgbkhRjAaVJDuElDgsCWOXCKQqY/tiBLVKwSBvi+6q003egz1A\nCZEnIG7jCu6yPRKk2N6QhEmZAB3JR2uptmpnitWu8CeVgeXGXBRvFXZMLNds\n9eniXApp24+IkT5j3C9pszgK4oi8Ej8SwyQ3UqNF+G7dIJF2oOTaeVTK7QvQ\nzZU33h6uwrastX+2EwQdkjtvxCbWbTZBhqYyhA2IyA0rjjbv25hut7DcgS7C\n37AWKqYkiW35Kc0+ux+nPgqLLziK9+cC2jSWTtLzlflbhcLVxfOiliwEdzyO\ndLJA9iwG10fYLHJoTANYSLYvts3JbTztYPifsdVWXSxdrCc3e0UsWMVNrGAO\njqZpcnsbUzfKqn8lJJMHK6Nz/sKRFQWvilbruKQhvGFBGVE7sK29KwkhrxeI\nAl3meT8YkHxb5NuWNi9LBVxdL5kVo1eGpYeUtnI/6CNoiR7Lq7CH1VU83P/S\n1KPQNYtI3Kt5ugn3zqAw2hBO5gIc1FjSoHN9xrfmmf78iSPL6UBRVPxJD68Z\nddjZ/afHs5Ps4U7PZc/RZv1mkL8mSFaemkFXLz+upBV/Nzuah9FW3lSF7kcS\n7Xjg8/yV8ibfsVGtI0ckkYF01oc+ntNFMh19xP9hAhkgJuUp1jvSdF8v+2lm\nsnn/\r\n=hGaB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4e928ba6e35dc70b34314c7509f647a6fbc4be00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.d2a39d300.0","@material/rtl":"11.0.0-canary.d2a39d300.0","@material/base":"11.0.0-canary.d2a39d300.0","@material/shape":"11.0.0-canary.d2a39d300.0","@material/theme":"11.0.0-canary.d2a39d300.0","@material/animation":"11.0.0-canary.d2a39d300.0","@material/elevation":"11.0.0-canary.d2a39d300.0","@material/typography":"11.0.0-canary.d2a39d300.0","@material/feature-targeting":"11.0.0-canary.d2a39d300.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.d2a39d300.0_1615854961793_0.18678652614426738","host":"s3://npm-registry-packages"}},"11.0.0-canary.7cf67823e.0":{"name":"@material/tooltip","version":"11.0.0-canary.7cf67823e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.7cf67823e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ab910ce58674610c4f7721f509140ec8608ceba","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.7cf67823e.0.tgz","fileCount":38,"integrity":"sha512-efddRGT9Eu7QX3iuPHWojD/JIEkmwr4w7HmZaKUdsx5V/n1yub56wNebzYYNrwISkB3WG5xprd66EVshqFO2vw==","signatures":[{"sig":"MEUCIQD9I9p339Ok58PNemX89tMtDOenYw3Bnjn3EsLJuZjSRwIgYIuTEBLCpIDeznCCOHmmz7xmR/H0o7FIbUKxGBWDtTU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUPcTCRA9TVsSAnZWagAAM6kP/1/9yFNFcN0CeYaVIWS8\nGSu1b9mEVYBFYtrkBpu5t+R4EazwtB2gCb2MovfQcdJOY+80nQK6ajB0qCwP\nYC6SU6jBxoTrSBrVNbZiUt5T1JGS1ziT9AEuay6lufQM/tL4AX9xII7zZKbo\ngIfWTDmjGlgYb9WsIZnuPO8s72cgvzWj25X186I1itzfmRuyie1z4aDzzPAJ\nzMGgMo//vLbKkx/aZc6LlLiZDAtb8Zg63TjoHhn5/45WpkiBdzNnExkj5gPV\njMiZUMrfSvOdDWt01hjTy+nqJG4LQ3fDV87QSmxVVVk/fLTFHl3I0BZRRDdA\n7dMxsSqjcWLx2tL0mSQnlt0CJSh1DbAZVZ4j24kjj6G9dFTbqYyfOt5qgXYa\n8NKNXaCOu9rScu4Te0FhD3jC7+8qX6zy8W8aefp8Wm6GD9sWx5J5YTnfsAgD\nahnbMrd/q5EJsscNuEfO4BtbCJry7SsViZU0j1S/vXArwhhej7sdVaOHz3ee\nX5lpuXety+MOApSdYv98TLqtZ/pLYa5R4Irkwr6KASD7SVjaRAXy8XP8BjqZ\nNdY1Rkp6/FNatu405G4Rawv9GYL5eDaBjvviw2kExQt2cTOhogb1LMp/KpXC\n8UKUpaxoWL9K+oXV2sTLrmZnmHeqKRAUuLegWw3/qSfPZcaPMlup45RxgcDs\nSfKn\r\n=jrPk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"afabf42a48ec8775fa133ab10e023c1b5d2ab802","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.7cf67823e.0","@material/rtl":"11.0.0-canary.7cf67823e.0","@material/base":"11.0.0-canary.7cf67823e.0","@material/shape":"11.0.0-canary.7cf67823e.0","@material/theme":"11.0.0-canary.7cf67823e.0","@material/animation":"11.0.0-canary.7cf67823e.0","@material/elevation":"11.0.0-canary.7cf67823e.0","@material/typography":"11.0.0-canary.7cf67823e.0","@material/feature-targeting":"11.0.0-canary.7cf67823e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.7cf67823e.0_1615918866953_0.27968187026320424","host":"s3://npm-registry-packages"}},"11.0.0-canary.67d780c79.0":{"name":"@material/tooltip","version":"11.0.0-canary.67d780c79.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.67d780c79.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8a21ffe467121806530aa9225d1f90b9a79d6107","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.67d780c79.0.tgz","fileCount":38,"integrity":"sha512-R4/WGQsDTPFn0QR8BPrDHA31o5nk59ZZcj6BK4Akho6oLkYl1mYrOwIk3UXo0xkw0vLVISIUgcGRbJOkeOi49w==","signatures":[{"sig":"MEYCIQCXwC9kIQdYBRrpj86QHslEfv8BU/knrGM0JFbHiO3+iAIhAM7f2I/4PaNkWUgSaq/ZsUo1M5T/kONqFcXnrSmrp8HH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUQulCRA9TVsSAnZWagAAjy0QAJJPWmbURC5zDKFyxKUa\nbBDvCvYMKamXjKq6eP/49xLWY817ptvhjODL3y+lhRfMVIM3n7I9Pp8TS8e8\nDz53HnjHkiCVNXuzVXP+21xGGOLZr/nExjPrDb7IY6otdZIhhBlSJpzAp33a\nanOZHuMk4yZ3fDWMv+1XT02hE+71jC/EBpDn+xY5HXz5SFf5q5wmqtgztxzw\ns6P6xn+6KANLfeZ3go/Ims6S3mOmN9lszD/hTpCr41maFlu0AqJ4uoi6rm7X\nWZzavhiBQqZWSoj99WFJtHUiUiik2sqMP3Sjewguh3Rlo6YSr1jwzdSkFPg9\nxwXSJ2f1onESbynvSjF6ysxdH+tIkCnAcaw18XPQbT6kx3brin7GOa+P3Ocl\nCSS+etSN7NCeGDcHnCSBrR1lCXe6MTpBxMRqW3UE+ZDqUagqCNXjWV8wGwIX\nVGgUcyeg+ToRiuEtSvmRi17ONOEmyZzV7ATpJk/nv7zHPgSfnzCRYmuzhCgZ\nf12RgliewjiTBikOgWWQzYvGnDjX+NQcJA6P6TA0PvkFaUsPBM51KiSaRqjE\n5D9rslUHSuRcq0jhga9K0np5to9Lq+5UjvVvFQOu7Ky3Y/vlgG/8oZwPxEHD\nei9OlrCEvpUehVMggX/O4EzLREFZTrIzUxmS86IW80nk53+qNGJ+aTlcWtCp\nVYzP\r\n=ek7Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"05a76ad8cd6b15550e685799fb6b9b5643d7e0e0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.67d780c79.0","@material/rtl":"11.0.0-canary.67d780c79.0","@material/base":"11.0.0-canary.67d780c79.0","@material/shape":"11.0.0-canary.67d780c79.0","@material/theme":"11.0.0-canary.67d780c79.0","@material/animation":"11.0.0-canary.67d780c79.0","@material/elevation":"11.0.0-canary.67d780c79.0","@material/typography":"11.0.0-canary.67d780c79.0","@material/feature-targeting":"11.0.0-canary.67d780c79.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.67d780c79.0_1615924132718_0.2523919847091838","host":"s3://npm-registry-packages"}},"11.0.0-canary.0f358ddae.0":{"name":"@material/tooltip","version":"11.0.0-canary.0f358ddae.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.0f358ddae.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"df3e16e52df0a7d82d4cfae7e56c7f6d011161e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.0f358ddae.0.tgz","fileCount":38,"integrity":"sha512-O6srVhvzhU4avtrqwd/8mffV5axjBDv+ot4MT8qPMXTXsUYRqravi64fc6MGPRStVOJQ9RPE54B1FFUatgxoIA==","signatures":[{"sig":"MEYCIQDkXnN/58nvV5UkzPPVpX6DfXUtQfOooaBXIUYeYcQUjAIhALy67kAn85KJFsBjnM8iOH1E1rC6hDr3qkbWvKvwPsMR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUS2GCRA9TVsSAnZWagAAKq0QAIggzVNBFAiYoCgqGWSe\ndcwNrFtPB93AUPx1U399M91+kzN1L9GJhKCGvWXNB2nUUMyMQ/9vqgEpnjnr\nzy9VtH4F1ZwhAMksf79d+ZLTDO2a3yReW4gKrdmNRvDcIgDs9k4DuYE5rnyL\n+igtMeLDkoNw9oBQ77de3YkIFHnd6lb86GTU6vRTY/m/hNIIwr8/owsaPsdW\nPWD3ckwBtbNTIvSCDPyCmMM0vOhfhLbm6BjlNJTgz8V6vCPhhLIu6B9vnq2f\nhr3SwDfXqG2PUEqKnC3zL7KZLpPBuAlMRv+UpW4EmFgBRlIFnJOxavpM8tnp\nRb5zwpjJaO8/0GdpE7jFMukhnj/8VkmWizZqpYAFIlRKZT6EIbKw0jaP7uiu\nhPUshIBwbyn3cL3Y7jTB+t1A+GMFQKb7o+LClDz36OfHQNeBxAqSdaDRF0kq\nkVs/VqbAUBAK3kKENKPwHWtiOTPda782mlL9W89d8E2NfOCUJWw/3KzpOgJr\nhexuSm4kasrrurKbhmrW2vFKhoIcAPq6RgYb6KcwQS5xr5r3fubs2eMsnUAo\n3g3QNfcmWYQJZehET+JeYD8GriGAcdpQ+lRRjy1xpIOIYuBC9AJ94mskK/g2\nXUXiaxbRju33F0jmvodJxsQJJFO7XeHGuyu7y5pHITQJhYxunWzfBIRqHooE\nKrQJ\r\n=IJpa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6acdc7677f01b6502d0b491a9816d6600ea9cbd7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0f358ddae.0","@material/rtl":"11.0.0-canary.0f358ddae.0","@material/base":"11.0.0-canary.0f358ddae.0","@material/shape":"11.0.0-canary.0f358ddae.0","@material/theme":"11.0.0-canary.0f358ddae.0","@material/animation":"11.0.0-canary.0f358ddae.0","@material/elevation":"11.0.0-canary.0f358ddae.0","@material/typography":"11.0.0-canary.0f358ddae.0","@material/feature-targeting":"11.0.0-canary.0f358ddae.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.0f358ddae.0_1615932806172_0.7868839814945929","host":"s3://npm-registry-packages"}},"11.0.0-canary.67eb0df80.0":{"name":"@material/tooltip","version":"11.0.0-canary.67eb0df80.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.67eb0df80.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fb1735f7f3457f9106cd7d5d160d19126d150b43","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.67eb0df80.0.tgz","fileCount":38,"integrity":"sha512-v1sZgHo9USOv7Ne5RrWQ05//rwSfDB8NA1MAeIpf0DMfbXXnRDgBAJq15+lOJ1hFaUDA1tstIqTk//wn39AubA==","signatures":[{"sig":"MEQCIEe/X3FaJ3rDLm+JtgiiKaBOAOhkbBYQEnTwnrmFCd6bAiBAyWD5cZVYOHRscOXZWbvP3yZSyi6tXnVSSTiQUTKO7w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUTPlCRA9TVsSAnZWagAA0zoP/0XervqoY1TmPkbibFXI\nqUq3SY8geVGY5W1drVIihCoZD3WjQU8pZ7OG+x0sHd/GJrhTj7PCCUKXdvWY\nC9joLgHR1aJLOSKa1rfJPXjByMMFE1ycSJcib1vg5satGSyxYP6gDMuslsaM\n2Vq9VpTymh540e7uSbW4I8uJ9XTdU52uh3uetB56Vyj44zFiyBXGrOj1uR2C\nf1yb3KGr+ineQAhY7F6cfEWinEFtcq2nMf6N6rvUQ5aZufEvb0bV6rf6n2Oi\ndfZyzLuJ+i3FSS4y34JQxj57SuQCrh5RdRbnxc+HfzFfcChSS7rFTGbyhBlu\nWYeGX7B2nqkttrfMcRy4lDWts74QwMEgr6MsgloDXWNLtWtjMjTqZvNUWxb5\nnj6Oj24NUhFMB3TxFfPaS60fw31xTuY1JV25NWkXt6o5kF/ibKcnDctkbK+v\ni8vUGdnXgghKTJ7kxofRf7oYzlab7Z2rH5PvlEoPRBVM/x12XaiIpboML9IB\nKAQEpWLxgvgUMHj+L6ikQCH2F7H5+2lxty0IE6KGBSW8G3sdinNYKZlKWYd6\n2zFx+KBAbi9GbSsVSB9np+qG5p2jb59eqWlL3npb1pTdTb3AgPbhFn4B3r3k\nMXf4/S8ER9sWprrcPNXhig9Qh5PJztOul+wgeNBs9YPhdUdIUEGn8nMqmMGk\n2ib/\r\n=4wu+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5f5e9d259d95bf3abf565622edf7345e62993020","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.67eb0df80.0","@material/rtl":"11.0.0-canary.67eb0df80.0","@material/base":"11.0.0-canary.67eb0df80.0","@material/shape":"11.0.0-canary.67eb0df80.0","@material/theme":"11.0.0-canary.67eb0df80.0","@material/animation":"11.0.0-canary.67eb0df80.0","@material/elevation":"11.0.0-canary.67eb0df80.0","@material/typography":"11.0.0-canary.67eb0df80.0","@material/feature-targeting":"11.0.0-canary.67eb0df80.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.67eb0df80.0_1615934436849_0.8733972421949705","host":"s3://npm-registry-packages"}},"11.0.0-canary.941ca3b3c.0":{"name":"@material/tooltip","version":"11.0.0-canary.941ca3b3c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.941ca3b3c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0f300ab425728877f93797b24778e8360368fd20","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.941ca3b3c.0.tgz","fileCount":38,"integrity":"sha512-nhRttxd1eQqnCHE/dPYuSZ3Od80iP31LzGoCEZnyIr2ZAM1i5E2xUG1v8UIrmbytpi24fzmrVNjECot9t24S1A==","signatures":[{"sig":"MEYCIQCX3o7Kg6X3MSofAeWOInSt07yyTU8kTjvFEPwbl3SLjQIhAOPRXU+OqwsJvqY8DIwajfb6Y6Wkff6l8VkSdbLi71wO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUTRNCRA9TVsSAnZWagAA+e4P/3dFFTGs+6GGzz7XyMKe\nLgdkP76+HdhiTQPQPiClaJW5l9GKBtMjSfjP8RDvN2B/0gJjo3Zv88gCaCaz\n9XzTeD0VILbqEmhAvwkRCQzPiwR0p9UcH3S3GXC2CVVfxzBK1vGW8oUwRXr2\n5B6uYGdaoJho/uk8mnRVWDy0fuQ7rwcCE7melJgNmw3Cco+JlCj24mqipJAC\nzLr6+ZdMmLuTh8lnlTtClAwFC65jsvqFw3esJ7duXcK1tPlejzuHht0Syu4y\n0/H6swsyJBAWXRsv3QiVHACJziQmdqA3Kc/gsGuHchvB/q8YXmoYEQ0a+ZR8\npAJmj+uMInFvqnleQKBe+PHkTr0BLXrKGrp7GLfj5Nlk6euxkRo0Cul9Q24r\nAttEUYC8pV2CRw7mQPrDPZSQKPy6mrBcdmxaDj1FWhWlzbquEs8j18W6a/G1\nD2+oHBv0yWz6zjVoRfV3BmqeqAkJOm21qvxI3mMUJTro1ldTi70aCEurK73m\n67ehigo9BLRRdMbIRA5BkK8Kl2JBXZjA/aSdIjxYEyT03YmUC8m3T2Y3Qpfu\n5CEvRJQ4vZrOn7wEnAWzid7ptmWwAnfZ/+/0+FdxtevtvbncvRNtPASjGLz5\nsUlPlxH5JC38G1tUqd673nLX9Ovc8ySVPIQgaZt/colNPrVsj0UbfaGI05K5\nDxkw\r\n=D9cH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"27181e4c2c90af170c9149616613beb6599ff94a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.941ca3b3c.0","@material/rtl":"11.0.0-canary.941ca3b3c.0","@material/base":"11.0.0-canary.941ca3b3c.0","@material/shape":"11.0.0-canary.941ca3b3c.0","@material/theme":"11.0.0-canary.941ca3b3c.0","@material/animation":"11.0.0-canary.941ca3b3c.0","@material/elevation":"11.0.0-canary.941ca3b3c.0","@material/typography":"11.0.0-canary.941ca3b3c.0","@material/feature-targeting":"11.0.0-canary.941ca3b3c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.941ca3b3c.0_1615934540525_0.7250799145567739","host":"s3://npm-registry-packages"}},"11.0.0-canary.3344d12ad.0":{"name":"@material/tooltip","version":"11.0.0-canary.3344d12ad.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.3344d12ad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e465453092cdf4fc2f882b3da159fa4c7725a8cc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.3344d12ad.0.tgz","fileCount":38,"integrity":"sha512-pZ0zGh7/jJkJ6GHs1Pq39NQaiFNt1Yi9Hp4N3vbVaUZCYXDbh0vVsClvBBeJ2JZon7lMCrJN90EPH3gB6U7HRQ==","signatures":[{"sig":"MEYCIQD6z8yKgIAWgIDk+9FhxpGeKu9YX2/JW5a/IrM3ypAWNAIhAKWoi9Y5rHqW9mwDOPgRfNKzJ8Mi39YKsNHXQE4EBEV7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUdPCCRA9TVsSAnZWagAAoUwP/RTOJo5Pa4DSmpYYN7Jh\nVLrdSuq2v0OHk77hegaSWkXc2IKa81H4hInah3a+uUaHqVCMdE32tuYnqQJi\nUBjagEEhfNQ8aWIkdlPWdRpX0k7ckSeiixu+WQyBvzTPvZzlW9Ihrp4vfkhy\naK4uV24YS3soVmRxzm9OvELRHr4outzThkpZD5k4PzA03iF5DWxG8h4voXo3\nbWiIc+8OIEj1fxi2la5bDB0HU3PtGzw854vbF6+3Gbmktt6GG4S3yrR+go3Y\nTGjpcWVxg/59ctZBwv6cOrzX18etmagvxK542YTL4j5+b7p1uzlq0An4Sqz0\nS0IDvjOOD5M1M53EHs17tuLipf/pRCKZCwNA0wB62joupgrFCWarNSF60G2o\njcNNuCmtFdCzBaoM7q3QQKafkHkQHTuuYe6akT2xLFkCOmSnbLi8pM4B5fyD\nPFHh8s/SIMJsbuQlGhYi/jLIRdo0dPox/WFXWyHB5ELcMApNcVZuwZNNSAWd\nD39+gpkena/AUYYOMGGpjmQijQoLWO2iHD1F5jD3gaR1VnbA4lJY02M5xKYX\nUEMJeBSFozGcZz/M1h6rBXCMZyPTti6uCJfr7H8ysGeJVXQam7quwmPA23i/\nQRpBR/5bRGzyxLAAzpXq3GOvG1iP6qvT5cyWLICZ8bfnbJJdz9ppCa3s1q+d\n5eoi\r\n=7qF7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fc17c547b4aa66b6412c0b0b56b75978332702cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.3344d12ad.0","@material/rtl":"11.0.0-canary.3344d12ad.0","@material/base":"11.0.0-canary.3344d12ad.0","@material/shape":"11.0.0-canary.3344d12ad.0","@material/theme":"11.0.0-canary.3344d12ad.0","@material/animation":"11.0.0-canary.3344d12ad.0","@material/elevation":"11.0.0-canary.3344d12ad.0","@material/typography":"11.0.0-canary.3344d12ad.0","@material/feature-targeting":"11.0.0-canary.3344d12ad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.3344d12ad.0_1615975362299_0.8186325004615853","host":"s3://npm-registry-packages"}},"11.0.0-canary.6072ed604.0":{"name":"@material/tooltip","version":"11.0.0-canary.6072ed604.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.6072ed604.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6f107f42e20453cd991e3f18583ff0d4777a85c6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.6072ed604.0.tgz","fileCount":38,"integrity":"sha512-Z/FdL7MhPOdG8PPBiaYZS0NyiIn2Zi36dl/G7A64lHAWucsMrTYNxGCUxR/8yrq5tPQBYO4ORZO6Asvct3RF8Q==","signatures":[{"sig":"MEUCIEcwRaS0bv2pPwliazXSEr8B63CnMK2WvMZ5CrEdDF+QAiEA3xI4ssPiPknCfhyNJmPbP2IlgE2wFAh1nzMj4sW+kNg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUooJCRA9TVsSAnZWagAAusYP/2984iNA9lFQEoEpfFxO\nFDhTEqzFzs4OQKTcyko9UjeEOpKTOwXaISwG2yFHwmLyJ9u/xVnJGqDL/pot\nfDlpvqvB19W1Lpipdy6F9q3sHAJIURRRSIQvmDekZigq5XnZMAKPGT7+t7D6\n2qQ61hzZ6WB6wBlxWXMQwToRKgN6mayj2U1fAEEeO0otNwHdR38ZrT/vExeG\nHsXD8b8vVNBt8WL64yimxGfMHBmi30XlKMUArwSuD+MkwRFFYxRz6FlNjZU1\nOcwB4pcXkbwJM8rHc58Q/s4KMwwpR+008URm94JbUh1FskdN5dsIUu0kaicE\nB4GRmagQJt0kuuUeXUR6Atf2lsezrPuYQq7iVKslQhYctgh02765P9pzK5M9\nTxV0eMXJyyqb9BytuZQtZEhL5WVwIi4IIOLUXoo8rA2DWhkC3FCu+mmZ0P0o\nwak2NgFPJ5V2NPvibgYkhkdjA7p7wwmyPmLoi7SGKMdha4NeC3Ot+CW6ibW8\nAcsTSiWkk/tN0plONQgDa33fzFhlWHUzuiVcjwXI6cTmO3gg/o8AtgVK83d7\nVAhdwVOKCUeVevirQs/3ZWf6WScW5ZXmNx33NPzguRE4LSiIsB5W68napk52\nm3Cu+FBt3EnTurqADnxkV1yazJxtGtc6IFSSEccxD0sCl8VmP7I2xOkH7zrS\nlq+R\r\n=28NO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"219b085de7ee97c7b75e5f25dc757e7b5240916b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.6072ed604.0","@material/rtl":"11.0.0-canary.6072ed604.0","@material/base":"11.0.0-canary.6072ed604.0","@material/shape":"11.0.0-canary.6072ed604.0","@material/theme":"11.0.0-canary.6072ed604.0","@material/animation":"11.0.0-canary.6072ed604.0","@material/elevation":"11.0.0-canary.6072ed604.0","@material/typography":"11.0.0-canary.6072ed604.0","@material/feature-targeting":"11.0.0-canary.6072ed604.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.6072ed604.0_1616022024935_0.16852883693835707","host":"s3://npm-registry-packages"}},"11.0.0-canary.d3a6862af.0":{"name":"@material/tooltip","version":"11.0.0-canary.d3a6862af.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.d3a6862af.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"80cbe9194fc79fc7c8201a136afabb2c041a9f73","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.d3a6862af.0.tgz","fileCount":38,"integrity":"sha512-iialtxu86WkESCqIYg1/16T5CRWzYQ43op3ppa0uIkJPP3yjf33wfnHM+ygXzBJD3qTSoW7vK3To0zrBsaV2Ng==","signatures":[{"sig":"MEQCIAYPXS6bNdNmX/HtE33v/zAFOyG04N9MVQpr8lEoovp2AiAZNiIm+zTYQMeoEcoyZE0TN1784GjYUhrExvk8GaX2Tg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU33qCRA9TVsSAnZWagAAatgP/2SrxkaHkq4UTfoCcZAJ\nyAhsYb/QabxYVovsKrQbw5NCmPTbMT4hoB6v3TfqhVeWZ+wofG1y1YcaXRWh\nnb0FttwoE06GeJ3qhl3Z0FUP8PVq6uucjCuWSoKGZsCXCk2RFBLTJUTE8NuF\nmCmOiOw3sZJWw0xdyUMANjL/b69o94urwgbhdQXFBn78snI526OmBWaRHf3+\ntWPqQ4gn5SIhgCRJhHQJUcpYolLiJtHNoLRBRvOGkagafGMSRub/0fpIa2sO\nvdRTp4SOZB+Ep+HYipYVyn/nRcGnfxvH+FtlvDT5lJXBgudVvsFRmsvVT3FF\nWieFX/cQJxUOyBClOcqK29jf2y1+B3LJCT+0zMkJXsGx2pku3aTPNxk2nSP1\n1XMd3KG2RN53V1WH+nAJe3ZLhA61SEhEdJLNwwKwOkmbkIn+Fy/hy6nV84Hb\nV/lSBSQ1dKyvSv4lcXS/OcsjPhiO61Sj52DmNmOBUSwFmT2/QO8dPd3D+T4p\nWTT6SbZJuLAU5RdLlGMjoQNcOrXPjiFBXVPVkiu1G2YfxtCnUSz1pPcei6i1\n/QK1bHzqYFjMY1ReQ6iD6Gituit79UTxICY6MNlXvr3WZ2F2Q/CYnzle4HWS\nqotvcDThpDc5iSHhu5NVbkh6uarWCtbHBz/PFzoYy97IFrHulSQA+M1w5ZqO\nrR2o\r\n=zej/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ab10f53a050cbeb103a3ee070a9134ff428deae0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.d3a6862af.0","@material/rtl":"11.0.0-canary.d3a6862af.0","@material/base":"11.0.0-canary.d3a6862af.0","@material/shape":"11.0.0-canary.d3a6862af.0","@material/theme":"11.0.0-canary.d3a6862af.0","@material/animation":"11.0.0-canary.d3a6862af.0","@material/elevation":"11.0.0-canary.d3a6862af.0","@material/typography":"11.0.0-canary.d3a6862af.0","@material/feature-targeting":"11.0.0-canary.d3a6862af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.d3a6862af.0_1616084457811_0.7227986107073185","host":"s3://npm-registry-packages"}},"11.0.0-canary.40dd242d5.0":{"name":"@material/tooltip","version":"11.0.0-canary.40dd242d5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.40dd242d5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f19f7c6f1ec2bd3c8f8b551ad685795f292e3629","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.40dd242d5.0.tgz","fileCount":38,"integrity":"sha512-N/qBWDRVasGpzkZbC3J2MwEhuV9M4oHme2eWmxLbe6IH2iMeT1FgHv2VEPZPOXUpThNOt1/A75q2nIItJ0eKVQ==","signatures":[{"sig":"MEUCIGLFLUlGd3ONuOv1g9+BDmutvQfC6XIRMEaSqD1Xv6BuAiEAhelBDfoC6fPxeVyHxuhrX+rLfyx0OP8EQ7p16CtWRn0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU8OPCRA9TVsSAnZWagAA/y4P/2EI+yJEGlKKOpT5R/Bi\ncqslXr5PAcZVWahgILr4btgZpJSiHFC4lOqHFCSuiV+vflKsNioOED7TP40f\nDuPhx+AexmEoWslUEp1aY2BlQdhvsMCADbvYMDhwVaETlmF3lfvXyM8PyH6l\nRkk0JbdN+8LcRXVNZfYXMKrQDPz4m5aCWy0EQZKr6f/3ydQ4YqdzEVT23eW7\nDSek1KZCGPSalrhzZogasRUoOAqAQo4kl2cKcA2Oxnot75T+3ewNKwrsP78Q\nDkDRclkiTs5YlrCeIujc17a4Q1fKUTf6JazFOf1ovy8ei9q3rbDqyeFYzTU5\nRWalYorTVNPOiP433LjJP956+IGYk26a44fEGaJ1czVcvtAtttEuQrh7vVCn\nig4A4VAMU39D0L06RRzHZ4wOh5htjO0oqQTMBlx76GrtU4ti8fWnzqJm+jgX\nH3K35PG8cN8lcUXHjinKMgtK/MDSPrFa68SnU5cFgUhA6wAUNBbCGuWOwN3y\notmfxIycZ3gLHgGJZLtgQeNjPhlRNE69NRuh0ZFKqHrkTz6tzq4kDAFYyqNW\n42JQAEL7HBynEZFgymO7UULkxIF9kBuOUpthy4MTJzVulz63glX1+A3xrFLG\n4CLO39Joi0slqOMg502tHiM6UAxF1ukCjYFc6zvmj5JtU2mcplEolowOFvBi\n6YSf\r\n=aeOR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"07de383ae306cbdee42be69fa0a06884d97ec259","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.40dd242d5.0","@material/rtl":"11.0.0-canary.40dd242d5.0","@material/base":"11.0.0-canary.40dd242d5.0","@material/shape":"11.0.0-canary.40dd242d5.0","@material/theme":"11.0.0-canary.40dd242d5.0","@material/animation":"11.0.0-canary.40dd242d5.0","@material/elevation":"11.0.0-canary.40dd242d5.0","@material/typography":"11.0.0-canary.40dd242d5.0","@material/feature-targeting":"11.0.0-canary.40dd242d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.40dd242d5.0_1616102287280_0.742391341090908","host":"s3://npm-registry-packages"}},"11.0.0-canary.ec8f8465f.0":{"name":"@material/tooltip","version":"11.0.0-canary.ec8f8465f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.ec8f8465f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5c9168647bd5a2c354e550c7c6bbd1a7e8e48d9f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.ec8f8465f.0.tgz","fileCount":38,"integrity":"sha512-Y5USs9uKqq0fddgpwBe+T0+uueOYtiClacnzinzsxtfLo5qP0wkaOGyYpYdPDVjXm8LJWSrFw9+oLJqaBkOQwg==","signatures":[{"sig":"MEQCIDpWp9EkGi7qBJ4/jBn5Jlyg4GkyOBMP46BbBAkya0+NAiBJ02f22NnHCSfkZUxKx7aho2KaLL8mSKzjRIxYN8Yt6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU8ndCRA9TVsSAnZWagAARG0P/02oyISjcRBD4pfuBZR5\n0/nxh0UCn23jcONR49/NGbR8svEjf3a7M++3T2ZkOSqMFIoiiyKemJxb/kdb\ni1APuDVYZk6EoKZZAXbOAltiCoZAZ+qvYg/SsnOTs4oLZqRvRGV0mYc7/Ify\nIQ/A69HPpFy4Z6KJoMslkCxepcp5GANWTXDn9mMkslV84HhByzSFpKYjFoyd\nM3NbYlj45GA/oMR0N+y4KoQAfcFQyKDhxb6UaYehkTx+smkIbFmgm2iGoOFk\nFLrMkuCxLwh0b85C7MzUVdhmaORon7bJ2vyAyWkzLZH99qMOoKmv+uChzkgE\ncMq+EhqYVNJ/7oEDkKRFbQT2e8/gjZlaE4+AAWOB/oyI8S3dgaaiJdtvYfUW\ne8+dddmgawrqaqnf0n3o5r+hGP9oSJedn9fPU8JGSnYm4vjZ3Bh23f8LdnFx\njwU+ByAjwEDST0LfYBMrIm2LU+0bLF+/fC8ixSHTBLyF5/Lat15DpwCVjjRS\ny2xUdlES85jadTW33SiNV8vnEBHhgsObDsbcLHPB05mIeVxr7gs4WSJQQpRH\nPRhBqDl+xqT4txLnCdbWCrMV5j1P5vJ8RovQRJhrBdPwHZZDnK40sPxrOr/H\nhgoJj5PnRtCJY9dkskOrY7o62n5JMfx6QjSuP2UY6/gKKL4xu2wwOPh0qsGP\nsb7S\r\n=N8IT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"896f8e45effbe3c44209b4542bcd3d10a7f8421b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.ec8f8465f.0","@material/rtl":"11.0.0-canary.ec8f8465f.0","@material/base":"11.0.0-canary.ec8f8465f.0","@material/shape":"11.0.0-canary.ec8f8465f.0","@material/theme":"11.0.0-canary.ec8f8465f.0","@material/animation":"11.0.0-canary.ec8f8465f.0","@material/elevation":"11.0.0-canary.ec8f8465f.0","@material/typography":"11.0.0-canary.ec8f8465f.0","@material/feature-targeting":"11.0.0-canary.ec8f8465f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.ec8f8465f.0_1616103900715_0.3002360180742081","host":"s3://npm-registry-packages"}},"11.0.0-canary.da38969ec.0":{"name":"@material/tooltip","version":"11.0.0-canary.da38969ec.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.da38969ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bdfafa1128cf60bda023012f5bac648f0e31ffc7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.da38969ec.0.tgz","fileCount":38,"integrity":"sha512-KdF3rOimJdyzfdyBq5E77EgAbQ3TFB7AjpEzmyYQP+DgLBHEh7E1fNGuuGXSVwBI+iFyTDFhCTBSHfL+RncC8Q==","signatures":[{"sig":"MEUCIBJuv8La4iBTUCM9O43/gPA4KzqwTzjdhMeleVuJeWGwAiEAg22yzRVHsFP2XIQC7YRX+k58ujwcnB0aPtsPeJUEnFk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU9HECRA9TVsSAnZWagAA4ucP/3eBhCgBg5CLB/jrbsLH\n9gtyGIDsUGT4DxUY3y/4+fa+JYClmhcoW4/FEpGxyranBtQgPrmEYW7G0mgu\nB//byMpwDdNM4/F1BhXq8JvwO46CEwp97IZSRb9AWggzDWxT6kuS8JNwwExt\nVmKugPbsEF9XjUw30P+vhIjnqkdLAXtP7eGCYvGND52RcK0aqTCKPOMUqCGN\njsnl8d0Rri9y0Tvnc0Bb6G0UlmtxjJNQ4PB/nb/cDwoOp2UNk9iuG94F6rrt\nWM+id0qBZZUQUIsFdrDuQixjEKb4eS1aIE251dk+9k4oFe/5ZuRfoOeWDk+B\ntEK+Tiw82XLcTmKg6vkOUtKVDDxeyJFw/QaQdTw37MHcNo2Pvq2kkBvyKGqp\nV54f63mNPk/OYttV6GRs4oiJBhnI7gZO13KELXJ6McxV/O5qZgkcBzadfg5/\n/fgrY3FC/z/IF3q4nXiT6Ld7vM0unmSNfNdzspZ5Zwht2VGH6q4irSgGazYG\nxJSx9JtwR/AwuYdQ1MNTDPuROFCiBUE0T4bHZg6ZiX41+y/2d6aTVsbe6R4F\nL0go/WUjD7vz8ofWgMuQuYNYnyT+KeMsV7/Ges+4SjvA6GKjNrgAb0xYdwXN\nfo/kxLe6Qqq6CcJFMjU/kqaQdKXzzFmlltDG8ukDm0v9Va5o5SfsPKbLY2nD\ngXU6\r\n=SRut\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b43d112facdf74c62e02576a918d522587133fa9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.da38969ec.0","@material/rtl":"11.0.0-canary.da38969ec.0","@material/base":"11.0.0-canary.da38969ec.0","@material/shape":"11.0.0-canary.da38969ec.0","@material/theme":"11.0.0-canary.da38969ec.0","@material/animation":"11.0.0-canary.da38969ec.0","@material/elevation":"11.0.0-canary.da38969ec.0","@material/typography":"11.0.0-canary.da38969ec.0","@material/feature-targeting":"11.0.0-canary.da38969ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.da38969ec.0_1616105923671_0.9243409886846732","host":"s3://npm-registry-packages"}},"11.0.0-canary.f5246264d.0":{"name":"@material/tooltip","version":"11.0.0-canary.f5246264d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f5246264d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bf4b45619c85cdbdc998df2ade0654531563b906","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f5246264d.0.tgz","fileCount":38,"integrity":"sha512-AAyDK1gEDWZR9IHuELw0xTrp9IZsSNsnsXLxBy2XzsgCCZBcMcHAqNQ68Ur2iyNORM9swJKzoPqIJLGyZMQZqw==","signatures":[{"sig":"MEUCIAobSpTUWC7rMU64js9zlN++VUnnACVbbenjGnpPV0G9AiEA7V4W0SyFbDOFzrNBRuKojlsr2tPM56bD0jUOqZjJfiQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/LGCRA9TVsSAnZWagAAMBIQAKLepQXMl6enzM3K/Y8M\nn6cEyehr8SkQy5JgamuIuUbAnmrvRzUWk3V9M4IGwb2UZd6k7YaAvmohkCPE\n1JlpwqpwPPAly7moQtIXR496E3oxARGrhBMJVwseI2ARAsnLN6IWckLRoavy\nYRI+YRoLnAOk8yBYY9+t0sy25qK6hO7ZNHkkZ5if7S4bwFXsgkVqsZHCq5WG\nXg07nC+8hjD9MA2ufLUZoOqImxNEeV2QVkATbeqzHgd73SKFeC6G/YoLsSB+\n+TZWvhgWr1V1MyYe/oAHZMgCPwu2AXj5xfyxWuSn4N9ZKxzGGaABvYjd0kDe\npOi416hTbIdKch2eDEa5taKWt6szu+dgafBwwYh3QMvuKYoBOA8U12uU7aJH\naoOESqOkF4zmJLK/I26HOObEf2m3olarpWbgAVregqZGIFjPzB+fDkW5rPYD\nfdSlLtqKGQVkjiPvtTO7u6vUTddtKdfZs4GYtedXNIIPqyp+l/r0Xa9c4b40\nXgEHCD94QitlvY5E6aggmGdMFQ2qo7BMQy+PbLzOuiBpFtDZGC0sbPR4Bom4\nXDt7A61rs/sIVQs8fP0CTtlhmivqip9cLlMR5zMJXT6w1hrrb9/h2fFQdIhn\nZbJgwYQENI6CNjDZOo06953mAfOjMndX7sFyLk89FLS8EQVdabd64ywU7+rV\n2L13\r\n=7Hh6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e5bc1717405750210bb9d7e3572f0cd36c9bc0cb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f5246264d.0","@material/rtl":"11.0.0-canary.f5246264d.0","@material/base":"11.0.0-canary.f5246264d.0","@material/shape":"11.0.0-canary.f5246264d.0","@material/theme":"11.0.0-canary.f5246264d.0","@material/animation":"11.0.0-canary.f5246264d.0","@material/elevation":"11.0.0-canary.f5246264d.0","@material/typography":"11.0.0-canary.f5246264d.0","@material/feature-targeting":"11.0.0-canary.f5246264d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f5246264d.0_1616114373554_0.6194552101403648","host":"s3://npm-registry-packages"}},"11.0.0-canary.03d34bbad.0":{"name":"@material/tooltip","version":"11.0.0-canary.03d34bbad.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.03d34bbad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f08a01c7bd2c2725c6a62b11bebba09e15161d1f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.03d34bbad.0.tgz","fileCount":38,"integrity":"sha512-5aDM5835xOPFD1K5NeFZo5sXUxHOlr9zJR2pMgI2973JAtb99v5bqtFQU6UzANexgpe0PCpqFWgw4gQJI5mZeA==","signatures":[{"sig":"MEYCIQD3AlwtHFIF6Nu8cXcCf1E04QdecCVDzJmE9DizW19HeQIhALmPfXU4NaRbowHz3uv+iUGzSx094V6JRWPXFhgKqYwE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/XHCRA9TVsSAnZWagAAU6MP/iO/qX7DP/asVIUhrxhj\nBBhyg5Hg4plVBAl86rnGb3N4CUexSKAiaxOxkVn5eJoJiTPngqzr2DLcUFTc\nE7SXNENIPEEgK8Kq9C/LoOJuppE5NOiPObxRflwNeJmqsRCK/vO8b7s+RusV\nMHZA5fxnf52jtdqJ+yZDD10ZiLvrHmdMwdUFVPJE5R1Esr+8CS+2zfv59twc\ng8/ZUb+nSP7+BCB+ar5H7hyFDttKgdMwvy0i8MJMVVRsDcAK8HF7gesORVwc\nl1IfvU39eQfNvFlPiEr1wN391eyxM00ZqneaMi98CWvGYKPBZP+61VF8ZM1P\nZkJk1MuT+SuwyWdYbJ07yM0gI98lQ4dCp538K8584uyXdARCcHxYlppQSEUn\nwzEOsX0Y/hmWjrRut/X9trbb7bK/6Ea0N+xDmMgxhRNS0nHm1OK3N+UTL/+u\npVhg77Or426so5wiN70OmlNmfXqqYpdvuNhA7vzeSfgG8MarOSSI39P7Xebo\n9UPRBTaAnwbhMCUBZ5GMzphjFkOmpPMbRoVBkGaIuYvIk4GMCZjZDT4JPVZ7\nF2QAlppbabgU9BWuHVMApMZBCukeGSdYPBrEJN4YQqMNhql2kpMoihmziZta\ny1kdwwDhTE/SaBE7cCgFTbbWQPClIu4ef63oZnfjVrDSKsSCJBBY161pwi1Z\nTXA/\r\n=TDDF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"650c89999524e7131f5808d28c8ea2fa15db0c86","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.03d34bbad.0","@material/rtl":"11.0.0-canary.03d34bbad.0","@material/base":"11.0.0-canary.03d34bbad.0","@material/shape":"11.0.0-canary.03d34bbad.0","@material/theme":"11.0.0-canary.03d34bbad.0","@material/animation":"11.0.0-canary.03d34bbad.0","@material/elevation":"11.0.0-canary.03d34bbad.0","@material/typography":"11.0.0-canary.03d34bbad.0","@material/feature-targeting":"11.0.0-canary.03d34bbad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.03d34bbad.0_1616115142529_0.23282649435876013","host":"s3://npm-registry-packages"}},"11.0.0-canary.cbc57c600.0":{"name":"@material/tooltip","version":"11.0.0-canary.cbc57c600.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.cbc57c600.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"76cc6dfef8769e6f9fcaef32ded92fe38e439610","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.cbc57c600.0.tgz","fileCount":38,"integrity":"sha512-vBCwu/znIxyMd6EmwDgjSfNIYYsKXKC6UvjqRJcOmiRqrDS1gqw1ILpJy+OI1U2PsVkiIZhIe5pBsjN3hZAekQ==","signatures":[{"sig":"MEQCIB9eqRmn2blS7c676v88XLnpXUqmUFnvjRiFftkuF2KbAiBlQtdXx7LGwQz4yEeuzqGzx6zioyGBfvT4QT1F2noNJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/e3CRA9TVsSAnZWagAAFbwP/3YtSxZEIq4/bADMKZEF\ns3BQ6lsWALdfz1+tiNZcrgCB0ixyhLmm7SE6r1fRNW+0MSJHTiAK1qJc0iUJ\nJtr0NXFF7/Y1NdLHjYKaWUFnsl8s+/Q6EGmeuVatVzWwAxP7vzz99y9Mq2bc\nYjA/1hiRToGmiBZVqUkdJ3WIdIVEKUuh7YTK45mv+stEwAhZvZ+R/67Oy8sC\nohYRtSPdAJWPhM4NSkTO6Ej9Olfu6fqItHZwNkWOlauiYsQZ6lGda6MgWExG\n5k08lNdtyod+oMYBhEhAlr3F1eFAJMw/emTqURVg8pbkA6FusDQGWjlpFyvG\n8a2AG35DSsJ2QRiGB2qpeq0SRFOCi/y1uaz3sI1uHxBJcwh4jwZvdp3UqMv5\nskMtiYOE+CcRAnr4UmsyPiK6Ymnw9HjC1/hADyVXdenNc+7g2frYggyMALEI\nQgHxl6tqPhpfg6wGztR9rU/mqmCa+DMTQyz3fbOgi8T6+BjSAK/DztiSQcim\nuNHhk9NaxhihYu938XlDx4amoqEVxLglbrhRQJovpz+XLc1DWQcpOLVyogv3\nwoF1GIMZbtlnHh3KoWsQLZIhssnviD74iMTVINZql3hg3GhWCU9AbNMUJuvM\nGRXJF/KFrdfX0Ncahs5a7NdOS89fUidUUBUAUhvUon4ll/So2psRH8PTbbEA\nq+lI\r\n=kPoX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c16ee9654e2ac3913ee3140dbc31e34bbc443c00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.cbc57c600.0","@material/rtl":"11.0.0-canary.cbc57c600.0","@material/base":"11.0.0-canary.cbc57c600.0","@material/shape":"11.0.0-canary.cbc57c600.0","@material/theme":"11.0.0-canary.cbc57c600.0","@material/animation":"11.0.0-canary.cbc57c600.0","@material/elevation":"11.0.0-canary.cbc57c600.0","@material/typography":"11.0.0-canary.cbc57c600.0","@material/feature-targeting":"11.0.0-canary.cbc57c600.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.cbc57c600.0_1616115638617_0.6871093287589936","host":"s3://npm-registry-packages"}},"11.0.0-canary.d6c5bcf37.0":{"name":"@material/tooltip","version":"11.0.0-canary.d6c5bcf37.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.d6c5bcf37.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"55d9a2b440245e774fe6008d2bfd99bb862f71e1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.d6c5bcf37.0.tgz","fileCount":38,"integrity":"sha512-DIk1nG2VzveB/DmVPVZGVvd5jK3FqlIfZkJgjOGkS1P/WUvruY65+WO0yUP7Gae6Dd60+Myv5waaEyiHsJtRqQ==","signatures":[{"sig":"MEYCIQC+RRtL6z80dVA5JM+95WmrXXN6jNkUFW8a9RHe34Qi+wIhAJKXOC3ub1sn93F8+Bs2ImtMTjTst/hRocIfvZ/eEIiT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/q5CRA9TVsSAnZWagAAbpUP/jBPYazqqNo2kwd0zgMx\nvAE7I7DV5KAHQqIzOn8W/d/vKSIMLwJxj4BvCv8kMNFY3+9QY76qR4WCyGoJ\nSiVe8bi9IxFRa6yaAJyvCa+LWK4ayiSucDHBlTxOcoZvsN8Gtj3NKEEzg3K9\nLi/sBmP00bIMsY5BGF2wu+YKUN5+r2fwI1ic6CMpFWlzI1UZoLXUxt/3ZbeZ\nSJLjHr8Tam6efI/4O3AMqOMdlA3L7n/t/8CjnbB3rP4m7sUOc9mfW6VrgWyZ\nXBfvvY+VQipU4jx1aB7bVp+jpI2Yl1R7a7kU5FLtHsVsceXsJ19iUivFW5Qc\nWqzRLsQvnI9rsOv4BPr/7bQ/hkBd5rpX6auWN/0hIzsfuw1OC3nfwpy+SA8B\nQN4FYiHkED64KtYrxPwwS2TghqW4H+u9bTreTR10LQYWuYuR8gJ3iYx0uZ7o\nH24S+XbBthWtnAUEg2VuL9heMqSgg5iQleOYm3kKjDhTVOoqy95geKBSeTVg\nZBZafuxTtHPKZ+qGVtHK+nAdbqYh9UiO/oAQ3MhnYHyS2NXJCssh08f9WHYc\nhk5vj+GFTiKvYN3aexCMLv095akAJDG7NGgu4CcqlPMP2J2qcF3uwQkPwRjD\nJ95i3z85ZGv/zUWQIPNqhyIkAUDKEU7xqG2R2oRcMOksF5WYl/nEc2WTYRKG\nja0b\r\n=BOG3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7ed31c18c565964157fdadec7c7876ba58c6dfff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.d6c5bcf37.0","@material/rtl":"11.0.0-canary.d6c5bcf37.0","@material/base":"11.0.0-canary.d6c5bcf37.0","@material/shape":"11.0.0-canary.d6c5bcf37.0","@material/theme":"11.0.0-canary.d6c5bcf37.0","@material/animation":"11.0.0-canary.d6c5bcf37.0","@material/elevation":"11.0.0-canary.d6c5bcf37.0","@material/typography":"11.0.0-canary.d6c5bcf37.0","@material/feature-targeting":"11.0.0-canary.d6c5bcf37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.d6c5bcf37.0_1616116409208_0.26237403749098487","host":"s3://npm-registry-packages"}},"11.0.0-canary.fefc668d7.0":{"name":"@material/tooltip","version":"11.0.0-canary.fefc668d7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.fefc668d7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"75f81fe56272fa8c146d85c12e3758ae801c60f2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.fefc668d7.0.tgz","fileCount":38,"integrity":"sha512-upTkRsAbybetXcyYdis2nqEQivCF6V8eCqIhIplfL8+y/rnl7ddVRRtqDTRzkDujK2Q7vx41v9LYYwDJj31s9Q==","signatures":[{"sig":"MEYCIQD244HQoOAiBveJrvK4WsueA6NK5XogEbW+n/5E8bdAaAIhAN7gnjt6RTTxSkmBwJRV9DpIEB210P3nFQyJZOmxN00I","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU/+9CRA9TVsSAnZWagAAuw4QAJzNsFgo5gJS5M50DqKw\ngvjk0GKM+3ifAdcWVl3/wG32CTmRgAFaF6aKTp/0H+416g5ga/bdHsTR3Lgb\nqHcFfAlLbCUbqFPjKXJCTi96IvvdiPazc0djBfUtitv5J6dvJwMERDzfr330\nFBfpXmQb+QO+/BcJNda4fJQkVPqXrUrkSeb8434q9mbFTLo8aZaT1rEsiRXz\nuWH2bzwh+7kBHROlcM99nXy2PuRP+pmuRXqFhmhnlOYzqNupabfpTYJcxT/9\nMt7kdUg/2JHtc76++r0cTcu2snL12ES54PNUp0tEr1gkN9vpCukeqznWnWly\njxCSO60bCE12FWFwsdDkju7LApqv+gQdhh8Fcxd96Fy/Zl4LN9HneyuvBa25\nw4MHY80mHWKEF1UADcS7h5O871PUx9VLxHOlmpZoVDzz/qO0bH7ToCsXGAoS\niCXUz+ZgQtkMrcoU8ZKewBRQ7QJG8v36+OGfZYUd62AMA1eE+MDZBQiZGbfM\nUIrzbunYV3I1qbt6nO7ELbax44xpoCXJFLvFZIuyi/FZ54zJQH5JIUcAQE43\n4zHkKefDfuzx6vAnfJUlgy31hKQqYrt+cq+moBHQMlXkrzNGL/yDIg2iIFwC\n+C8cNV0oAvsSZaso7um9Eo8IDvcFdXOs8uSxBtDa3XeSJm0rH7hxwTjayuMB\nWrpS\r\n=wKox\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7c976c590b16e8f3a000dcf5cf2b4daf6269aa21","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.fefc668d7.0","@material/rtl":"11.0.0-canary.fefc668d7.0","@material/base":"11.0.0-canary.fefc668d7.0","@material/shape":"11.0.0-canary.fefc668d7.0","@material/theme":"11.0.0-canary.fefc668d7.0","@material/animation":"11.0.0-canary.fefc668d7.0","@material/elevation":"11.0.0-canary.fefc668d7.0","@material/typography":"11.0.0-canary.fefc668d7.0","@material/feature-targeting":"11.0.0-canary.fefc668d7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.fefc668d7.0_1616117692481_0.8000143779886042","host":"s3://npm-registry-packages"}},"11.0.0-canary.faa7d3226.0":{"name":"@material/tooltip","version":"11.0.0-canary.faa7d3226.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.faa7d3226.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c9255c3b2b6e79b9fb6ff89f8377d13cfa739b8e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.faa7d3226.0.tgz","fileCount":38,"integrity":"sha512-OpoqND+jLBdBACZG8/wBhO9BDxevVvs6RTp6pGfB2zYJknGLldo2Px+PAPzoXJ1uGuYQP31KRLD5eJ+aQHTfdg==","signatures":[{"sig":"MEYCIQCaLnbN3uDwsxjShcf3gglUSpBHEVXAJ1xgA2Na1kToegIhAL0/MppPx4HPg3j0zCnZzPlAM3ThI11XX42CO/0jopMw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVOMmCRA9TVsSAnZWagAAxMUP+wfmKZry27Oh1ld6eFsr\nVl3slivgJZJlDY5GNFSXc6Cc2nAyle9gHqOqcCQ4EIqj4YzBYe4Mr1eXhQ1u\nRoAvPPcSOmQZ5EhIsKG+A7HOZ9dk7vG3/n3TOAE36YmcvBYIrgbJgc8FOQK2\nAUyZzrlJdhrHjGUn8B+kif3SAlWnZVGYH3XdlNd1Avw3xcZ+wD86b50yMuMT\nxc9H/I5IiEwfdT+eSvWucf29mqli1w/aNxLc0iyNoqRALERVamOT8prTfni3\nCp48cPhcnjykU/21oPZ59oOlHMknn+gbX15SsWmRx4eix9xaIfSFnqIok4Il\nL98Lqic0jgTXgFOBZoUYXOgFSNkZb7QpCJa+Y5zwuDEKPB+c81KEjyDqy/MU\noaN4lotJiLwOVgamwQXSODJ+dECmFEBS51+5AGf3Ui1r7LPnNuglwdTYSa6E\nKC78IsBCQGULkQ5L4akaWevvN5sUcExMWkGeCfGv6FXGIlFe0iUapggsotaQ\nB2nN2xMZO9xUd6ZWg1Ski9eAOHW/U6Zno2s4mKkJ1Rg5SRNNheK+joTa1RO+\nTvNk0E07YSZR3oXWUdGa2a3lzAXEAz8pAYeQ+TWdgvdGgVnlRq8YxM5JqIi8\nMgseMCrT6IeGvzR5QIpPizO0s3suMz2VOc8Yn2qSWgm+gFw9PXuQgvi5wB2p\n2HQW\r\n=2W0X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c6038c8b2af85b70f2434939a69416e1593d5a36","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.faa7d3226.0","@material/rtl":"11.0.0-canary.faa7d3226.0","@material/base":"11.0.0-canary.faa7d3226.0","@material/shape":"11.0.0-canary.faa7d3226.0","@material/theme":"11.0.0-canary.faa7d3226.0","@material/animation":"11.0.0-canary.faa7d3226.0","@material/elevation":"11.0.0-canary.faa7d3226.0","@material/typography":"11.0.0-canary.faa7d3226.0","@material/feature-targeting":"11.0.0-canary.faa7d3226.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.faa7d3226.0_1616175909250_0.35045055175271345","host":"s3://npm-registry-packages"}},"11.0.0-canary.c60449bc8.0":{"name":"@material/tooltip","version":"11.0.0-canary.c60449bc8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.c60449bc8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"96a7ae6fc40b3320856608bd9906dfe9a1ae7646","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.c60449bc8.0.tgz","fileCount":38,"integrity":"sha512-JnpaE97nxEN/EEaONwkk5uZQlgpC8I+9qvcIMmnIhN2JQBhOWI1m2PIjnBqzsloM8ynEgT5GQos8bMBhQJ01vA==","signatures":[{"sig":"MEQCIB9f3ErraFW8aP/I/ZxIyHb1X3Xfo1ZwQizT9AX8wzeOAiBrFuCnG+f4jTIFjRo+lWpPDJu24Cz1o7OkqPTWx2UuiQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVOgNCRA9TVsSAnZWagAAhtcP/jS1HdAVX7L20UlBR7VD\nwXlcmP3lek7UhXkBevR2pMNJeA5KMyBSRW7PYHutyUdXX559FD7uZJxajNhu\nDgbjppwvX6bqb9fkfMrGKAtzDwC1peKk5dU6lM0QFjQwbfB7vskS1Owmt8zo\nORUjDT+/sbMUwMhYFLrjhFpsP0tOsqTZVWl0+l+BfnJmLRXmj2bjPqfeums7\nYori7acuZlJDCa5FJjAIBtZcWCN2hWPTfDrxaU1cqpF37hXYgz/MJKXi4lw7\n519+1bQs3RZc6AfHepc5j1+5wG6o1YVjzjw8oozRh2Jecc53EWsQmegSXTjb\n6avaiyMlyOd08qaliaOL2zQvaGDRTjoS0VXYIoU8oJFMyI4l6/4DS38Gy52o\nGTMpTkSl9GvmhnOZPECn82qXQPqHRDsmIPJ23KGXD/YNqpdzkSz71UA77ivn\nu0jQHhGx08K9S7nUCh8nB5M5iGoEY+bWgo/H0GGWWgJE3vBRvCm7LFqB/oLx\ns3t/onRlLX96FJkE8jaIWkREypN+cyhwfrt6RzcoXGpLbh5r6kJt7PuRLdjo\nU41RVEi97xx8gtQGqNmfuJ/vwQPnKo96ar6FA+u/GaLUKFaMWcn2HnxTt0n4\nlaZibbgmMLlzvqOHCZ7aEqDQeQFSoNbqyi6CH2IVM4Z3bJ0Y6CpQ4TaKRQMr\nUsmI\r\n=WnTy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"874083f8b4dbf457158a7eaf9924ce1143ef6fa0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.c60449bc8.0","@material/rtl":"11.0.0-canary.c60449bc8.0","@material/base":"11.0.0-canary.c60449bc8.0","@material/shape":"11.0.0-canary.c60449bc8.0","@material/theme":"11.0.0-canary.c60449bc8.0","@material/animation":"11.0.0-canary.c60449bc8.0","@material/elevation":"11.0.0-canary.c60449bc8.0","@material/typography":"11.0.0-canary.c60449bc8.0","@material/feature-targeting":"11.0.0-canary.c60449bc8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.c60449bc8.0_1616177164869_0.02641559385861103","host":"s3://npm-registry-packages"}},"11.0.0-canary.5f0fc444a.0":{"name":"@material/tooltip","version":"11.0.0-canary.5f0fc444a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.5f0fc444a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"05c833f027deaff118a929d405c5cc6aa19460b1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.5f0fc444a.0.tgz","fileCount":38,"integrity":"sha512-iyqX/JJB2+8y9fRWO/8Cp9hE1ZlwWUZEtVuR6yl/bC13w5xvyblwGxwJyT/gGf/TF2tRFh8WikCdpMuYgJFJnA==","signatures":[{"sig":"MEQCIAwicY6y/sZlvZVQTrN/UvQVjv+qetwipFNOLStPIEFrAiBw7H98yJcCg5phH6FVmZJ8cyaWFk0sYZzya3Q2qsZC0A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVO+sCRA9TVsSAnZWagAAGt0P/18gDoDmkdVDGDmTbdap\nJ2MmVRTw4zmfb4ex/fNVaOAXS6K/OXq634jQePAhUuuj/L24aibIalSHNbAB\nfYRhSkE+qnMW2s8/3n8nVTxPyXj4/wGvd3+zxg526fEacLhrKAs/ytd9Ecxx\nZ5AUlkY/ah+KBgLVKMtxYS04Lj7A+y2xEIr3DPjLltzamSKn8B1jbj6kaqkf\ndXabs5IpqPWzwF6jKdDNxpBcjzA8Mrrqf/rgD8TMiDYJRAbk/HxefAW7nos7\noc6MGemAAHK17xqIufUQ9agyHKwWz9pHraBCrHRsT7VnMId12uht7QYCfCP2\nZ9SW91VpSXIWRfsf9aJULs47xUmMmzaoZfq/5msUYLI5CdS0yVkUDevECnHZ\nh8/VImZjh4y/L9Zk+WJk42217u9AEnBC+/ZtB44vaKqov9G6MUheyzJ50JMa\nppVabPH9N86QSsS/e7Yhkz8ggeET6mwVfuZ2OU+HW1n4a7lJeY5MvDIpJWVw\nOpcgJ9p/iGXgfwPFDDuJGO+AZlAxHbyjDxqY5A3KfAP4aCFXSwWBTe2yMJyJ\ntoa9R/NWIwdo5h+IFysLGcJB16PiU95sf+Q0PXVcC/2JY/9Y/5BPzBQcxV3P\n8q2vnSkihzW7rWgSpNV129W2hjNHFqkUyWEbUbarQxT4ohp0to7ZQzWhbaEs\nZ+FY\r\n=7Zdq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"122f31622300f5877c850a516d74f7c692d0718e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.5f0fc444a.0","@material/rtl":"11.0.0-canary.5f0fc444a.0","@material/base":"11.0.0-canary.5f0fc444a.0","@material/shape":"11.0.0-canary.5f0fc444a.0","@material/theme":"11.0.0-canary.5f0fc444a.0","@material/animation":"11.0.0-canary.5f0fc444a.0","@material/elevation":"11.0.0-canary.5f0fc444a.0","@material/typography":"11.0.0-canary.5f0fc444a.0","@material/feature-targeting":"11.0.0-canary.5f0fc444a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.5f0fc444a.0_1616179115692_0.6430739768964666","host":"s3://npm-registry-packages"}},"11.0.0-canary.4567a750d.0":{"name":"@material/tooltip","version":"11.0.0-canary.4567a750d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.4567a750d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5619a184b370e74d8adc2f0848ce1bd1ec901fb8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.4567a750d.0.tgz","fileCount":38,"integrity":"sha512-yZlumtjLjH3pxmG3MEe2OsO6cYMjgJMt5v9URfKG8QnyFnrWMzcFObb5GyKidZMin9p5EGFRFUk2C1MaWsozMA==","signatures":[{"sig":"MEYCIQCFsQCLI/IwOS1StMPx9wopfoaTn4Ah2LzbdR/hQkFfrwIhAMPs4ggAWR1eOLQHFYkj0I0xovQ+MXUeZN5vaDu/AUVG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVVkzCRA9TVsSAnZWagAA5zwP/18vXBn6JCG2rzoJg5UK\n3z41TWtsbYkeIMpEWqioiZ2F3jTKkpyx31uTbDfFobF5YLd0E1+EnfTODoI+\nqio7OTqo9XZ3UpmQgRl8OPGCzsszufaXhdQUInC3jcUstjmWk9DEujAADoGB\ntjL38ZyxgwFpO4EmSOYcD0nlN4Pk0YFyxf2Hfwyz0RA4hBiAMHeVkzcVxF8U\nLXdBuQo/iGRnHA38jVrAW+WrGesykoyscrI62PLVt9FkmMZ1YeQJu3b0i8ot\nQhc9FUThbV6ccJLBxfpPaIptLXEDiOX6pnNZ/zJkhTO+ycHxA2oh/i6FKpna\nnck7gV4FHZfreJg4dK067pluhn+ANJKo3prmZbAGhrTf5G9oP8g+e0h5f922\nMMqvelbYV0tU62H7VK29ildZuyDizWFeEmhRJYVam89ZfT8ABvXRmTJS/lu7\nVCbNxOt0rdoW9W04Oou4Lhy1ZS98Z+BxUIMX5/Mf9f3xsVJAb3nR6aEFbPjU\nKS24NGQsBPAi43I1JslEet0yekMjcjOO2CQxGkaMh+lTUGPE84qIxVIqo/45\n1Wlqc24Iji42KrporrJc+cW1OvUKwI3qwwhhdYVZV4ReKvhVzmUfUtEzAW2I\nlY2UzYiyzE03ib6BTSkr7xUFuIWgetioL+gglTnP1Y+NPJGvlxEEC4dfpO7D\nr3de\r\n=c2Yw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e165b3e1af02e963deb71d6f39a7df6962710c30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.4567a750d.0","@material/rtl":"11.0.0-canary.4567a750d.0","@material/base":"11.0.0-canary.4567a750d.0","@material/shape":"11.0.0-canary.4567a750d.0","@material/theme":"11.0.0-canary.4567a750d.0","@material/animation":"11.0.0-canary.4567a750d.0","@material/elevation":"11.0.0-canary.4567a750d.0","@material/typography":"11.0.0-canary.4567a750d.0","@material/feature-targeting":"11.0.0-canary.4567a750d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.4567a750d.0_1616206131308_0.7727342735818095","host":"s3://npm-registry-packages"}},"11.0.0-canary.0cde52f5a.0":{"name":"@material/tooltip","version":"11.0.0-canary.0cde52f5a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.0cde52f5a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f926946f305d0c140dfde8dcb983392e439f1b0b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.0cde52f5a.0.tgz","fileCount":38,"integrity":"sha512-qN5vAkLWO/2crt2gV0hVXQG6PcrybxU++CWDiZugpWbd5Nq/kmI6O0G6s1uwf3h/CMenFYMMUBr+ianMQZxdqw==","signatures":[{"sig":"MEYCIQDt2EXaIG6Qhry2Ha2CcCpspMRAIo61hb5UG59gcqkDUAIhAIGLPymqfHcLtiE1XweIFSb9CYJMe5+xqf1Z+v8p+9cU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWTBmCRA9TVsSAnZWagAA5oAP/jWVmxUIqzL7HNzwqC7r\nRJF3nKBJbRRCGnaRVkzGq7WZGhH3AzssComvyAnlvmgWRdMZTsj2DVOlfBmZ\nRUlaBnFHmIJEy/8JFaRf+9++ITfE0AfU8e49gWtG7OvEVaOwp4eMKLFhhNVE\nGgFLLVhcxCkxKrFxBdo1bgeM/eB21RmDH6JRlZhOw/KEUSm1wQElyogUZrw8\nop8mBUdoqiEKhQm4UvJhqKP/WV41b5lLuVC94v1i1cbd492HVfHQQ2EDo3Tl\nrekFXxta6gA+6n5cgXfUFy7ifXEmWBZ3USPjXd/xXJi5EbgrcnSuXStDgOXD\nFtDsJ89bAu4pWsmgnTL7XSew3ZfEol/DdhPyM+FrDgLw+rRMXu5q0QzxTqkS\nhaFW129+8hlZK3CkQmcXqF/syChf/mkTUkdGq2TnF27uqjZH+SnHgjlB3nAO\noXqG4kn7z/KCc/MIyWpfI7I9PNcuuvBvuAZooEHsWNWkqQ7yRJ9vzKaZ85YV\nvBYLVbOyWdwJoqa3N09wDyB939QWV7ZCVqU/D9GqdMp8bSSgRNxmiQ+5f3EV\n2i3X/dfppIYBIwXwADpxmHzqAvF9htWUUJ8S9pcovnZCCV8bsYbQWBFuQerC\nCPR84cvEdJg/jVjiFTEF8PotVd7zA11bJqTS+p0xTYGgeIUqIdf5uSx1hI0t\nu4+6\r\n=yywq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6f6719c5270f569fd2ab44620e89ccd53a31f98c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0cde52f5a.0","@material/rtl":"11.0.0-canary.0cde52f5a.0","@material/base":"11.0.0-canary.0cde52f5a.0","@material/shape":"11.0.0-canary.0cde52f5a.0","@material/theme":"11.0.0-canary.0cde52f5a.0","@material/animation":"11.0.0-canary.0cde52f5a.0","@material/elevation":"11.0.0-canary.0cde52f5a.0","@material/typography":"11.0.0-canary.0cde52f5a.0","@material/feature-targeting":"11.0.0-canary.0cde52f5a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.0cde52f5a.0_1616457829756_0.06030374348619394","host":"s3://npm-registry-packages"}},"11.0.0-canary.48f4b67fb.0":{"name":"@material/tooltip","version":"11.0.0-canary.48f4b67fb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.48f4b67fb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a6de43e4281b616384415a5a5741103a09b40405","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.48f4b67fb.0.tgz","fileCount":38,"integrity":"sha512-u2wNZPskbvqbu8l72004MPfWLvh7pknSlf+0qFqWvWiu4Mb2ojJTKkuDgyGRBzj3hxim8LuLDyVoaDN2udAwTQ==","signatures":[{"sig":"MEYCIQDWn05elf7H3j0QojN/wbyqCaRhO++iLRupSkICfyXQHgIhAOXIUthQRttK5R8MuuZTRy/yb6x7r5k2GI/xU7BYF2r9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWkeiCRA9TVsSAnZWagAAf0oP/A/W9sA7owehe5MVPk6r\nucL5n4ikvbUegT8VwvPfPYgG4kvbkV4HtRnvgdenNbD4APJ2SkEXvd5sT9o6\nXvvaNl18si/1O6URGzvJv0Jke+M89FHAbcGAADggCCSp7PQgiIOaVEhUq2LU\nbkjYvewIBgaFaQDvt7AjBOtDIK0G6PVuIx3LMbv5LdP4qeXcnzdS5h5CyKaV\nglePBpYDM7FofYU+pK5/Pzd/dWjZiZoygr07FlJv1+VY9o53Vf6588G3eJe6\nI4IzsnUGHe2G0ilh4tpokgkz4VulKQF5TfDls1jvIDPmJQWVfQRRmIgoPhqo\nDK/0dyilvJ9JBAjlYMc+tzRHmYeeSV82IiJYe1bTH2heHcF+nfMyC2ZFqJ0b\nT3i/TXqst3ZhYlsbcJERGz4Si2yY/YL7O4K1IOwFByuigw+ailM8ccq0f1sj\nCEkgclp7OVlC3Txh70PfvYA3Chnt+J8xKeE6lpeFpgi35KIt57c7n6rYzCrg\npta/aqtI3sbH0oK6EeiRoSVFGw0u6c6p1rDsGwsgvmWvlFVAnLYjibE/cdyk\n6OUt46MDyBdtXM3r3ePzcvJDctbLsja87wj1tltqcIP+jntN8XGH9daT0QpV\nTC1Bkt0jJZj5uTpfs58gNslrqpEUutDhQ2bzwwffL0T1E4mrofcRhAfaiqwB\n28mh\r\n=QxFR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f83669b240feaba73206d330f10c80a9aa31c1f7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.48f4b67fb.0","@material/rtl":"11.0.0-canary.48f4b67fb.0","@material/base":"11.0.0-canary.48f4b67fb.0","@material/shape":"11.0.0-canary.48f4b67fb.0","@material/theme":"11.0.0-canary.48f4b67fb.0","@material/animation":"11.0.0-canary.48f4b67fb.0","@material/elevation":"11.0.0-canary.48f4b67fb.0","@material/typography":"11.0.0-canary.48f4b67fb.0","@material/feature-targeting":"11.0.0-canary.48f4b67fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.48f4b67fb.0_1616529313787_0.900213307127155","host":"s3://npm-registry-packages"}},"11.0.0-canary.0b8cff734.0":{"name":"@material/tooltip","version":"11.0.0-canary.0b8cff734.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.0b8cff734.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"28fd637a16c01192aa5f6fa07db333a1d211d718","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.0b8cff734.0.tgz","fileCount":38,"integrity":"sha512-OfFTlToI2XsrSdGxFgUKx7XnHDq0XVnYQKqUxoU9XX5WinfBjmzfjcBqURNJTBsZUw+UI3EkHRta/AJ64xs3jg==","signatures":[{"sig":"MEYCIQCljRrDiywgRicmOTCtbHwV2JdnoMwAL9cJbeXg1TTrNgIhAIhZaM5uXHsH4YJDw3z4/5PGagIMad9vpCCo2t6tQdzO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWkoOCRA9TVsSAnZWagAAC4MP/jZD2uxri21UQ+j0w6Rv\ncSoNqTz1x/0X57Q380s+9Uz+BuZ94yw/L6MdQlAkhfbtbLKGfJVr86nisR7F\nUnW7YMYQUZNb0AUFY1VKpWQ+fd5Twpe/xLQvLINTo6kj5+ZUklJcApVYMyjc\nLK6TrEkmcaIpRm9RUCJfoiUbyxiWwKufnq7asuP6CpDmiKCn6XjO7f9wdK4t\nO2dhRetfRy4L3qeq7YM7MeA7A71QllOMw06Tod6Nwl+ZwmBdSZVuJm69DHdg\ndh8SSxF9PS5jQj+A46D57pMdqiijXpXEGsX+lFctQqR3fId54Pn9n37Vy3pd\nXE73EDBI+M/NiteOubTLA+YOzyt+weZUWckiJ5lsUWSAflMzC19V8dcIIfbm\nuDUFBEbMxjkmRKwKxzQfYxWbIZU0liLOG4A9bB2zfwCNrhGKnBi7Sjy4WY72\nejmbOGskGwMjVLdprdLScheXWZkaKEgQv2urLCxd6mF/xo8YV8P2jTSlBRh3\nCRl4QSN9Scsr+QkKy+PD8MNXrCEH8MWofZw/WXyPw1BRhUIPqAu7lQ3izh04\nu+NbVVofwWEGAXMwBr52SdbUXm5VvNUcbEsmylu1KuOC9KJAB11IWhs6KNxL\nstnu7EbehZ6wyUKLiO2RjAho0sM/Zp5c2Te+Q5n8+yt9AQYmDkGjHe1W7qi+\nc8E9\r\n=+JWO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0371cb1671557f9e1d8a3bee3ffce11bdea058d8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0b8cff734.0","@material/rtl":"11.0.0-canary.0b8cff734.0","@material/base":"11.0.0-canary.0b8cff734.0","@material/shape":"11.0.0-canary.0b8cff734.0","@material/theme":"11.0.0-canary.0b8cff734.0","@material/animation":"11.0.0-canary.0b8cff734.0","@material/elevation":"11.0.0-canary.0b8cff734.0","@material/typography":"11.0.0-canary.0b8cff734.0","@material/feature-targeting":"11.0.0-canary.0b8cff734.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.0b8cff734.0_1616529934499_0.1684556626146736","host":"s3://npm-registry-packages"}},"11.0.0-canary.8943b991f.0":{"name":"@material/tooltip","version":"11.0.0-canary.8943b991f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.8943b991f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e46abec26b3a16b95f512ebd871d8251c919e8c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.8943b991f.0.tgz","fileCount":38,"integrity":"sha512-CZjIlVdFWMf47jd/ph5rbaw2PkP+hXKbcOEA9Bo1LKPZLpRnGSaBR2qUPTkbAGADdjo441+DZ0kRfAvpvhTyEg==","signatures":[{"sig":"MEQCIBfLwXexPQPvtSPnUT2N7rQDTbq5ZukdRmehncmFDB9IAiAoWCvnW3v9By/5PviaHAVMwOsC3qNE57UCz1vcRNUkPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWk/tCRA9TVsSAnZWagAAWyMP/jmACY0q7BeHJw84+xb/\nJ/+F+jz6LxxEk2PqDVgNHDufjHcPKjXHpFlnblPsSrNBj+zqenYJjHWbzV3c\nChcpVzq3H3ySuGH9W8PnceYK6yTh/VDfdw756VA0uDlra4MGO1sjmelGeAni\nYPBRc9W6Xc/1Faef9vdt1mZeoASVaOl9A51D7xvY0pWmll/D6In28bByg6Dz\nC3Vvppt1HpPQa0Ir2TEdcUrG11BW2rgq3QUnr6GmF62j7S+HwnE+V4Nq35tD\njt5vDrJzIURgD0UxfRgha0ngPIe8F/HaDEdiBkeCLkaqvXWDjwMOD6lnZ/r6\nR+R2jpntoyBM7wnfpdCMqWVkzMZOqcJvda3BKiJYL2bz5wc75zKHacQ7Vs5L\nofTM5jvprNSGyHwpkKxGUzcYMUEzP8K8PkoA0eY4ycBibLNLrVGXWDB81O3G\nOLwt7I4a6Q1lTUJkenwezdopQi8H3pnIUs3SLOxjTHv7PuKoiAr1CxCZBU0W\njNzV9yjQNnCKBqZvYHWgUHrZHz5/zxI0gdrm4RQJZvoxJawuhDP0/9y3de6y\nDkwT4SuGhp4Z52V8d6uLcmu5ZbryFMc/fdvuKOl8lEEuRY50Tvq6EPt/675D\nthfxwrWukals2Rtu/2IE8FmFWWZexvpwflmYVdQunHWCP9O5KOjy4T3s4Muy\n0bxB\r\n=WKBl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"85cb2528143c5117974441e499367a5fc252b745","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.8943b991f.0","@material/rtl":"11.0.0-canary.8943b991f.0","@material/base":"11.0.0-canary.8943b991f.0","@material/shape":"11.0.0-canary.8943b991f.0","@material/theme":"11.0.0-canary.8943b991f.0","@material/animation":"11.0.0-canary.8943b991f.0","@material/elevation":"11.0.0-canary.8943b991f.0","@material/typography":"11.0.0-canary.8943b991f.0","@material/feature-targeting":"11.0.0-canary.8943b991f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.8943b991f.0_1616531436685_0.3167786444755927","host":"s3://npm-registry-packages"}},"11.0.0-canary.3955d8d3d.0":{"name":"@material/tooltip","version":"11.0.0-canary.3955d8d3d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.3955d8d3d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"73b5dd35aef14515684d1629dcfb6ad176ef5f70","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.3955d8d3d.0.tgz","fileCount":38,"integrity":"sha512-TRjbAZ4VhINfPzChymTBvI5SgxK7uT+fonRXpNayjmxiUwl859xOHivayEta7uukfwCeSqjXZLkSBCviaXdj+Q==","signatures":[{"sig":"MEQCIHF8gwZ71D+fYYpnh5n2hdXFXa2fsHr8SGECZIpwdKN3AiApx/0Op0q2g7E26rsn+dJJkL+E/Ti3Fum3f18wA6q3Sw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgW5BKCRA9TVsSAnZWagAAUMsP/0d1nxdfh21R0Di8K2Rm\n0fuXI6jURyTz5TyV45uVSTFbVU5lTEByX9EpaMYk+Y7Tvh2257wiN4+tioKn\nJZAk777bN8jpbL5UAe9/e9BEh2jFwl9+9Gm7bD0SBzybSIUVK7i45jx4Uxst\nWwvdaNl0Bjytt8yKVeTmSX/zPhzA5rEmdZCd7xDJAX6eloIiJL1VeORlhjCv\nyxm78I5xpyiknobO7cNiUjEEfd53iraO1j0B4c2QCbtZvjGcSnv8eaCGc60d\nk3VJkeZwVr0imywzWI5s7CNqjyFWH9kUo/6vrZ3E4Yq+vN8Moortma8deQ76\nFR5YMJS0hD4nwFsnutEnT1OvNmFyItMYIv2c4MLlFVdOSPnIGGyM7fQ3CGeC\nl9RjNtzhITPqVtFrxyMYW8z6CeH9q5pjPB9n7qMY+ZsDOgjuWFgGu8J6WOOd\n9tUdpePVQA+oVf7tI6dD6+ArJNs1XC3JHsJhiuYLR3CSczibAHPMGdv98zpl\najLmWb7HnjHHiGxuZfqaotORhhb/9IREkoGwxHRBcsMZ9o5+J4Jr0xVfJyKV\nMYIfIOAGARzZ+3CNPlfgtQL++QlDKf5OhD4v0F4NoNvYC4i+gVfqkyZZa1qT\nKJfA6WcXXDpdTmBB2LuA30CRBrmT9SbtcQ7URKAVmQgudCVez/cGfmdVf+ni\nvbJN\r\n=RRzu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2679d736975b17823079a52aad1e329d8c2a3b71","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.3955d8d3d.0","@material/rtl":"11.0.0-canary.3955d8d3d.0","@material/base":"11.0.0-canary.3955d8d3d.0","@material/shape":"11.0.0-canary.3955d8d3d.0","@material/theme":"11.0.0-canary.3955d8d3d.0","@material/animation":"11.0.0-canary.3955d8d3d.0","@material/elevation":"11.0.0-canary.3955d8d3d.0","@material/typography":"11.0.0-canary.3955d8d3d.0","@material/feature-targeting":"11.0.0-canary.3955d8d3d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.3955d8d3d.0_1616613450142_0.24749679456099405","host":"s3://npm-registry-packages"}},"11.0.0-canary.23ea2d85e.0":{"name":"@material/tooltip","version":"11.0.0-canary.23ea2d85e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.23ea2d85e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"279689cb0baae6fd5c21d6e8b3ed37fbdbdcf07b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.23ea2d85e.0.tgz","fileCount":38,"integrity":"sha512-vZJAksolAuyfqYBLPOEViKsMMY0yzLDbUSpHUpkmgjtpTBnAjfNxT7ELn1GqAYvDDM9Ul9V0kRWNl1QiHZIebQ==","signatures":[{"sig":"MEUCIQDkJc4jYViFClCwSo4WJLxec4cmtKw5pm3TsRUVgnetYQIgBZZFWAIhMlB+oq0h7O6CXTTsJwO4qEAUjfM/WIjHRUI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXMl5CRA9TVsSAnZWagAAd74P/jE9V/pFcNDLFsXAT202\nk92H/P+cTfnWSo0FGjJq4KuIRZ25WZqaTejetl6jgUM/qNOkaELtHeTdN899\nMZK7zC/QhL9SHV5kiVliIuoAN+h25mhQHViqjMiKMv/RqN8SCpW/kqXzaW8+\n+aCD1WDmadjOle/oliMnIREmPhVeSwWuCkEWbUWlU80v2hrzft1A1cZK9Kui\nM51vFquKtt66355ZBWiWP6LxPmWD9Lg/mwxYaS4D0dTj25tlQpPlU28Kd8L8\nnefviYJtjkjPrQoLmBDltaXZyzjNXuViniZJtwhEpLSOdEpbITe5nV8L+OuE\nALVJeoEGSYtwmjY8qOrE5N1w7VQAjhx/ulruyMd6H2EqbuRY3Ggf1H12umH2\nIVInxfhMKlrKvtyWmBAGyviLjPgisVuIzYuwfu+Q+SXGsVOgP1VUJq7SKdzZ\n2jX6eVM/sWwHiZXozmF7UMRfmGue5AQQfGaPA1CtLeCY9+Luc3iXgxK9M1X2\nA3zsKC67iCNiJpGnSshs9o6fdHeIdOLZ2JQvQtzdiD7wQgbz18qBYlZoDRaB\nLej9oGgyFYXT2Y31rKAmX0H55qeVijmLQzfEloxbTYgRVMXtbbV3MsMO/m1d\n28GxmlHzuXE57OcccYBbb4jixzuvYwIW3Ms/gIxm/JBYYMDjm4qx2I20hq7t\n5WUm\r\n=lnEh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"705a9cbab9462d9e300da18c26d7992aec452ff4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.23ea2d85e.0","@material/rtl":"11.0.0-canary.23ea2d85e.0","@material/base":"11.0.0-canary.23ea2d85e.0","@material/shape":"11.0.0-canary.23ea2d85e.0","@material/theme":"11.0.0-canary.23ea2d85e.0","@material/animation":"11.0.0-canary.23ea2d85e.0","@material/elevation":"11.0.0-canary.23ea2d85e.0","@material/typography":"11.0.0-canary.23ea2d85e.0","@material/feature-targeting":"11.0.0-canary.23ea2d85e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.23ea2d85e.0_1616693624916_0.9998665970758813","host":"s3://npm-registry-packages"}},"11.0.0-canary.e3ec22f45.0":{"name":"@material/tooltip","version":"11.0.0-canary.e3ec22f45.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.e3ec22f45.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"06be084fa353c4fc9ae94bf7703fbadafc51e406","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.e3ec22f45.0.tgz","fileCount":38,"integrity":"sha512-dnqpiW+iY25vkhOubXkomIYac+TK6vp7KPt3VzfrhK1ZG/vTq5Kjiz+K+oQQFQlJoFDn5tZQKUGle88MvBclPw==","signatures":[{"sig":"MEUCIQCeXynGVUe+sUzUSv0aHT5xQARSxWJZ0nESLP8I+ovFGwIgG5MD40ELFz9Gaje2y+gfaBJuR2UGE0rXn9e0OqZd4nc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXM9aCRA9TVsSAnZWagAAIzoP/0i8U+iOYeeGYlHOCQej\nTAuhn2dk25YojFOI6sgj1ORL2BT1ue8KfU54ZpsjkrlpzgMH37gblEJrQEJc\n0bqFpYIeym+VTK3VKMKDDrjvRQlVd8DSeedMXjM6TtGdat8O2i21i4kA43vq\nUkH4vOwqY9kzNqf/NQSqN0sZdeH59bRkOhVacaZWMiLgLR8GkxcqpR9RhAMR\n/2FyAmtbNRsAmTwrfa59ZLCWIqYe2VQmtauQXs2bjyJviUXVTHdDbmv/FPRQ\nmMpa8fxqPw7FOb1JkxV+wwgHHvAx7ASr/YoZFVNFO/77XODP5o8EeDpIYiV5\n2huFHQ9zFvUO4Zo2l8GHRfAJTYQs1xmGWXEASYxkeYRzMuzrFZCcNhaNY4y5\nPr9q2oNcBPkQmElCq2Gal9ENrQxF6y3aaAZE9b3X6MpnuItimbJTBLuesNFV\nzqrbHwkctoux2zsv1vnrzI8FRDDwAgM/h0f0f0owBDIEYLgViW3wWbz1qmMN\n/1DEHUzTfDm/n9VIMJoUUbGMD3nl2lvRxZoQIiFpycxXC77H5r0YuxCSScCv\nueDG0bljfnmSmPreumL2VW7I9NT+bh6PYfU2D5AINwKFBrH9LiXfu7VgeVGU\nfbQtshjms9mAIGWZq6Fh5+Ri28PqZYtL/p9YJEhgbWUy3ILXVi+lLt7U0mAF\nreUE\r\n=WqQs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2827fdf50a2ab264554f8f307d61fddbab82c5cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.e3ec22f45.0","@material/rtl":"11.0.0-canary.e3ec22f45.0","@material/base":"11.0.0-canary.e3ec22f45.0","@material/shape":"11.0.0-canary.e3ec22f45.0","@material/theme":"11.0.0-canary.e3ec22f45.0","@material/animation":"11.0.0-canary.e3ec22f45.0","@material/elevation":"11.0.0-canary.e3ec22f45.0","@material/typography":"11.0.0-canary.e3ec22f45.0","@material/feature-targeting":"11.0.0-canary.e3ec22f45.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.e3ec22f45.0_1616695130350_0.7171757194948536","host":"s3://npm-registry-packages"}},"11.0.0-canary.4ceb42220.0":{"name":"@material/tooltip","version":"11.0.0-canary.4ceb42220.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.4ceb42220.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"290e941a6e9aabd9c824b38e3d6a8e4ecb796956","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.4ceb42220.0.tgz","fileCount":38,"integrity":"sha512-VjBJE7/YdzyOF4QHmNx95beikdA7owCMRCWnU2NMA6G4h4VWrzStGHAepMFJZCpcUobN2O2+7xQ2eEF0IVyQ3A==","signatures":[{"sig":"MEUCIA9BhFSFf8PYZHzAvCrKd43/DldgMwWL6weOICzO10XbAiEAr5/vuaBavVckZftUwLIGlJyZ3W1YbwtmNQPAPVUyaik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":626679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXZQkCRA9TVsSAnZWagAA6ZcP/1IRPjqLUQjIg82F7cwp\nG1YYIxn1ewZagWfegLOTSS2MkOD89TYEVDKUXSGKjdM6Kt+Xv7vkU3ViyrLY\nyLCAnjSLtdt/RFiQLI2bAT+8O6nne2CCx+M2BvNost6DlmNaI+gPh/P5cOkK\nce94TW74yXTAGFrTYMBzJRIKNput/uSFHev3udBBRYjUkRBU06COcBO93skR\nofjbmkRe0fPAFKyehVJzJL2XusevbaQIoiQhBHlZVBzjSj2U2Yd6Ba1PvNwx\nJNZpQ2+t2hB2g4/qOTkVwLi+GRWHgauSyEP2CioUB04xXJCUb6921aIhr5jC\ns1sszgo8wJjKiClg2GrEA4eaLJMLIqOkqik0Nnc8WGPVe62W9GUQ+9YudvTo\nUeWfm2eghALAIDta/1n9qtHBIf4QHFZh8ELAHZdOuoiFjzpZxrFhuisQbdCO\ngCleFnu1KKJCJ1igwdgs4WgDdfnf3f/v95pfee6hwrmVvW4NBMyZmXZpOrE5\n02siSO7+3aDiI1CAZWdtMsBbnvdV+goADiq4ZOnsrSMU9r67hPs8qKN1CphV\nKBSE9I2fBxNVVSgNJPLMgt8BO3qiKgKcNFSVOmCuZmSMoOULXwo8JV+CyGi/\nQT777TFmuX1dgKnsod2+k4vgwhlcMtGe8/b22o8T9Zq4xo1s1CGkuJW33dun\ncuNX\r\n=jFTg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"75fb611f33737c857d1b59245ff5a31676d7f3ee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.4ceb42220.0","@material/rtl":"11.0.0-canary.4ceb42220.0","@material/base":"11.0.0-canary.4ceb42220.0","@material/shape":"11.0.0-canary.4ceb42220.0","@material/theme":"11.0.0-canary.4ceb42220.0","@material/animation":"11.0.0-canary.4ceb42220.0","@material/elevation":"11.0.0-canary.4ceb42220.0","@material/typography":"11.0.0-canary.4ceb42220.0","@material/feature-targeting":"11.0.0-canary.4ceb42220.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.4ceb42220.0_1616745507656_0.8050139536685081","host":"s3://npm-registry-packages"}},"11.0.0-canary.dc9c84023.0":{"name":"@material/tooltip","version":"11.0.0-canary.dc9c84023.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.dc9c84023.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c3509e49d5231184f84c4bb4ca0be15851d0c27","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.dc9c84023.0.tgz","fileCount":38,"integrity":"sha512-6IbHzna0IkNipq8ruYp4G/ZhITEZ8Ah92BAj5y9LUhEjWRZ5HvJi0SaqrnaoW5ihVQZEsuR7MqyNLvrev2abDw==","signatures":[{"sig":"MEUCIDNNnDzdCBEZIFX+vKIdWFQxEKeI7K/Nmg68mmcvyeBKAiEAsiInZDbjiixdiw3RF8t7KM8ycgPSxh+H6VB6tur4NIk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":627028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY2SiCRA9TVsSAnZWagAA4+UP/3xmvkLzD1xdGCxUpYM1\nDTeWcuaGZv9g0ZYHMzZGBqRIYgMAeqKGyhqN+9VKdDsjBNZHDpOsEReKntHG\np0U8YVpMpFihwBYYI005MNkc1p2P6C6vvaKbPIp8kZjSnE18sYmNPSVSF5UH\n+9hbMrqo5tIbQMfxbSV2OKQLU3VzuyxIt9n0z9YK39VKCO9e+mMDSFb9MUf7\nP4FW9rILpegZ1e0+5GnuhX0cI05abBsnV1aRZi6hjMqECLtQHMLVCaHucEIc\n4Qrr67wyVnF1BJQVHi1VH08erOta6qRtcJXPJ5C0WgYC8RnfQK+znq4WUAOL\nz5ieY+rEjk+EiejvJq03ydf7mhcHkJ1TDu/l5MMm8V6sccJHel9b1LgLXFG5\nOrH5fUqPiaLRiCKCTLnkvxwWnyzxks0TcMw6YZKsIlbYnHsr440u0iDjY5yk\ngIOc8+Jikls1ATnzCXc7c4ienK/uBqslaWfN6zer9CdxmLO6bzQzpJH0WnTd\nXbwEp0INVV72uieRHDhxVBImXadLQI7QOypEix6q4Wt5/LZ9Toy4priIEIEo\n9khYYljRbXi1ObI5CZGwoq+OgrIIyERCXEbNwaMtH0ks3kh65c5lQh5Phgyp\nvtExiIDOG+TJRLiGs2E4h18iUdiF9avU7pmehsdAxjikFOCpAMO1/YrTFwXr\nIWKx\r\n=/Zge\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d7f7ddbc4309b6a8ce5cca3772255dcc6acdc701","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.dc9c84023.0","@material/rtl":"11.0.0-canary.dc9c84023.0","@material/base":"11.0.0-canary.dc9c84023.0","@material/shape":"11.0.0-canary.dc9c84023.0","@material/theme":"11.0.0-canary.dc9c84023.0","@material/animation":"11.0.0-canary.dc9c84023.0","@material/elevation":"11.0.0-canary.dc9c84023.0","@material/typography":"11.0.0-canary.dc9c84023.0","@material/feature-targeting":"11.0.0-canary.dc9c84023.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.dc9c84023.0_1617126562190_0.09571723688674427","host":"s3://npm-registry-packages"}},"11.0.0-canary.56fc26962.0":{"name":"@material/tooltip","version":"11.0.0-canary.56fc26962.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.56fc26962.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b4a5ccab2402b8774e92eaea491d3ccdb9cd8d0f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.56fc26962.0.tgz","fileCount":38,"integrity":"sha512-JYMFEKz2+tN7tqxXTrbL7QDrvBgjHTMHBaQOT4lKY/UVItW+CDNM5NXEFOfto26r392qH97/23sQRG6/CdRqLA==","signatures":[{"sig":"MEUCIQDM1Tx03EMpZ0Z2ywrvrJ3sZnZ332wAwiyf2yJQT1K6lgIgS1ZnqopfpMtCYT6VA00WqCWVFj4TVKEcEUixdD/fqTA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":628144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY8CSCRA9TVsSAnZWagAAbdYP/18asSK0mPjF88mxueqQ\nd49QzOoUYEN2u6QoIxS9uc+6n+HgXqcfKX0/YDlOI/UQtIK0iUJ78IPI9hYS\nrhLVFzdbb5q3QhioyXcKbZdOr/6Xjw8fKZ3IDyTK3SvqxBMYuEdfm0zmnuPU\nhv3RatoQQRNttekH+zpeBaCk32cEm0Ad/kECqPWTWepc/SZWrprkDx6j6oMd\nLHbsj78aueg+5uJ23loDd1rWfq//3Ka9ZGPs+FtOGNvXOFSebzdN59adw4+5\n+2Zn6umVKFrE1AGTU2tOUlLMfeww5rwM7PHLVFQv2k63vkLkZ4mWqyHuwUQy\nVtzNnUthF5ulpfUScpDIblQ5EWNy55x/QDw0CCQYA4G00wGxsvqmfroNI7KY\nDTvJkdDFT1x5Cp6jluz03kHo5QAz84Tk527kQcmGVKuSmWyy6eOU4ppJ0wsU\nzD09+NQfT/3B9pskNQ4WJgSL9zXQPbczoHuN2doQ3rV7gRxjEBvBxriJvxKi\n6mNkL69QjqDo9qwAMQdoA0hbx9qDsDarM1xQtFPhnRbEC2C5r21/UX+jXDx+\n4N4W+2dcn6jJ7j1pQoOE6dzuoqf9f8XTlyiEp5dQ/j+93zicvv2VEKOG+nSp\nE9tsBNssuvP8TS2AsC/wT0yCII+9lmsk7mWPUdL1AL8cSVXz58lrGfqYQpAz\nov/2\r\n=y99X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"dfdb8792d4ee8bddc61386ac6a8e7e216c1681a3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.56fc26962.0","@material/rtl":"11.0.0-canary.56fc26962.0","@material/base":"11.0.0-canary.56fc26962.0","@material/shape":"11.0.0-canary.56fc26962.0","@material/theme":"11.0.0-canary.56fc26962.0","@material/animation":"11.0.0-canary.56fc26962.0","@material/elevation":"11.0.0-canary.56fc26962.0","@material/typography":"11.0.0-canary.56fc26962.0","@material/feature-targeting":"11.0.0-canary.56fc26962.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.56fc26962.0_1617150097696_0.019903576424483038","host":"s3://npm-registry-packages"}},"11.0.0-canary.bc318250e.0":{"name":"@material/tooltip","version":"11.0.0-canary.bc318250e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.bc318250e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"967a660c28ec9df3fd4fc39bdf812758b7f0ed8e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.bc318250e.0.tgz","fileCount":38,"integrity":"sha512-t7ex5Nz8Q8uR8yq3ZXPW7HmeWSWuzKHBRRlwNLkEdswOTpZpdw0YF2a1Z1Spi0D+lwPuFwEB7c8BJJDAGkXQFg==","signatures":[{"sig":"MEQCIAHelYSR1BJJ/Zv9Dhu71GXO6KfH3FF9LGgPPOqR5xraAiAwrsWIMK0024UmEy/tQf7I4R27dRN4JTuqQ0S9+YpdvA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":632693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY9GqCRA9TVsSAnZWagAASZIP/3lEKzCHdBAeV8HdbJQP\nMy9/Dy3XG7PD3TJCfvtbnsagR3ZPp7ZRMpkldembQzmH6mnf3wy0Aa17DSdE\nH1i7+suEk5DWYy0pPhUCSCBj13uO1EqyztIPQT+GUwpJPXKXfJjjYkTDwnPv\nH3PLKHVk7hs3GSEwX1wlLcTE9pr69YUN0ZWdTenm0Pjg1kGp5hxm+yclIPxi\nwaWDAoesdhGnqleWsBYAotulnPQNYStupcqQmUziyz6adPLKYuHyM8RPSUAH\n6xR5eM/9XintKkofq9UaaujzZdBCvDDNAq7le0XLGGhNzZuiFmE0FcJpRiFL\nLPskHw87Z62xRLRRnWchm6w8Gn21DfevgPyIs/Y2Us++CiEVPoFJrbDJdWDv\nB23joDRyzFQ64AHJKsgXvgJ90z5uVZ/HZt7NTsZ6ZYegoN/mK4wHz1EHZIyh\nNbHrpqqLl4tQlW/5s0hAjl7amp2kM4p03HM8jbhiMbVSzbfM+41RSRH9Xjzu\niqr03R0iu2R7GQTeYqsMTZ9ITT+IOqaGIz7CnLpFf16xEbvEJ5lxx6EUrOYh\n0ys+kvaXpDf2Gk6RQZPgXKTjlSZyds9MO6ndSLoF6NwEkgvkt1IUXzU5cy5G\n0vwMjTDXwG2ZZs0J0TpcRZOEYo2gzFnPlxzaKvpgb4JqSf60ZTpFPQ4qjDuf\nKPDa\r\n=+oNf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1de1daa9e4e0ee7a779d524a027b9e7566841b56","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.bc318250e.0","@material/rtl":"11.0.0-canary.bc318250e.0","@material/base":"11.0.0-canary.bc318250e.0","@material/shape":"11.0.0-canary.bc318250e.0","@material/theme":"11.0.0-canary.bc318250e.0","@material/animation":"11.0.0-canary.bc318250e.0","@material/elevation":"11.0.0-canary.bc318250e.0","@material/typography":"11.0.0-canary.bc318250e.0","@material/feature-targeting":"11.0.0-canary.bc318250e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.bc318250e.0_1617154474367_0.045085763422139324","host":"s3://npm-registry-packages"}},"11.0.0-canary.edaee19aa.0":{"name":"@material/tooltip","version":"11.0.0-canary.edaee19aa.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.edaee19aa.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"38214a2d597a39aebd1de099a4fa6adcbb8427f3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.edaee19aa.0.tgz","fileCount":38,"integrity":"sha512-kC9fc8xAxfJOhQ02ZL3ejrb9ft03AEW1HC9WLndtUvLBLfwbEucpK6+Kc7HMqoZAyhBRfsakM1GffN0Zr3hiyA==","signatures":[{"sig":"MEUCIFORqk4aUKlble3/+kYgq9JyoxijrH3jtRnh/7r+xSp/AiEA6TQ+1aYVKVLlUxy/FX9go45e7DD+Y7cTrtE1CQo0un8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":632436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY9qKCRA9TVsSAnZWagAA+ZgP/3fZMG/S/c4nhYUb1ILI\nrSB4JEN9mKP296lGj83m9y4y4oIAiaMM4RgjbDFXQlwL7s2Ac5i+nJnmr4SG\nDFLyiifxCud5kYyC+Lq6CtQcislALYDDbkCMFQG1jPsBuSAYvqaxwFJwu7g4\nNqjgWXT/qpLMC67Jkhb+H//TVPi4a6zWLkizL7wQ01Vf7InzvSxlxu4ZndWY\n4IFjZEF3IOizRuEpYOYDEQy4h0X82Q0w5jK699gG271SnaNN8h2qzFaZMcUT\nBmBXpw+pLBZ0HziCaVrjtH3zPYrpgUeWu3xPZ9l0e2scFBFxF5v0mEPyR3SU\n8N3NOUj+xsRmI26uBv5GqVWvsjRzzQjA5pL4Jgtas1aOndkItiPaFQLhQ5BP\nU/lHIrZu8CdDgJ/FmASUpnzTOi4Fmx1odp80aMUF0uXPNnEFWiY/JKIX7Dyt\nUD3zEBR3IPU61ntgzfJyQML92CPI93VRlthRfnS3onZKqW2euy0cZN+uP7dP\nq0qAr/URcKtwrwFPlHfvm78l0FUxweFJLg2u5ncHrEjZB8hGzZjASUa6W9vs\n6CUpBZxeph9qTybgWsqxrV4dChtM+nXJxg6Qrue1XCUMGrKdUXyZAg0KinmC\nEXFKsJLG8Dw+GjVudJtch/pOJHX3ZgnT8SwwheRlm20QpLVAkGR2yV8f0eJA\nNiWu\r\n=Wl5y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e2249b4be4cc5bba6887f28ddb9a3b9cc8ee09de","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.edaee19aa.0","@material/rtl":"11.0.0-canary.edaee19aa.0","@material/base":"11.0.0-canary.edaee19aa.0","@material/shape":"11.0.0-canary.edaee19aa.0","@material/theme":"11.0.0-canary.edaee19aa.0","@material/animation":"11.0.0-canary.edaee19aa.0","@material/elevation":"11.0.0-canary.edaee19aa.0","@material/typography":"11.0.0-canary.edaee19aa.0","@material/feature-targeting":"11.0.0-canary.edaee19aa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.edaee19aa.0_1617156746068_0.11669349388956696","host":"s3://npm-registry-packages"}},"11.0.0-canary.24609b822.0":{"name":"@material/tooltip","version":"11.0.0-canary.24609b822.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.24609b822.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5780eced6b27e7200153f174ba14b4a6c571dbc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.24609b822.0.tgz","fileCount":38,"integrity":"sha512-oMl+0lyxh9HcNZneObUtUexarAflAe6CtE9co0kILv2KxF1MHgtnHf05thBXms50UeFyBWfehO2c9mjqTyLIwQ==","signatures":[{"sig":"MEUCIQCWNJ5PB7K2161M5g7WatMbvrL/oCa3MkLdLBSsOIOUCgIgZyNB6HyktiR1jqokPFjBfriO2zw3nDDKEGDzGqwvICU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":649921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZOJNCRA9TVsSAnZWagAAUqwP/2oO6gGg+o6YIRQBdTQt\nNnRgK7TGBHvkq8ht6nykZljrHKkt7Um/dQaHshqjGT9X6ymqfyCNHIsn9rYc\nwxccXFOvg3QHl/4L/FAUh08QuZOe9wty88glXLl23o57WZBMVHhUQ6OljSPR\n4agf3+XTVLRiohHE4tMhjrNJ6ehBv1G/N1LW6i8DVGk6nw0V/96wHWbcLeST\nxQNMa8bbTLphFjnDIfyX1CjYrtCoHtlxbCi7SWvwwB8lSHRw2z3G51d2omcy\n1JPobsh9Cc5lPJk+QacOM8ZsWvt6Juw465OwDu1GysbGRvZ/es1IwSJelcmu\nc3L3EmHcjtQOSuxWgNEQtdVkOSB+JLiDc6NAZDfL6Dn9aKFOcf9gFsexAIit\ncQttlmvIWvyiAZcGBFLHxfDRHkmSF1hRCzUIGh/9ERNBhcyHXTsD8zDA57hk\niFTfw141QsmcioaWFbKzizh+aQGsVtyoVr49Ps4DEj/1tCPmIXhFa15eZbB6\nHCokoR57i+IvGqzTtGC1OshWx8DlLGewIMf8+/T3OUsPGzWnh8m7fcOJK11v\n24YLG1bSCBNYfpi+5CC7SQvk+tHRkIdAzYYpBzC6urGHahJv8tTxJG37IlXO\niXuGm60fkifUq0elwmUkmeGhFax1s7YpCCHWay/t9JqHAKWTMEFf81AkTokN\nBtk+\r\n=aHt9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"50b495134dae6937c2262389aba694d7664f78c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.24609b822.0","@material/rtl":"11.0.0-canary.24609b822.0","@material/base":"11.0.0-canary.24609b822.0","@material/shape":"11.0.0-canary.24609b822.0","@material/theme":"11.0.0-canary.24609b822.0","@material/animation":"11.0.0-canary.24609b822.0","@material/elevation":"11.0.0-canary.24609b822.0","@material/typography":"11.0.0-canary.24609b822.0","@material/feature-targeting":"11.0.0-canary.24609b822.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.24609b822.0_1617224268647_0.8440171150827127","host":"s3://npm-registry-packages"}},"11.0.0-canary.b6cddc2b7.0":{"name":"@material/tooltip","version":"11.0.0-canary.b6cddc2b7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.b6cddc2b7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"27e93a0e40304b28a16ebe6f1a682ce00bea6e2d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.b6cddc2b7.0.tgz","fileCount":38,"integrity":"sha512-O13NY4O3xmmjC8b4xdK2zfUe8XPD0seJOFqlP7OE863TmdjFFT3OSMiQMjakKIuLffrE7aZQgJHiSZbW6MoLGQ==","signatures":[{"sig":"MEYCIQCjC/xEIthQONkPhm9VWd1jox2aeMUp020X+TPaYqqj7QIhAItFiNjVbUw4NrD0xfxIF1TCSQs4KXqLpEEpvyDUL6A7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":649921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZeFjCRA9TVsSAnZWagAAp+4P/j5Y3BAQH+VRRMjDJ63P\noU7SKclipYJD8R+8dW/42G3nnVEwAlukbWWwIxO73Q1T8xDL263A1yJ30MWa\n4EP6VCaR44BVkdbBEimyh0cBsTAooeg2IQYasE6NaFCANkKkscLFu5NkzW9A\n4hiVzJuSa9b5ETirr6e4G5Sudg0fNjLvhR7ct5uMnHVV6/QTbfGIXUiJESyX\nx8Yocee2r5wPvhBdx0fzJ1jOeC1x/9ZUYoYypyLWdpSJokK/TjqICd0mnXbx\nM2U298TmBcxPsJgBb4Y1e83mCQ2nX6vhpmvIa4F+JW4ktKlMIMBYHJ+wJTPt\nKMEUXMmodog8D6KfudbWn7aHD7HHTXk6iJwhfDL9dPqUpUhA6stDLB3qWckT\nJnCJX4ZPik32ZljtoQbnSWL+Vjtk/gTM35C4q3rrVugW7fUHUueaXmpuxD/s\nT8cggNfaDDGe744o/IEt1K1xoeBIJIyQYZCy3+3DkJ0CBCRxIC2ToinF7Eie\nyUJovSFVjn+An+C5CjrifW7nQtaWBuOldgacBhWMmU0YfUwVgMNaA5Ru5uoc\nwlpHJR/YQASD9j0PvuNkegT5CswXwQjTrCZQyiMaPJSBJ1YjrNDsCD3JkE5r\nlp9JU8VkgKnMGk0zgj7mxLdY5Viws/yM7sxJmS+JHfE0CyLjkxVYaBiNnu8P\nGjfR\r\n=Ylbo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"dbd92fa1a28a9b31a1e4eb476b15f4cff38986b8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.b6cddc2b7.0","@material/rtl":"11.0.0-canary.b6cddc2b7.0","@material/base":"11.0.0-canary.b6cddc2b7.0","@material/shape":"11.0.0-canary.b6cddc2b7.0","@material/theme":"11.0.0-canary.b6cddc2b7.0","@material/animation":"11.0.0-canary.b6cddc2b7.0","@material/elevation":"11.0.0-canary.b6cddc2b7.0","@material/typography":"11.0.0-canary.b6cddc2b7.0","@material/feature-targeting":"11.0.0-canary.b6cddc2b7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.b6cddc2b7.0_1617289570624_0.9400330922133668","host":"s3://npm-registry-packages"}},"11.0.0-canary.94937c78c.0":{"name":"@material/tooltip","version":"11.0.0-canary.94937c78c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.94937c78c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7cd23cd1ff4a662db2a70ae385ff4b9611105d69","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.94937c78c.0.tgz","fileCount":38,"integrity":"sha512-2BVEOoFg9pGzVfuQhCFknE8APG0nXBr7CwoWq2VMBp/MN1OX7MhJSxK+OzYmwwXLPxnW0DK/rF/MiWcRT+cn9A==","signatures":[{"sig":"MEYCIQDwF7MaS5s+iAef8nZvtcGMoOnJXI6dqrK5BLu8QCtA0QIhAMxepliLELj4sClnbvX6RUFbiGEVVjMlguW6YX+EMi9u","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":656620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZjS7CRA9TVsSAnZWagAAmwIP/3Yp8eRno+B8Rs8UxDzJ\nz4t28EBA2OhlOb5cPCNPJPdlRiyRRRrY1axySVsg61Shi+XmHLn3KEDmZ+0Z\nB07yS/bRO6A0MBDJNLQ4mVkHO9fqNK3Nlzbh1pG1hCHa2BN76kdxubv1qILg\nZs1neMxD0ASOeltg58/9Yy/8NMQ2FEk9l/jC9+cp9sRU4WhUC65i2z6joFLR\n2Bs8OYRDvSsQCRM9A1k84FAmipmj6GIuIlbVqK3+GLDPJRNqVy/sgXaSyaQr\nxzCyCLCwch+FdoMgM8etr9aqEX1n+pdvyuc7k+ZiUS8JEy7hFA5w6MRxRkrI\nkFnX5FTSk3GaG9VsqPy64App6lOuIEtILmxicSLtrumwux/gwjB8555FJvuJ\nnDdM/JT02mxGIQY4IvckPuCU4S+jr+sItr+XEEbXTSwvQzdvJQFO04T/Q4l/\n+boDfkalswncBy3o1N8Jm/A+L0W0jLU0Xter0UuNgUrxgspiJk8JNh68gnrA\nuDTM6fyurQWTjokE/udarFKJEbWUliS1O+t3QRR0tYlsrSxZcoep9Nq7/+6V\nrzWsymB68ABzJLpWXgPHdQb0sd+AiEXDBVtU+XSLKcA9h3kEAqZNINlRl2MW\nvd/o2N/ogma27Gay9h/Yz0S20/1zZhgqNo3+tEXTGUjxJqUXi+44Y8eKnnEI\nt2Yi\r\n=+hbg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ada608c773d2657680fffa3be444debd83967f00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.94937c78c.0","@material/rtl":"11.0.0-canary.94937c78c.0","@material/base":"11.0.0-canary.94937c78c.0","@material/shape":"11.0.0-canary.94937c78c.0","@material/theme":"11.0.0-canary.94937c78c.0","@material/animation":"11.0.0-canary.94937c78c.0","@material/elevation":"11.0.0-canary.94937c78c.0","@material/typography":"11.0.0-canary.94937c78c.0","@material/feature-targeting":"11.0.0-canary.94937c78c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.94937c78c.0_1617310907113_0.8850400687455926","host":"s3://npm-registry-packages"}},"11.0.0-canary.e7202cb57.0":{"name":"@material/tooltip","version":"11.0.0-canary.e7202cb57.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.e7202cb57.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"60750090f347c00c3d728691ba393917eea58d0f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.e7202cb57.0.tgz","fileCount":38,"integrity":"sha512-RFkx+KVQ10XadXXYUVRn9Dr2qMqPu68pMRVJBLJUCraiYNh5iEkRhnkfo8CBXRMVfyr6jx4N9AWpMTyrSoTAwQ==","signatures":[{"sig":"MEUCIQDqgJsMhFshNwscbBualnlGVAxm8gpHJsK7vaXXlshW8QIgUrDYng8Lj63vy/tFgWN453dmmx9ZwQFY3oQX9Sokv3U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":656620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZk2oCRA9TVsSAnZWagAAaI0QAIXPuaSE6HflkpEVvtGc\nDXilNlgLKLHOyZq2qIuORenspF+pHx4T+JJt+QJjq8g44o5B3v5CZkd9kYdK\njBLUN9uxoCkxUIrXkGgsar2OJ2yL9+QXZyPu5Q7aa/KinolyCUrRc+u3pF5R\n7fIuTsPVuGw4P48rWSuALZFNkQA3q8CTGhxV5ug2UNK86VBT9g+Hn0H24DW8\nysPLv0BblvFqpU+tyKlRSe2U+pk+wd25kbTaPj06T3LagKTwNW54c19vvcaO\nKk+JnhSwfwU17EkIwyQ65LEvREup/kZDMkyfRkXJJ6D29BH8iSmKoc9cn9BN\nmduMyoz6CWxy74pEeZ1Y2rhjfXPcSNon44MaSatVBPwhugvCv98NpmfanXue\nB1fg7IXFTcXnmmrEGvUzgLKzK9+8pZJHogE/FCDLb5jNfrwxFkm4THyQZOpy\nMhLirctktOCFnnvvZwnAG6zcn4Dbc7TNxx1gw6HVZNtIWkahSWc1alWxyhiE\nWo9lvXGVjTw4tJGIoZ5pBcvNAqJTTFIwyDNP/GXaO78z23rHOd8WVg9bohc2\n9zHJbAyhQ7N4FFJVHOWpD0VsdeE+DtJEG+cuSMLjl1y8025lOhxxtSzfY0Gi\nQhziR02WPElblMCXDTB+dJvMAluAn84P7rUKZ+Ulh8CEiR+7qR25mmT2pOvH\n7rl5\r\n=ApyN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"113d79c2879cb1503ff12c8064eeb38ada16b472","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.e7202cb57.0","@material/rtl":"11.0.0-canary.e7202cb57.0","@material/base":"11.0.0-canary.e7202cb57.0","@material/shape":"11.0.0-canary.e7202cb57.0","@material/theme":"11.0.0-canary.e7202cb57.0","@material/animation":"11.0.0-canary.e7202cb57.0","@material/elevation":"11.0.0-canary.e7202cb57.0","@material/typography":"11.0.0-canary.e7202cb57.0","@material/feature-targeting":"11.0.0-canary.e7202cb57.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.e7202cb57.0_1617317288107_0.2956489366834485","host":"s3://npm-registry-packages"}},"11.0.0-canary.1f636b205.0":{"name":"@material/tooltip","version":"11.0.0-canary.1f636b205.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.1f636b205.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e84d5eb078f4fe394818559165b093d3351fe204","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.1f636b205.0.tgz","fileCount":38,"integrity":"sha512-HmEJuOy69aeV+JGXl+fFcoJEy1x1ui/rmhUenLbpjmyhMOXLQcsrFHx6VoLUrjF6avnduOV4b1Tfb3/GjCGCUw==","signatures":[{"sig":"MEUCIF/ppWpQIr7l5EOXsVuU+p7gKuxUZcahwvlRgwfem3paAiEA1PZmDCPVAJHRRR1dqwMVOhtJ9Z/LhRdvBqtfkTRtMMQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":656620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ5m9CRA9TVsSAnZWagAAP+sQAJgIGj28T1K6zyItNcaZ\noyFreo5Sv7FtvvwX8JEMBMlFrAKeJO+NSK57IpODuZV6LDE/XgpxL812aGlC\nKsZ6Zw7X/K+9gqpWgVadRVBB+3PUd3HMh0YeRBEv6mYN5be5c0UBTxaTtJ3j\nqDyV92ADC9PxPPOo94Y0FfT3N9QRr8i0CE0Aa3Lf5L4gIpA2r9Vw/8JCL9bg\nb1N44iVx/TeVxGY6D56bQNSe5ooy+ZGwxvwERe6BM09PKHf2obDSMk9qx+h6\nNU2ZtKWEJGJHAfduBTp3GM4+WwXCRd2ks1w0yQCzhVgCfdd+uWXqo3hZOtg6\ncMxIafqMWodxSAoHbEm2DWfyEVkGhcnqhdwEfnPAtdA3gQpggH1LwCpL2U3m\n6gkcV9mCddoUblYeHcQRAKnll7gk5OSTIhmh4Gg/W7heg0u2/QgZiHEBoYAa\noPqrrZWEpHCiWiVifw7+CLQx9wCRydbT9JwUN+k77s02fiSpfhiLlzGhfsbe\no4MzVeKP5idRpuPi5X7sdsR3nPQ3z+nFbS7c9xb+bE5KlG441vP/Q3la3ns/\nK+vpD2SfqxJpwm4UiqziScCpdjjWbWL96G4qANaAgodFZoxJyaG45m/gThtw\nIqoVMZt3urZB7QIhLMTpeMDTW+g7Th6q1Fza+O4qGMgDpmQqHlG/aAHRik30\nSS+S\r\n=WvC9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a523c6467be13e8aeead7e4e2e5f20c418871bb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.1f636b205.0","@material/rtl":"11.0.0-canary.1f636b205.0","@material/base":"11.0.0-canary.1f636b205.0","@material/shape":"11.0.0-canary.1f636b205.0","@material/theme":"11.0.0-canary.1f636b205.0","@material/animation":"11.0.0-canary.1f636b205.0","@material/elevation":"11.0.0-canary.1f636b205.0","@material/typography":"11.0.0-canary.1f636b205.0","@material/feature-targeting":"11.0.0-canary.1f636b205.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.1f636b205.0_1617402301400_0.7239558470471743","host":"s3://npm-registry-packages"}},"11.0.0-canary.94f50b260.0":{"name":"@material/tooltip","version":"11.0.0-canary.94f50b260.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.94f50b260.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bb7b5572e2ba9ff42f863b1fb9074945ad39a5f3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.94f50b260.0.tgz","fileCount":38,"integrity":"sha512-WD/IKMyumgftQB+0WZlmFeOUBNIh1a9xm858sA6oXw+nVYLErvMGG7Wf8EVVOHqJC5KAS2anXMvfdOZ8PfUSxg==","signatures":[{"sig":"MEQCIHdVQohaMQwY+w5k4ABNOBJ4LmecGSuiCuh8mF6/bl1WAiAOltVif4qAF4ITL2UVmsInQ5CfN6AFYTqLkcOXRZVpRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":656620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaydVCRA9TVsSAnZWagAAetwP/jxpL8KLcnE2ryOAXdrh\nUNy8hi0dFXvfrOObYpFH8dw6lYahEOALHgmUj2FQYgaD+o4GZToaS8jIW5PX\n4+iNG0iszqX1UYy2r99b1mF31KYJ7hTbdln5debvhzkzB/2Oh4UD7dD3G0+m\nZ89tyrzV9dWtyaAyEt7eBBJYaNbZSj3xR3r40hRHyaqMu+fRPIODnuGs5T2F\nWz6TRlqImKXCzq+ocCX2+8siRLNMtiHQhAgQKjyvVq3VyonumOOvKJNSK27d\nVbnJ7R74zClj7ZMO6n4gs6/SS9Uz/5Mw7r6A/xL7/kuSHWxJuIEEd9/OF+lh\n9YMAFTCBBQEEo9KzzfKGKMUqxLW5Ygd/WJvlg90ori5aaE+Lu76RGgkHHutu\nUwIBL0C+Q1SXeoE5kQPdrxhrdDTRg5W+jP3leA0mmc9vOlhjpaQGQX7gsHfc\noZD01hk3a5djIEHlaf+zS8OgEeBmbAehW0nRkRHlKnOOhdNmFkO1dCz0Traz\nkaOA3BxvrXrweJu7zeNRzbww6Ho61Ka4F1y1z3ccehS93RZy2UhPA4e+/1F5\nOz2zuUUl4a7XGIK73WWMj6C3KHLHhiD09AWlkdYY24b71faSt7cEwYblvhEE\nq8qLzXb34+gJApHgSM/3Kdv04qzXbcACgO1DdhDofyLsCgAIDy3oNfTtf7Gv\n1sc5\r\n=zlBF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b5f84c677cd669d6958748a69435b56ebb640bc6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.94f50b260.0","@material/rtl":"11.0.0-canary.94f50b260.0","@material/base":"11.0.0-canary.94f50b260.0","@material/shape":"11.0.0-canary.94f50b260.0","@material/theme":"11.0.0-canary.94f50b260.0","@material/animation":"11.0.0-canary.94f50b260.0","@material/elevation":"11.0.0-canary.94f50b260.0","@material/typography":"11.0.0-canary.94f50b260.0","@material/feature-targeting":"11.0.0-canary.94f50b260.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.94f50b260.0_1617635156599_0.035281123909393086","host":"s3://npm-registry-packages"}},"11.0.0-canary.a4009b80a.0":{"name":"@material/tooltip","version":"11.0.0-canary.a4009b80a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.a4009b80a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00cac0261bb4bc5c82b023440da9dea483251ffc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.a4009b80a.0.tgz","fileCount":38,"integrity":"sha512-zKOqqQGepX+B16gBskXF6LsqWnpXOwLRlyIfE17RyqQDvrgr5mVLg2BycNbJgvOnmywFSlz2oG7BAZP08KcH0g==","signatures":[{"sig":"MEQCIHgZploiJTLscmEhee5USEGSAOlPWryyc2GucMGQLiweAiBgu5sJUyYtePDyX/HUgNDwB+5PDYVjrwSOkJVV9CpNXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":656620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJga4iyCRA9TVsSAnZWagAAV9gP/3oUADjzUvjOQszmkd6v\n/GGMQbcF42iGreqjqfJpTJ2j8TGGsxqCwGRdzOoNj6L/7lq7PiG4iL+WOy85\nV4EjzhkAy39y70fNgreiw+bEIZvhb2fu5GYnAPY+IDOh3GO+54L2dSBEBLu1\nVy+j4wU6wWGk5CNEeE+uLhfeS+fn947SUMQmYavaN9chTky7bS4VOpYrA7qw\nqurEO0gNNYm2vIKYhwLbzgX/m694laI8S3CNVjbYleRJB6pC5Qeak0THhodh\n9nNTDCVBbmVxmLALsAWZhez9/VO5PTMO6JkceoF1tQDXEplf300kQYcjp9Cv\n12WQecOf13cjyt8aIHXOhylStYn2ahkGnh+UBP6rOKgevfnHfONeNfqq9sY2\nPIWE8m1RzydKbHtFw2UxSRCEUIfELB9Z3lfE29h6L6uapA0IhjpTGhModHCk\n8qMWgFWSZey6mbqlEIYYigme4U+q/k4ZJrtMouXWT6u7h+G5vriaqWPJD0DB\n9wc5gspIqzOGe4Uxv5o7u1lTN35D22Q2UvWOEePC3wlCMSf0I/XxB6TfZmJs\nkZHRk/TFjAUOe5Z5wHFDmMrVBd8cZEORGWWvKQC5eVN46f182atfKT+6rflG\ncdXa2QKqixE5I+8lnEspPiAL+Agosv9G8OY5FvzCAuUWIA1Tu9onlo9qm9PS\nGlxy\r\n=j6sv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"35eef76af32a43b61b6a0fb725dbb83cfa5d3421","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.a4009b80a.0","@material/rtl":"11.0.0-canary.a4009b80a.0","@material/base":"11.0.0-canary.a4009b80a.0","@material/shape":"11.0.0-canary.a4009b80a.0","@material/theme":"11.0.0-canary.a4009b80a.0","@material/animation":"11.0.0-canary.a4009b80a.0","@material/elevation":"11.0.0-canary.a4009b80a.0","@material/typography":"11.0.0-canary.a4009b80a.0","@material/feature-targeting":"11.0.0-canary.a4009b80a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.a4009b80a.0_1617660081799_0.8691568914369281","host":"s3://npm-registry-packages"}},"11.0.0-canary.15604bd0d.0":{"name":"@material/tooltip","version":"11.0.0-canary.15604bd0d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.15604bd0d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aeecd87ebe4310b0b3da6158e9c9f8c2efd0cea4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.15604bd0d.0.tgz","fileCount":38,"integrity":"sha512-zLWPSgSFIINyO5WOlfQXWXAMtqWC1AP1HSK+LL3ZerlBtVGfv/jZFZwd1Fazxo/O5UK4MNzBs5qABxCPWZEpig==","signatures":[{"sig":"MEUCIQCIIrYo9cNgP6c21aBioY5+cEEZ4yu/g9DQJAZEchiafAIgM6C70P9tynOkpP/on8dCbT32vOfGe2z62nNZQti8gDQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":657427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJga5J1CRA9TVsSAnZWagAA6m0P/2dYlSBl5wSIHRsa9zz4\nhsihqq2pQBHYA43fEoAxfWQ6GU9PF5x3S1KaLtXxBHPtpVAEah3LZBgYrg4T\n4VcdkAcTE/KEzunUi+zfjhy5gLsN8CKf4eUMdtd2dYQcMVmfKEeeGcOU39TP\nHN6b37V2kM8p8mnthLz1U+y/AcxSOYmIDadKpRCr8a9JiNgokG4m3cjQFg/K\nNiFVssPdDdPPzqtwvu1pqefFn3nPT306b++NyBB4XXISmVITN9XJziEf12GZ\nkKD63iVleRhO1e/S0hQNiPj9pPScAIOz4z7IH64oOdEJALqXsJlcKh2FuE/C\nrzzbBmGbdHq88dyjyql0Zerj6yzaSWJNWWxEiG0zXuKu1Tqpz/DmlHZ0y1aV\n0vnEQwkc0AwZRh7Qi4/33CdQ5WcSa4Inl0qrvd/0+RYMXJ9JIvkNKfsqXbct\nH1VYbuq2x0eyddsfwIB4uJ7/7FZr7hkX8v/qQ3fVrOoHSaj8nDzDqgX7uTK4\nd7yOOR+7bOTCrknFqCgt1dAtS9nk8c2Me/AMG8CMdN1L/C5Bfq49Wk3uSsG5\nr1eR+ygl4OADuZl/c0Gh/0oPadRctcr/uVXm6maSu54JIYMh2kgiSf4mjuJ3\nQnl2tjxFD5mqge9CkXF1pTZwe4uYredbGa9/hMjp+rNjRlmIgiX+h2A4o9/R\n1ujx\r\n=bO2P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ea3949c02ab8da1a812a2127f1fbc7e7a3c98532","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.15604bd0d.0","@material/rtl":"11.0.0-canary.15604bd0d.0","@material/base":"11.0.0-canary.15604bd0d.0","@material/shape":"11.0.0-canary.15604bd0d.0","@material/theme":"11.0.0-canary.15604bd0d.0","@material/animation":"11.0.0-canary.15604bd0d.0","@material/elevation":"11.0.0-canary.15604bd0d.0","@material/typography":"11.0.0-canary.15604bd0d.0","@material/feature-targeting":"11.0.0-canary.15604bd0d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.15604bd0d.0_1617662580785_0.6412412186367422","host":"s3://npm-registry-packages"}},"11.0.0-canary.76da7876c.0":{"name":"@material/tooltip","version":"11.0.0-canary.76da7876c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.76da7876c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2294ed477fa3c8e247fe3bc2a80485163b1ddb37","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.76da7876c.0.tgz","fileCount":38,"integrity":"sha512-lEZjoHY0MX9UwZ5T5cUFeR/2beCxKpwGP2PKuzp3RDnubJOkoN5EN2NRK06UijTaWVbWc18RPRJzRrMwR2wFaw==","signatures":[{"sig":"MEUCIQDgjHcPJIs8+7/vjRz7tNApVBJsZY2zdd1RuAWKE19D1AIgJawbcYDJtTB7MP+1/45laW8WOh2wKurP+WlTRbKtZYI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbQ7BCRA9TVsSAnZWagAAmU4QAIVJQauAHhBBzlC7z8y5\n9jyrgjzFtGT4walJSSTvOUUGjB3xF5NZtE/oT+xWIbXsNWVeRtKYJTmzfVoP\nLfbcUwzm3czRoFeXjnTNoNO/vuBMWrpf3rAd4e0wi+plJINtXRbWf3GZ7wo3\n8rjOZMs20AqEkqTLaag0uIMTtzViJp9fnZ2ED6HTOQdOnTlhS+bhUsRDFd5C\nYIZWBv/bFhcqFZ/TnNkzTwV3ahmHYbEALXLvOgZPEQEkQNI/joGWWMV55hud\nC2fo8NG+2o8SMCxjYQ5gbikrxUQrimm3RPRbFjunlRLgmjpsbJya2rVhtKn0\nqP1UBpzlrDDq8rvZ2ehOnE0jL3RB+im2pwkQpI7J/hcU+7fNWo6fsRMYMSGY\nMkyE38200mRBc86jIshwIvn2dXtY8rFGl6TB8G4L0CzyIXNDa7ucxgw+ohao\nf2aZTvmTR06aipz9acDoLuWnd/sksiwNGBAaMfwgaFq6YDU/7InsBj2E3UP3\nrX2SvLLj7jnmfHXBvxM+G93GZUTap5c6xqbvjBQEsR3X6xHcHv0kJMAkWJGV\nVaag5WZ4baZ9CtVVZy+0xyPlh2fNi2A1kvo969fgM8Sfvu0REGxoFHSMpP1o\nku2iGuTu2neNRDgbgDSeV/XYlmVkjG5aCZdGRhtNg7C8Bjkk3Rz3jG+LcFp2\nu+9r\r\n=1TU0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4bace63831a45c0c9e6f786768b2aad0d79087f1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.76da7876c.0","@material/rtl":"11.0.0-canary.76da7876c.0","@material/base":"11.0.0-canary.76da7876c.0","@material/shape":"11.0.0-canary.76da7876c.0","@material/theme":"11.0.0-canary.76da7876c.0","@material/animation":"11.0.0-canary.76da7876c.0","@material/elevation":"11.0.0-canary.76da7876c.0","@material/typography":"11.0.0-canary.76da7876c.0","@material/feature-targeting":"11.0.0-canary.76da7876c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.76da7876c.0_1617759936502_0.3274590719820034","host":"s3://npm-registry-packages"}},"11.0.0-canary.6bcb6cbd2.0":{"name":"@material/tooltip","version":"11.0.0-canary.6bcb6cbd2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.6bcb6cbd2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0f7d1e02a246eae68561f3e6cd6d296fae3424ca","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.6bcb6cbd2.0.tgz","fileCount":38,"integrity":"sha512-gssh4UJpXgvtpNpmBqIil5wNfZ54nCT2S0OpDYLgR9uFCdDnRz23uf7qTE3rrK1o3WIIAND0Hva/hblbcdTWVw==","signatures":[{"sig":"MEUCIEATVBhOP1rlVWZavHBb9VMrglL0NAcogusZRbjP5k+0AiEArnURiOrWPQdtIWuYSu1zFPntItfBaJyfGHidGPMYAvs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbf/2CRA9TVsSAnZWagAA/UYQAI+Yp3REilpYy6rpaSdn\nRpPPnVWciWkCxBbOy80dqazkRuHw1PXowBBehJdZXq27d5lSyLkIvhySDZMK\nfJKCXIw9qopNQy6LJHc8VvoUXl+vUWcuo9Ue5rdN3ReWVJz42KDIR1wwOtGc\nJ64W2G/p222/1biEDomFeyMFmKsDIAXQzJ7mUJJW2hQTjF1W4t5LSIEb91Ub\njWmIDJNdy6W7sux1VxLuFE7VUuYVEvChgtySDtoWlpXxfNTRLs27oRU14lpT\n2XORuhKWaAa+m3QBhXL1dWyUyYRE1725MZQhRnS4Omz4GH0dm5JbTcIX4OUV\nRtJVhG/VHHEkdm7kRWUYuZt3976od34MG1XVLQGO1drOqaWLD3gNifqK5E1Q\nToex4qUgMVL1FP16AvDkkiIx2l2s9FEm+QAeR/ckZ5NUFfgARco6CFuymzRH\nIKrkuO1fWQRluRjVHmjSkf/ck34+CTW5CeHF7UgSA0FinIQuoJ9jzG7EolKc\nrGC/rY1HxzUvpP+uye57ewEaFMAAVIUfZhY84IQqBFFqV8UpeONWr0S8i6Wj\ncCY5i4vruw2ZO92zfFgloiYplBxBmWpA/nE2v6/GfQti1NcZJftJJHYqCjGP\n5cYPaZUIBTEYpCt4nqfsLcm9QGR4YSfRzpOEamaqIDorPMlMQtBXkrjSETH2\nvAte\r\n=X8tK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f3ec57093899a7f082bd51cae05b398c31619392","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.6bcb6cbd2.0","@material/rtl":"11.0.0-canary.6bcb6cbd2.0","@material/base":"11.0.0-canary.6bcb6cbd2.0","@material/shape":"11.0.0-canary.6bcb6cbd2.0","@material/theme":"11.0.0-canary.6bcb6cbd2.0","@material/animation":"11.0.0-canary.6bcb6cbd2.0","@material/elevation":"11.0.0-canary.6bcb6cbd2.0","@material/typography":"11.0.0-canary.6bcb6cbd2.0","@material/feature-targeting":"11.0.0-canary.6bcb6cbd2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.6bcb6cbd2.0_1617821685619_0.4475790473907313","host":"s3://npm-registry-packages"}},"11.0.0-canary.c91e8d141.0":{"name":"@material/tooltip","version":"11.0.0-canary.c91e8d141.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.c91e8d141.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c18292970b85314a0c63bf6560efb3153699e20","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.c91e8d141.0.tgz","fileCount":38,"integrity":"sha512-n4MV+pT/Qg/gF3uIk2Epkpx0e4nglijipal4mq9JCNEUs8cGGL/vEideYZu0L8O+FGuzwdTV1NVyG1KVLeIijg==","signatures":[{"sig":"MEYCIQCVr9vfeS81yJiv0Ms/u8N/fzVpLziKi2EwlNbmWojf9AIhAMhU6WVVk3xRD9CQ+SA0nKiSipCRO6Z61Nr6Z770Yekq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbgDkCRA9TVsSAnZWagAA9+0P/jzeVGMcDuIYLu0wAKzK\ngIMk972HbWTgiYjqIVT65edK/VXmATgDYJwQ5l92xjyMrKXOrHnTrxoQi3/L\nBgDIAXM9gkqTwAgim2/YINn9uiwcixoLYlqyCgBJ+scVlwt4NowWmVeiTiyP\nSSJ/G51oB+zFMgCD8PDMlYLZ13ZC8juhxYJ/wykyfYs3dX2K8ewG/GqCExi4\ny1G01EnTH+NnqjJXh7ryA7dYdb1mGRY9zZZZZ2IQ77eiuWtHakAStdMQuzKG\nBg8YB79FQ63eF+vq2z+/kv9Y1Z3jb6TlhuIwjrxSc8shU9k3KWWXtVXscPlp\nv4yBGYF5THY3pnN99WsFFK8eUU/wwbB3LrSDRm6z8Sm58meNczL5eUfRwmrb\naisvlhdqBlTl2odEz9w3jvQdwPJ883+BozFxAIpesFVkcVbUTaW2Ugy0Do2B\npnPWKCsogKxRcqQuc/5tL6iYDFrDreHj2WJ7Pv5WznJW5NMrYa9LzOaqWYhp\nLGKHnRsz0hSM86qwxeRrP+Eq8oZ/fR4vEj5Fklw7APUjXqcHdXBrmeAvMvbN\nNCUJK342QZBAwF3inMvUtmkJNWNlgtmV9yv7ATzyp2wS4ArUqXGdoSFOrGwA\niibGxN+BE1zUH+2s70k+Sm2wfv8TJeujdRo9PrAMdCz9pmx8hhjoFlzc4b/u\nZDD8\r\n=sESB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b13009a2b12843e6eefaa0c3ae66fc519af7bb29","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.c91e8d141.0","@material/rtl":"11.0.0-canary.c91e8d141.0","@material/base":"11.0.0-canary.c91e8d141.0","@material/shape":"11.0.0-canary.c91e8d141.0","@material/theme":"11.0.0-canary.c91e8d141.0","@material/animation":"11.0.0-canary.c91e8d141.0","@material/elevation":"11.0.0-canary.c91e8d141.0","@material/typography":"11.0.0-canary.c91e8d141.0","@material/feature-targeting":"11.0.0-canary.c91e8d141.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.c91e8d141.0_1617821924089_0.9188989713604006","host":"s3://npm-registry-packages"}},"11.0.0-canary.f77c50860.0":{"name":"@material/tooltip","version":"11.0.0-canary.f77c50860.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f77c50860.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3991fad9ce71b692c66b8c8eba91494a2ee251f2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f77c50860.0.tgz","fileCount":38,"integrity":"sha512-NXrd06BaZg8C9dujWf6/y3Yq1Kyx6Xfv6dOI3JERsH0U3YlCR3F9SIiIyfePPQEYuo8Us1StT+z1yBKdYwkLpA==","signatures":[{"sig":"MEUCIHLsxDq11eRs5PDU9+wWLKhNxcNUXWigA9P/8mkf+k7fAiEAiBlHfsEv1E7R9gwQVnx/Tv8vjSysVwd0JAVf8JGBlxk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbyMKCRA9TVsSAnZWagAAu6IQAIE289Ste98SVI7VIZC/\n+VW9Ak3bJbKN1lACvN2YoS6cscgpYdXNEVY9NfrLwWk/4QUf/Aq1fp7Ojn6z\n+fu/AZZ/QUljZH4cWj9cCzAw1jVF4DNPyIzEsT4FpjcKQTNgsW5F+VeMnzXY\nHIyfI1iAjdABFIEMfDWCwNwcHFVxB3k043zVT4IGkD5H4TpObyzikF/aEl2c\n9LYca08uNTZcntQy00TQzmZrh3DGw95xMVSfti/2YF8D9kMvkvJfuYbUIaln\nNnfOPSTG28Vhc5qFTcGu7QU3KKYUf/R1SZkVDLYfTVVAjU2hkON9qYBj4Fx5\nItnafRk3UGwWXiiqXbtP/TF2LAdqReVVeflv9eLZ2n9HBwakJJ3xz3exyqDe\n5HgqrJNAZEY8S5/4vMgsquD1hUHgMDUGDTkVkVeW48WzN6aSfi5nQidFGd+v\nSWpSIEFS2WGizmMfLbyfvDTSXnDOny8g9PXiF3RVadAqDk+UvVNZHbcWYJaR\nz9xtZ6ILxWKj5TsjLTbZSxG5cNUzTSO2zgVE5b60f1tku1J9wGer7kCQGy4j\nBMDDghRFX/B8XEyTDNPlOuiqprVirfoN7jKFwqefjhDy6PSKMMKz/zHDpVU/\nJZujSoLKXzJO1X9voXfsN//8pkwLjw8HZ4ptfLY/9W5WgamewSG56hGckn1p\nQ4gr\r\n=OME8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d35db9665d4a8a4f385b134c9c1a23bda8668fa2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f77c50860.0","@material/rtl":"11.0.0-canary.f77c50860.0","@material/base":"11.0.0-canary.f77c50860.0","@material/shape":"11.0.0-canary.f77c50860.0","@material/theme":"11.0.0-canary.f77c50860.0","@material/animation":"11.0.0-canary.f77c50860.0","@material/elevation":"11.0.0-canary.f77c50860.0","@material/typography":"11.0.0-canary.f77c50860.0","@material/feature-targeting":"11.0.0-canary.f77c50860.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f77c50860.0_1617896201609_0.6511458935050778","host":"s3://npm-registry-packages"}},"11.0.0-canary.367d88bdb.0":{"name":"@material/tooltip","version":"11.0.0-canary.367d88bdb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.367d88bdb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d9e8a6c7c20073ad33840c5caf9e8c5362021f39","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.367d88bdb.0.tgz","fileCount":38,"integrity":"sha512-Etw7Qh9ZHoSF28WDJ+y1onNfYKNlNfTbZsnC2v1jNg4dqO5eqy2Wj8H831st4Cxrq2uJmCK0bYNMY4wrNdP6ZQ==","signatures":[{"sig":"MEYCIQDT9IIrgFojNE5oT03qf+EWWTRN9DMq2VZDFTyPI5YtiQIhAPqwF10ValM0dXeuavvJtNzFZjxTI3xP3QxRbCPJQ01n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbzHFCRA9TVsSAnZWagAAgTIP/32yRsGB9JfUS9JhUkda\nTrEdEATnDNHp9vQC22iMCDDZ1C+Sni6DS0dWGN/D3UQrrmDyukNBglCuSztC\ns6/7H95JSiNcwdoryfEx4/Kse9kEjBXPbEGS60LQQ1Dk5b6B/QaUy+Mr1kRP\njM70Mn44xhNvtviG2gId+AGszh/D2KoPOO+lECNw7Fnwho8eyrQHjy91lAgJ\n108vdL9iKi1Yf5Ei2CV+7F0uHTVZNwNxY5bNy1VcNL17DBRhrKmrcTVds6Xj\nsL86euRc/bZR2DGYyIEpk2DXNslqYbXqrVGY49qcfRnhkh19yKPFujqAYSRY\nrXZFGcvodaV8smcL7ewJWm1zcXOTN7fARvK/Jh8D3ZIvw6flDZn25wo3G8+X\nkyTgaJoEckvCNuqt7qqF0yWzCjiaHBmHXoKLGYE+rwtDDBk28U5TdXLL9WPn\nr1MCxia91d/+0f2BXdUfSLzHQcBm0kPwPiRuTMstkdwvZfs58WMCKTH916vU\ndiXDaqZF4fCxTUtyx580qeiZ48/3L5WueROZmpNk5Tbf84wdq1d9VqCC51Bb\n+11qqYr4jIi0z6qS5qpOdzEezytSuiHllvXKAuIvZ/1P+XDpP2CYyFl/sxyz\n14a+NE7r34lABgJC1KUiCnrlJRyYOGcv+FdunbaxxGrWX95Cf8hcWCA3PrUu\nME95\r\n=pCX4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ba9cee87fe351c7e76ccb32f2572bf3ca91e88d7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.367d88bdb.0","@material/rtl":"11.0.0-canary.367d88bdb.0","@material/base":"11.0.0-canary.367d88bdb.0","@material/shape":"11.0.0-canary.367d88bdb.0","@material/theme":"11.0.0-canary.367d88bdb.0","@material/animation":"11.0.0-canary.367d88bdb.0","@material/elevation":"11.0.0-canary.367d88bdb.0","@material/typography":"11.0.0-canary.367d88bdb.0","@material/feature-targeting":"11.0.0-canary.367d88bdb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.367d88bdb.0_1617899972952_0.17977840341813023","host":"s3://npm-registry-packages"}},"11.0.0-canary.0ec437d3b.0":{"name":"@material/tooltip","version":"11.0.0-canary.0ec437d3b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.0ec437d3b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e46d636f85c3ea67f81e8e995d2f27adb4552f39","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.0ec437d3b.0.tgz","fileCount":38,"integrity":"sha512-/YOs0AT+lGDDvgd8PP381WfD1gPWTP4auqwQzPrFuTW4BsjPID1pstnoLr063immrUrInhcr9jfWj33B5nI5qw==","signatures":[{"sig":"MEUCIQCc9SaDFqj/DcBgJQli7FMzhqxDQhhvfWkxnrCfIAlKMQIgSW/HJNYI1GCRmNb9zObd2mvFitHTY+sw7ElR67RGMDE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgb1stCRA9TVsSAnZWagAAv24QAJVIscHN84Sm8HzIgS0F\nejC1UKXZYSku/h8TSv2e54fSiKI6CyXtL0bj3vGHaqEMQ6lHbotwIWDZmanr\nHuWwS2bVHFPtvJ7w9KTgDcRIJSTur2OgspEPLcd/TBgzw+tvAs192VoqUeTT\nZw2Pvir+8LTSsEeGHGnZgG5lD7M/iBxm77Vw2K7nQ1NVCd7Tq8s076mkkkf6\nrQkQa+7mCYSwULzYCZw1HITJ/19C8CYWOsVRu23iAPVuqqoRE1KcrGBTLCK2\n97vmpFA1t35pK+XmkTXo8F+iQbVpyzuABM8XgG9MToJDkl55OmZkcNh8XC/R\nQzqjZzB1LIPeonBP6NXv63qVX5lQTpAom4QuoWVQiAk99hV5zNhsYkNa+pY9\n09YNy9+eDP5V5fsQBGewG/hYadyJUm9RjW8HfeFw8VU5dVFaqXsX3zsfJWN5\nLS3r+DJc4caTlhwLHHVe/cjgtkDFafINsrIgcAJoZ9qs0MaMOzPFnAv/MFgp\n8CSpwZxYtGt1VsaDayLQ8uLtszVU1yWF6OH2Bn6pnIeaFv5AbXd1gCv2ITzQ\nLwC42KJdk6Eu0U6gW/Vy9GKZ+WuOVSYT1aKw3siMBBq9S/iM3A8Z4hgoVKNq\njGdg5YlSyV4kOJS+D7TtcH1WGVa/uZF2TVnITEOKf+ZSn/dDsTuxvfYWpJda\n971U\r\n=/0Gh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"50ed2429a570432fef9747a954d7c31d2dd11f0a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.0ec437d3b.0","@material/rtl":"11.0.0-canary.0ec437d3b.0","@material/base":"11.0.0-canary.0ec437d3b.0","@material/shape":"11.0.0-canary.0ec437d3b.0","@material/theme":"11.0.0-canary.0ec437d3b.0","@material/animation":"11.0.0-canary.0ec437d3b.0","@material/elevation":"11.0.0-canary.0ec437d3b.0","@material/typography":"11.0.0-canary.0ec437d3b.0","@material/feature-targeting":"11.0.0-canary.0ec437d3b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.0ec437d3b.0_1617910573077_0.36414400118702117","host":"s3://npm-registry-packages"}},"11.0.0-canary.b2fa996a1.0":{"name":"@material/tooltip","version":"11.0.0-canary.b2fa996a1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.b2fa996a1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ab44861ede86333875364bc4ce63324786af03c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.b2fa996a1.0.tgz","fileCount":38,"integrity":"sha512-reK788rAx5uAtfpPQpiUKb+apNdaavP0tBg6mRHVvQ2FTWc+5Q4WuikqHFFWKT0TNwB9VjIEIpiT5KEW0x5eRw==","signatures":[{"sig":"MEUCIAQWEbf+LdegB3MJNQXM0gCXr272rIMsaYtVypUE/gipAiEA0t7urcC/Aw/PAy5h9pB6H2ZmMnyB3slKF5aECtDtOAU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcG6/CRA9TVsSAnZWagAAjosQAJ0IDSJQBKit59h+vSpe\nxjGKaXn+qxjtg5+NSLSBwvtwjpQuYs30UHBKp5WBSHzFwTOVxCRJSrHKrf7K\nS4qPd1ByORmMeH00GDRnRKWvXYFMBVXLARRpJGig1lzVULqKhKE4ayPjB4mH\nc+ygnvdeqRg7jYAP+Oef9u/CngKSR0Nn6gOlk/D+E1DV0qNKvwBbY4LSbFqd\nAjfhO7kWCFsGFFVtdvoR+uQJv5xsof6Om/ZLNynd3zAC9WRGMN2MOqbqThBV\nkz/UEoiWIu2L7hXC8peI+TUbXR97bXk6+sFfdHtOj9Rer8mPlg4sc+DQdC4E\nhDcXpK8gvzJmw3qXKf+o15jyOHoc7UE/WGfLWcoSI5khg1iUsIoV+OX1TlOL\nvmTZUXteRYbXelANOkShhFvEqin6ayRNGkzU0bwBBSmdJ3Bkr1RzsS//lV1W\n6jiX90ki6aKB3JSaaBib8gDSEjPiVzpWemXh3iTJ43fFlNLyQBoAL2QH+7Sz\nVgJRZlD/C/TBrF0qiLzvWRmF4Lc9kFDJcJz+Szc07vB7Zz+vFNLA1RCsJJqD\nNLG/ctWevVSSTEBUml+0R6cbqoPDiQR4lZkBuRhbu0V7FQEeQZn7/8sAJnte\nsq1G7sOxIRBNgi/2VgdHeEZDssYqoeakDMwJyHf69PoaYia3zf/SQV5BvjP3\nCcsy\r\n=yo/O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0b4eb5b2d30d6d9a7b20f57164a2beba3c20d65e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.b2fa996a1.0","@material/rtl":"11.0.0-canary.b2fa996a1.0","@material/base":"11.0.0-canary.b2fa996a1.0","@material/shape":"11.0.0-canary.b2fa996a1.0","@material/theme":"11.0.0-canary.b2fa996a1.0","@material/animation":"11.0.0-canary.b2fa996a1.0","@material/elevation":"11.0.0-canary.b2fa996a1.0","@material/typography":"11.0.0-canary.b2fa996a1.0","@material/feature-targeting":"11.0.0-canary.b2fa996a1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.b2fa996a1.0_1617981118083_0.05965916813651084","host":"s3://npm-registry-packages"}},"11.0.0-canary.24255c408.0":{"name":"@material/tooltip","version":"11.0.0-canary.24255c408.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.24255c408.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0dcdbf9378f9f2421556c4a3bd70f1ed0b79ffc3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.24255c408.0.tgz","fileCount":38,"integrity":"sha512-iXPoRP2Qf5bqJkmATCr8/E/PL3HKA4vJgt90+ap6BNpO03ZyoKsOVntriA6eXuHjFfDWgWQkNm0m05aj9/dpKg==","signatures":[{"sig":"MEUCIAizjPUgoZ76wjydOH+AAGkIoMQ79/B1ni2iZNmPv0jkAiEApTbcQCX3e6vhrC0teet6e6qh3hdIPOX6JgaQFbJDLI4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcLVeCRA9TVsSAnZWagAAHOcP/RzrlVvyIhrItO0/VvP5\ny4G8EsJHDEc0eigufE25W/2rQ/PBfL0Z+m4vrPOlnA6uNEwP83IViW0AsDuA\nEuIvDmV6SMUPjXm/no8GztL7hYGcyGpoOx2lKhMwGbR5yJWO+Flu7LI7UNKL\ndoyyjlNt2R7B6EpUlNc6hZbsYDmQ08vKoLQSkHtA9JmJY8rMHPqAGeHrHvAk\nBIBE0CR80HRdS9NPsEUdJ7vONmWeb6chcjFf2/poMdZZiL8ws3vHy0kF6Dtl\n5k55cnxfRJxrhfrW7P8JOiTzFVEN/sF4HbahvmbN8n9cMFhcjPpeLni4HmnX\nJE4kSlPCMjXr24dHTdYsGLHopcw5ChMabcOmBS/UMmiU0x72M6lLLqiC8aqL\nPvkBzBZ9Vo8mu1xU2ADDEpvNyllMt9U4ABweE4K+Yh3EhfBIReAJNCn0msXW\nPzJl218AHJFv73tsRsWfhhtvuPoddwQQpLEuq2DqAVYem0/D0V7wVM2reRYd\nGkF6BefY0QZeVsMQbZDcvISXCMh+p5+Qr/eCX6iae7o1x/T5Y9rcpuyQkloG\nS2GFXLP0BN4H1xCJHpsGbHiAuwylQAMGSVFCdCFh8AVVNwFGaOilDcEnNsmC\nhGh6yF2uKgrjpqYpIAE+yrKG2hTmJEoaQztI2I2u5ktBbsbKhXIuL86z+idT\n15d/\r\n=pyTC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5cc224c5482fd736af03872db458f031901bb693","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.24255c408.0","@material/rtl":"11.0.0-canary.24255c408.0","@material/base":"11.0.0-canary.24255c408.0","@material/shape":"11.0.0-canary.24255c408.0","@material/theme":"11.0.0-canary.24255c408.0","@material/animation":"11.0.0-canary.24255c408.0","@material/elevation":"11.0.0-canary.24255c408.0","@material/typography":"11.0.0-canary.24255c408.0","@material/feature-targeting":"11.0.0-canary.24255c408.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.24255c408.0_1617999197535_0.009207969975702168","host":"s3://npm-registry-packages"}},"11.0.0-canary.7d6a4bb72.0":{"name":"@material/tooltip","version":"11.0.0-canary.7d6a4bb72.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.7d6a4bb72.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b776b0228e8a1a396a92c90fed7eb07e5e949853","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.7d6a4bb72.0.tgz","fileCount":38,"integrity":"sha512-iyOk66K+32sOSpF/8Se55rqWuRVQXsFy/dIP15YpYX7wk7z8j24TNcjf5wXLM1/A7BGddrskMX0k7OwOa/d31w==","signatures":[{"sig":"MEYCIQDRGXMtkzea6IrQuh1kYKfUP5TEas1e++aTU1uQI692iQIhAIkjd2jlBLT/QF2a+IMpeezsMWAN4ZWp9UB/2HQyQ6v3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcNsgCRA9TVsSAnZWagAA5f0P/A1/MZp+sjQi5KCZiys1\n/cWrjwO/s+3UabyqcOKHIbBf5qRAxKwB3ZT1QDNFOWLXw+e7vFMULo7OOSvH\nqacDz7Xgn65L4Q0CToNDn3f3jrJiMjqpK8V4cBTDDfQb97DvhbiqWa57mOpd\n97wGMYR+VRJ/IP6nXmI8LKbYZufN0j1McgvUOwEJjio+TmIPaNnZVet16eSm\ncY6LGDjLAy40xfAM+oPAf9XouczyF+qzKJ8WyQpKcX1WxLS0ABx733hOwKFO\nBQZL4YfOR3iBqm1oOtxO43bWHY7FoIyBbpJr1J3OdrVjU1MyGxyqUBZn1OsY\n0ylGDla/jZqWQI0z5qlWmOMRi/+P7KBjw94RTzmuvtGpZmor4OdY3FMki6Ud\ncZZP3Syvg1EdBxVYiZNrXXwz46rYBE+uc9CMLNxabPSrqIr6VtjYN+FoEVoG\najCmGoStKhiPTrJFcqEMBOgl/6e/X0X3fGXaM7HAyKnLwnWFxBGMUWHQzRfy\nBj5DzedFXR+A7ZyxHeRFd47W1Msg9/jsMFekCWjyapBN+8T0uHI9jwpzIQQh\niQLlzPOPjcL/DLn3319t2foY9sp6DSjnlhbIiv6pKFs4JcBnEGdBjl93Fg3x\n064ct0AqrH72B/3p0GzJ0Uz7RHCBBUJxb2C6jNaLSMlFlROL+OViCo7zFkFg\n74RG\r\n=VrBm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1e1f0ea898fe101863062b7a760600cfb1b095e5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.7d6a4bb72.0","@material/rtl":"11.0.0-canary.7d6a4bb72.0","@material/base":"11.0.0-canary.7d6a4bb72.0","@material/shape":"11.0.0-canary.7d6a4bb72.0","@material/theme":"11.0.0-canary.7d6a4bb72.0","@material/animation":"11.0.0-canary.7d6a4bb72.0","@material/elevation":"11.0.0-canary.7d6a4bb72.0","@material/typography":"11.0.0-canary.7d6a4bb72.0","@material/feature-targeting":"11.0.0-canary.7d6a4bb72.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.7d6a4bb72.0_1618008864095_0.2493262343445617","host":"s3://npm-registry-packages"}},"11.0.0-canary.352b295c1.0":{"name":"@material/tooltip","version":"11.0.0-canary.352b295c1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.352b295c1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de22f3a006c628cd9dc6ad545a1f6b59d25b5238","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.352b295c1.0.tgz","fileCount":38,"integrity":"sha512-+9Vl3STO/yhZ7tVo/EIVinNbiga3IIgqK+wf4JFQRWfT2DVxiJ3lyL8mnLb0wAXg5FRUJdZcUSg4zFpEQ8gb/g==","signatures":[{"sig":"MEQCIDS8WRGwsu+BzhLBd6EVOQs81BuixLf9mv7kw2Q8utrvAiAglONpFBy3CUB0y9kUcpNtJ+322YBlXgu2ZqA3cd2LCQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdI5+CRA9TVsSAnZWagAAzf0QAI5Zh34Kp+oPLSq/Z66J\nNgsEUS9w0krqfhDI/OIzscKvz4MYTJAVgRlE6EdOARCfeS0oqCPAINR+Ow5y\nJffzcThAwisKZ3mOxWHPHYGXnR25gj6IcSOjyAVgZODIGX5lXa4BeNvgTJ2X\n+AGxODI+z245EiN3y03YWeKPO2gJYxEQ9IsSmid3jOJxOo6gkVa1u6PkW7vy\nVH8zX3P6ffb/GBCAYGCZC57hWwjBHTy7YKY4X1Lksg31VEb4n1ZNYPXBdQ9q\ne5NeZOtH5M4PVr5SyhW7VllrodEuV4fXyNrglwQM3Crprald+NfadAolGiz9\nbiMN1rxtRvGvJHGFEJAAZ2l6MhFIkSL42Id2S5glHFu82/t8cMFpOF5rKoeG\na1XhG1nj90qpyZceKxf0dbqY/vpXU88g3I5/DtINJ0FPQEBNi2dIz02mWqJJ\nfB7P1UgB3OAP1u0Ml9OJvXK986tRijCF+Eyfo3S0f/Szu9ukUdAmI63XqMHo\nBBWbYaQmh/+ixYybJByh74MyfydI3B7PdNwmNJ5o7ohx34Q61AWTngjF0z7p\ncPkJJz1k7hw2hFxU86ewHfiEvaf1DpsWLOIQr8lbHxjySU/fce5Oan/Uuhah\nTbU/oiFtFy8ER+RLyqfOn/MvF39Di93QncbUSH1QBtFS8BcLzrUnB5EGFLRu\nGiL0\r\n=3+52\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"472a00ecb08e85ff1b602e3bec15d38f2a028f69","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.352b295c1.0","@material/rtl":"11.0.0-canary.352b295c1.0","@material/base":"11.0.0-canary.352b295c1.0","@material/shape":"11.0.0-canary.352b295c1.0","@material/theme":"11.0.0-canary.352b295c1.0","@material/animation":"11.0.0-canary.352b295c1.0","@material/elevation":"11.0.0-canary.352b295c1.0","@material/typography":"11.0.0-canary.352b295c1.0","@material/feature-targeting":"11.0.0-canary.352b295c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.352b295c1.0_1618251390193_0.1834888584522456","host":"s3://npm-registry-packages"}},"11.0.0-canary.ab99b8064.0":{"name":"@material/tooltip","version":"11.0.0-canary.ab99b8064.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.ab99b8064.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f5f27c0f81007cbed1ce6ff7d88ce49dd9fbfb51","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.ab99b8064.0.tgz","fileCount":38,"integrity":"sha512-/L/sRPHClcP6NdwJmxX6w+89gjrs8ep8S5tFw/MLAL1pGaMpuoTR2nv7wTpOIi9CORDnzDq2Yenv/23qVXISmA==","signatures":[{"sig":"MEUCIG4rdimuYw6VNvqFMAQPkAOV5a7ZkhL0+ywxgBvioG2GAiEAl84684zvVJORxmKy0nMndShulNvMUvKsCJYI1Mk1dwc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":705970,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgda5ECRA9TVsSAnZWagAAngoQAJ5iILgNb830TptU5n+a\n6cm2AWUhV6qo2e1zOWbWNDS1qhY3gxA/4HoBWS5lEzSx/KiMR3g1lF4Lr4eD\ndyczIduqFbbwhjQY4e8gsN/O0AXT4tm3Zqi/LxVinSu3hI02oPGuXF48TQgB\nHbRQkl/SsN5bIsPAWEkkgsx3E8qCIv8ly/LVOa1XnY/DAw5ZubskuoteKHdr\nerLsYtxA7QPfRPbg/ftipAyhQxumqJZCHMXX74yxgOng5dPxUfyqTNfTKLq6\nqQKPAGRUyUuhZRXAbR+eZlxhKQ26aLuecv4QJaXEoYh+LAG3Zxtsue1014LQ\nEoWGMsBCdMg9mHo39t0Ts8XtyNYSgyrwvUpyo4Jvwe2jNBwU79frg5DoA6gP\nVvEggucWvbWkAUs46M7FsYACLkzPETMuRozHR+3nSjOEX8KR1MFaHd3G3arh\ndxLghsTu4DS9nLVv+ipFchfvXtil7q1R0ccfGkqLPr6XaxyLz6Qagb6Hy7u1\nosCXpgpNNzJ/h2uX98hgji0LzEkSV14OteVE9acQDuZX3GzLSwANrjpnSblQ\nHyeAV83JlKvocvBgz2AZ7kXC7fcroeVmx7KBKzrZFueo+Kln6OeZJ1urO/Ss\nzxecQgqQs95y+LNRWJ+TIxbSixXYNC55/BMC/G5PSKDEKvwx6mk7zWtVHa38\nprfa\r\n=adV/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7a67c09690e367ad8ebdba2d551f6432c20ccccd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.ab99b8064.0","@material/rtl":"11.0.0-canary.ab99b8064.0","@material/base":"11.0.0-canary.ab99b8064.0","@material/shape":"11.0.0-canary.ab99b8064.0","@material/theme":"11.0.0-canary.ab99b8064.0","@material/animation":"11.0.0-canary.ab99b8064.0","@material/elevation":"11.0.0-canary.ab99b8064.0","@material/typography":"11.0.0-canary.ab99b8064.0","@material/feature-targeting":"11.0.0-canary.ab99b8064.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.ab99b8064.0_1618325059616_0.8465570570439105","host":"s3://npm-registry-packages"}},"11.0.0-canary.8f0a11e32.0":{"name":"@material/tooltip","version":"11.0.0-canary.8f0a11e32.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.8f0a11e32.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"349fc0cba5bc7979b53bf6c330729ef84b71fc5f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.8f0a11e32.0.tgz","fileCount":38,"integrity":"sha512-IHVy3/b0ylIQQLGMqRJCik082x5YzmeJQSDaCJPYQVsSb8VpaJpv7mDfhV6sNpd98QZHNqD7TMD75hKN+iMKBA==","signatures":[{"sig":"MEUCIQCejW34sGXmHyYVKTMmNV/4H4aQouvLm3RcaqgB5TvHiAIgDvpayR1q1PR9QSlPK63KC7wATTic+JZ3Ec+rCtcT/ZE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd0qpCRA9TVsSAnZWagAACwoP/j8Y6u0ErMM8np8C8tMh\n0x6csO99AeSrEUXySmFGJ1aaRNuUR4fFISu9eqCFIpCwjA2XbYvT7ErEqyXB\nhTa3kYXeycIMzrRFcQHzUUWHofJjR1mMOlO3MLXXl762o777uknX9FxF5zxn\nEdBUCUIEkCA5tIEUMEp4aOKd89kJCqQgXisTA+/W1UExG4ifkDgirZ2tkpT+\nl1IcNXOcsZ6Cjs70P2yME5RDRO/WoqHGMpc+P+CrGCjK6MCiLVi8gQWvi0Wu\njIfC028r0x8OI7kPncqc7S14a8HfE58g/N0kQU9gQZQZRGPpBxnn8MTos2JC\n6zJuj+uhdVxbDqJ2tkM+7yeOP0StZuhFq1vtQs85wd75+0dplGHlp+jZqbe2\n1eyZbNshKupU6a39CGdAerLjX8bE4fyxtSV46KVK5ec3cYng6emPj6FfnQny\n4dPZuCBas4JTLF7H9PRcU361nrd9WBqZJ2SUDGPcaM7B6uX15aktiFrqbKym\nos1597vUZl859JpP5yKH03kpDYMM2uVa8qf1oRACkSDNhUa1iSIZ+kcGPqGM\nS7k+1/tL6imm1rSY553lwFA08XjtlG7gm6Xo6KrtdHp8vnqYZRremawZLrd7\nWpK28KHWpH8HRg01Na3q+0iAC1I3KGj4y2Vg5OSZSEHZCA/qpGa8ptTzfX+j\nmgqO\r\n=yaIL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f09b2c0c350e2f684e84766c95eed5c92b5afb0f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.0","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.8f0a11e32.0","@material/rtl":"11.0.0-canary.8f0a11e32.0","@material/base":"11.0.0-canary.8f0a11e32.0","@material/shape":"11.0.0-canary.8f0a11e32.0","@material/theme":"11.0.0-canary.8f0a11e32.0","@material/animation":"11.0.0-canary.8f0a11e32.0","@material/elevation":"11.0.0-canary.8f0a11e32.0","@material/typography":"11.0.0-canary.8f0a11e32.0","@material/feature-targeting":"11.0.0-canary.8f0a11e32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.8f0a11e32.0_1618430633439_0.3573461192445939","host":"s3://npm-registry-packages"}},"11.0.0-canary.f5c6db8fc.0":{"name":"@material/tooltip","version":"11.0.0-canary.f5c6db8fc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.f5c6db8fc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0e7df3e52cee6b0f57bc4622ccbba90a1d21dbe3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.f5c6db8fc.0.tgz","fileCount":38,"integrity":"sha512-10ZnnU31/NJku38MCzJ1y6LFu1cPPKhTqZBD0SWO8m33a5hMD48n1HS0KQKrCpfZpxKHswB1lyrVX321jSN0XQ==","signatures":[{"sig":"MEUCIDxGxQwZhKNfIRRuKNOwaexsqtAY7CVcVGAppLfnlEdCAiEAmb2U5H7/v2WI76gKLNBmGG+XpINOUH3WHRzMzGm1kek=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeIBNCRA9TVsSAnZWagAA2qQQAIEF4ElIDEcOGkLtIsvr\n4+N6JuSzek71/GyEpBlpeNr1Na2s/APSqiq4h993kq9FvgZr5K+Crs1Erk8w\nrP5oTJhUqU7x9VWO2XKDbqFEqAHLhR3kJyoxTSO4N+qoiPkeNMH8vmEKF1cq\no6nMRwl3TUu2fnWaoSQfbI6ULjLyyIpz6c6cUrHFOpChgD6D3G52JFmb50US\ncxFd/R74blYs3Jzg7TLkG6zqZ1+71HXI78OU4TU2UvpX294XIDmD1juaCOv8\nImcZ0nEDO3vgKoaPRISQMimRHT0kwWB9Sces9mVQEcByr96N3DvqeukoJ+ax\nWVpjt8nCNy+akXBoL5ZAuFd4azLMXNfQyoKZVEx2SKDSknBnoBJO1JbM7fPE\ncsbDeEMUMuUoRWvX0CIJl1F68eUY85ctGWgP4oeBD/gBprQxyCJ/JaRf06Va\nR4rYeUaIwqBHk5gq/oO2T4rD1d7HIvgW9h4cbuHwKWmEVjCx2vw+Xcl1CuOg\nZMugpwNrteJJ3fhKEjExargR6RnpPSnQ59FLhVDs5avRq/KSy6z6yCpv9B7t\nVYbqXiF1Xqs8QKdD3mJn3nvhQzMxnaEnUXB0yc8NbEO8aDUDWJECeEam+BWn\nlk5mJUnAdTwAIKoSZqrRCt6tr1HHTFPQSGqVca7Q8Qhnz7vMSevyr6d+PiJx\nYau4\r\n=rK7z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"eddcbd64f4309f4bf5faecb13428405a28774f15","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.f5c6db8fc.0","@material/rtl":"11.0.0-canary.f5c6db8fc.0","@material/base":"11.0.0-canary.f5c6db8fc.0","@material/shape":"11.0.0-canary.f5c6db8fc.0","@material/theme":"11.0.0-canary.f5c6db8fc.0","@material/animation":"11.0.0-canary.f5c6db8fc.0","@material/elevation":"11.0.0-canary.f5c6db8fc.0","@material/typography":"11.0.0-canary.f5c6db8fc.0","@material/feature-targeting":"11.0.0-canary.f5c6db8fc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.f5c6db8fc.0_1618509900987_0.04649038954133422","host":"s3://npm-registry-packages"}},"11.0.0-canary.3793a3143.0":{"name":"@material/tooltip","version":"11.0.0-canary.3793a3143.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.3793a3143.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"101be1338b143606407c1172cd220615491789b9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.3793a3143.0.tgz","fileCount":38,"integrity":"sha512-JoEA+9CyzTm273ClOjjGpjRQZCl2UT8eAs+lcXXkYMO2fui/Sif48w4O/5nN5na80e3SG8dXYMC/4uZbKE+dGg==","signatures":[{"sig":"MEUCIQDTYzm1R7Wm6otzbDuiQyh01o0ae1J11Row1VKh7mO1uQIgeqX2Np3DozzMjTAcYDvbKXjt6t2pW9X2wRQBo2r8SUY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeIavCRA9TVsSAnZWagAAYJwP+wWHXyPpT8Ix0pdnWom4\nVQ2UFHj4AIbc9FzeUOG1zSuKgWA5aGOksAuXCQ79A+pzjTJiOrleJrhmLHOt\nhXeQBnfQYxH3d7eE+1qDAY0Z0ckJcBh1XEWbrrxPg7b5yyNdVuuEhdJfmkRC\nG9fBcZjyY/U6MvbDri3CEriNpohOJujzB3O5pvGS6t7I1NdKZokt4W+HovJE\naLEVEhS5Gloe5IJBoRBBN+rHsKbDZJeiYTXrZj/oBjSCPwrdNMm1bxACqLMB\npFMjIx4PQ/rV05avNxl8hSa5hwQwdCz7gdMJyUrZuasTkrEfppz95GFx5TSk\nSNplX32gxXLucXkoFVxtFV1lR4wIIoswa7kSvmAgcBdnyYcBEyQHhTraChIl\nk6WPpyKiifDyI5LYpsbZv4Y6Csp5Zx8ddroNegEHXg5KjhlWjo+JetHu+Rjj\nfKaO3a5bMLl8Qfd/gyprp40hgXC8QOxJpJ8tk1/cKH4Dv8XwJ7d0g5H2PJIS\nqyGjWwFN+/xzpD6/C1omQMKBOnymfhcrDarDirFf1BlL40A3hgBOuh/YX1Xn\n26dscVKrRnIW4IZuV4zVdxVKHXnQi1Lpl0WyheFuE4e2WFLF4vh/qad7NWH2\naHmJr9pQCylRQW7RkxFY03n7RpLVlzJgaq3L/ibpeTUPs2+U3wye6LJyMkbf\n3zjh\r\n=KosQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3cfbed34975d8f2990425af21414290a96e2240b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.3793a3143.0","@material/rtl":"11.0.0-canary.3793a3143.0","@material/base":"11.0.0-canary.3793a3143.0","@material/shape":"11.0.0-canary.3793a3143.0","@material/theme":"11.0.0-canary.3793a3143.0","@material/animation":"11.0.0-canary.3793a3143.0","@material/elevation":"11.0.0-canary.3793a3143.0","@material/typography":"11.0.0-canary.3793a3143.0","@material/feature-targeting":"11.0.0-canary.3793a3143.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.3793a3143.0_1618511534369_0.7182522269393872","host":"s3://npm-registry-packages"}},"11.0.0-canary.bc104bae7.0":{"name":"@material/tooltip","version":"11.0.0-canary.bc104bae7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0-canary.bc104bae7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a515a6e313558ae9268405670e8f33805ff9ee8c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0-canary.bc104bae7.0.tgz","fileCount":38,"integrity":"sha512-EOLwTYbbY1vRj8afJEFVy0WrKjKb35yfnATJU4bHz+th9otypKlQjflh58OiYfLiaqW1bIfsqZALP7djG0Skwg==","signatures":[{"sig":"MEUCIHdHD4ka62pcdp1oLryrOnWOqWdUrmAO3p1EMGqJ2fyXAiEA5K0krKkw4bC5mXPcmeNXUac1UYyX+/a+aKj9Far4m6U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeJg6CRA9TVsSAnZWagAA3KAP/RthPMA3GOkhw3Edjyue\n+5ttfUkkNU9Net0r7nc7IKTxkiEaNX44AyaHJ/SIxs1c9d9Mp2Fot3JOnsIk\nia0gPPlVEETk9RpYqSCjM6lX1n1yxq+VPQeBo4KwioOWep2+Zw+uL84Abva3\nJjucSdyFnGbriWADN8tEKoXZlcr6kT9u9mYL6QyMPhStRWAEC+Fiz/g61FvX\nPaHea4Cx8+reM8NcCVlH+VUdueOSvGL73rHlcnY02+v8I4o545hc2jk5mGLL\n8d5WMYU54VjxMpTfFeX16QWY7ic0ocEf2wsfeREQVnzs0kd/60vkBQYXWkXD\nInVgrv8vEj/85Wczcj44AK9u8dvQttb8gU9mHRR9ve7HjXvNGkQ6RkWLPDSW\n4b7qw6OkiqUfOZrW6mIBRn+CTUgLb0kSWyN+DtLTYGGS7DCWCdOwFDb7RYIr\nCdE9LbHkX+yeaG87CZWIuV16HdjdRK9YlxgylW5lN0rQtP8JqLATxYFlYLXR\n+nEHxsD2EAvMKUl/xXQt8rdwHWYG6SweeZix+PUFD1j3fEmKojAAt9g/Sy8F\nBHVqy8zyGErpJhE7SsefWXIjOqyevkp69lN0g2uapOr+7iFwo8sZxYCvmkjJ\nf+GCRrcgLoazMOFAxRuOV+Jarkf7XJ0Zn3G8QI/QvmJRuJrbHUzNCTHVcxjW\nxzr5\r\n=9cB5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fefd0309d7bea91a430a20913f05f501364f2ece","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"11.0.0-canary.bc104bae7.0","@material/rtl":"11.0.0-canary.bc104bae7.0","@material/base":"11.0.0-canary.bc104bae7.0","@material/shape":"11.0.0-canary.bc104bae7.0","@material/theme":"11.0.0-canary.bc104bae7.0","@material/animation":"11.0.0-canary.bc104bae7.0","@material/elevation":"11.0.0-canary.bc104bae7.0","@material/typography":"11.0.0-canary.bc104bae7.0","@material/feature-targeting":"11.0.0-canary.bc104bae7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0-canary.bc104bae7.0_1618516025934_0.6193971856728007","host":"s3://npm-registry-packages"}},"12.0.0-canary.3f342c3f4.0":{"name":"@material/tooltip","version":"12.0.0-canary.3f342c3f4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.3f342c3f4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"33cb5654718cce47f8faa52a751378154e7dc358","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.3f342c3f4.0.tgz","fileCount":38,"integrity":"sha512-UT4dspe0X/ns4GW3ymsjn/cPvVIg+0B92CEE3B2u4x7k/Z1xnfp2Y2wvVgSRx6u3vnEEzDJGcdin51+DklFVig==","signatures":[{"sig":"MEUCIHA3v3LKve0I+DcVuF8kEtHpgEC5khMOhkeRG0VhNFjMAiEAqzVwzLD4mrF2sVfvvd+M8ep7qtuwZUX6ageCp4Hbk3w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":706078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeMRICRA9TVsSAnZWagAA7z8P/2HVHbaRODEn+aD2yjoY\neOsliYysru0ozrW9DKj1DgzYNRxzw+boOidRf7OM+YbHYOfsau8T2XUGV+yF\nzoFQmW9ndwxArPyxBkkEQDUMdM0wUqPQ3Iwlp/n7c8mGJJrz1WZVpoMBYCi3\nCMBWhcPa8/e2cIEoyZbtb4nbQ0qTr/UErw/HCiMw6m8Dh+Ed3aitWIVz9KLC\nWZk6v02VneHnX0q/aAn708/vk3JOqPxQv5A8sM/o04joMmL1dcKnIkCz4QVR\nJAR97JCUoIfU4R4soVljjCC4S7cTiIHObtIXyko9249il4u5hILiD123KeC+\nNoImdXvHj42msy4Fe24fi8Jnp9DFQ9TBjVlCAN7FMhZIDY3oXyj7z0Taj3fm\nYpWbGUzzRiyE7ObZsGLvATdweyp6hd12QZ13t+sIVh/bYMCiVH2qkmJa3C1D\nIZx/sCbw4rmc2/3gxkI+Sj3OKInK+bgfcIkApGxlnnXNnHZmXkoUk7NfilGI\nZ3usjR+IVBW7t96YgUGRa9HBgkzpUy+f/wXrUMWwPCIJqAO2amb0GMRip1LC\ntlpXwS78o2/bhTAt9eDE86s+F4FO+L1zHEofhBoQHEIk/CNKjI53Dbsy7TWV\n8DXCtjw4g2mBMEi97GxlStKa/RO33YAbWqRFe/SYIadTVIubn1PRUTFL4nen\nS9Rh\r\n=o3qh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d82c002d3f314f99c3413389c77960016a48bfa7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.3f342c3f4.0","@material/rtl":"12.0.0-canary.3f342c3f4.0","@material/base":"12.0.0-canary.3f342c3f4.0","@material/shape":"12.0.0-canary.3f342c3f4.0","@material/theme":"12.0.0-canary.3f342c3f4.0","@material/animation":"12.0.0-canary.3f342c3f4.0","@material/elevation":"12.0.0-canary.3f342c3f4.0","@material/typography":"12.0.0-canary.3f342c3f4.0","@material/feature-targeting":"12.0.0-canary.3f342c3f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.3f342c3f4.0_1618527304341_0.16232998280216893","host":"s3://npm-registry-packages"}},"11.0.0":{"name":"@material/tooltip","version":"11.0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@11.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1b3af742f9c9072300e32a85d192d57e0ca8c0b4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-11.0.0.tgz","fileCount":37,"integrity":"sha512-i9PvUDB2fQ6Q+1uOU8gFfe9WmVpD3M0ilN9LgGSbY/tCIwH6kxCS2jwa3/z1yJNWXBikLkpNLlOs1JmYYqteVA==","signatures":[{"sig":"MEQCIBn6WkPUBD2GAxIky1MgLxlK1/ToE693k/lkfMt2kZLCAiAtiQPFsqJSEbKD3yQpdGck94MGESetkOV/mL4F6/6oWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":703443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeMVCCRA9TVsSAnZWagAAfWsP/R69wuebmxw0zjt1Xqgi\nPQLt1h3Z00/tBay5SWtCUJ5LExN8UEPuecYLVTEPTnCWM9FO6AywEnQ9NF2n\n0Eg1Lg/4ULsysn1P4d2XGrTksGx7cLlcSNgbOV7CN4UB4TMcFET57kEizVLe\nxJcQjodJaAUAtlv2SNx8RPdc1K6JCObquYIcNAtEdmoWkta13/O0cI+1ebbw\n6ggAzRl6oUN3Zdj/B6QVgZmDFFoz1qBLWiyd5SvmoCYgpchMDMcIxnZIsRXq\nPP4ul/t3zCqZeWi961w/njavQUX3GYjaY8zGnhv8hL+qUnx47DKbYag5C/pb\nUN2sc4iTfsuRkGyG4ENNXfFXxmUcT/ortRuTWVZBDrWzqsrL0fpIYiaT1IHi\nPwCwDu6YLwL0swXbJYMtmceDt9OTIPU6gdsybDRIguD90AY2qa7UFXFPyGVM\nwKuUa15hIcEVrVvEkphVf6wo23gnFGVlHgQ+Z713T7Np59vZJ1Ltv2GA/PeO\ncz2mft2MXSrmoWwWzwzNVKIxDzh5NiOUSKtAU9ijq0LgX1TRwpQXTA1LitI2\nhvzfTGOkzb0/XLcQxy3h5bQ7KwpTb7iUNTQyv7wHzHDOE309TZu9X9V0rddW\ni+RHL/eXW+r1TrptYM3EW0vqkdl6WvI4hGe2W/A1c/S/v5E4q350pl8r5U0o\nuJ76\r\n=JvAM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","gitHead":"3f342c3f4715fd3587f327ce4ea6b5dd314c5c55","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"^11.0.0","@material/rtl":"^11.0.0","@material/base":"^11.0.0","@material/shape":"^11.0.0","@material/theme":"^11.0.0","@material/animation":"^11.0.0","@material/elevation":"^11.0.0","@material/typography":"^11.0.0","@material/feature-targeting":"^11.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tooltip_11.0.0_1618527554051_0.20593946096024163","host":"s3://npm-registry-packages"}},"12.0.0-canary.2ebfc5374.0":{"name":"@material/tooltip","version":"12.0.0-canary.2ebfc5374.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.2ebfc5374.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ac22fc2749f3213b7ee5b8fc0294ae708b40617e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.2ebfc5374.0.tgz","fileCount":38,"integrity":"sha512-HUomCm/h7WavijuGeSeG56K/LbRm755keYmOI1GWRdBTwOSlGZQCahsjPPtpGayv6LbHVv9HYLtofTAhYO3C2g==","signatures":[{"sig":"MEUCIQDLch6rSn0M6wkC9Am/o3wSTtCRJTt7RuWOy0vSFxl6JAIgYqHymf0gIAO44TPc9s6gXlDOWll9na7j3yp+eYo7IH8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":764505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgefeGCRA9TVsSAnZWagAAnRYP/2Hmbd4eIHU/UoxkNdmW\n1V/s779BJomzEMYW1mkhre7j0TiztXXlqarNhVzyyZqDsuM0G0tyHY7RW1PF\n4loYLTC+Oia3WWj3H0Fp3xCuDDWdUUN9KwybgDVKZ8eVxkbGDyeXDpwHJ3rN\nSEu8EyKhM9tlKEmS67AZ8VpQIECb+5OuWWJWkK6y7eAfvxlBydYZNouvGWka\nchGUfpD41vrwpkiQLrG2KrSmo9mRhEx1HaKP7XVlMhdlM4iLQTG9sJAf6OAS\nSUVYit3uVbaGL7PyzAIrkeZyT7lOmzB8jB5QN6jxiGF/JKHaz8yevp7rq7kY\nMnlSuXqtL7QaBhd64gxN88RMrzXIaD44YHp036s9B1hHYpo1SitSaVGVnVlv\nCfKD367cOBxLCVa+SQPtU/h/3vD43kOzrg9N3dhObk6Kj2TnX1ZfT/S0qQZX\nVa7fKMXNaagXIH2eJbdrc9wKvLzu77Ek0qOGTX8gihQaNxQbjnOeD+ttix1X\nSoHKu/odd+xJqEYUDxYUazRvmx7gxARpD2SNFTVXoZJtO0nGp8kqLNm4cDsF\nzyN0S7QJAHwIoqsJFLewBpdu3yVT3L8VBZZSDfGLORgL2mb/ygA7X5+5cbCs\nPK/onqMlrl5EyW2KXr0QdMWmmtUAXynsGEa5jYyb7KkwrwO2qkmEkdBlSPcM\neg6k\r\n=UJ2N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"603bba9493212a7e1b6350d2f12e7488ae1d9594","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.2ebfc5374.0","@material/rtl":"12.0.0-canary.2ebfc5374.0","@material/base":"12.0.0-canary.2ebfc5374.0","@material/shape":"12.0.0-canary.2ebfc5374.0","@material/theme":"12.0.0-canary.2ebfc5374.0","@material/animation":"12.0.0-canary.2ebfc5374.0","@material/elevation":"12.0.0-canary.2ebfc5374.0","@material/typography":"12.0.0-canary.2ebfc5374.0","@material/feature-targeting":"12.0.0-canary.2ebfc5374.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.2ebfc5374.0_1618605957434_0.1542657526203033","host":"s3://npm-registry-packages"}},"12.0.0-canary.5631828e1.0":{"name":"@material/tooltip","version":"12.0.0-canary.5631828e1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.5631828e1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e4ad4ffaa24ca036175c751f927f232e07c6cc17","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.5631828e1.0.tgz","fileCount":38,"integrity":"sha512-eC0EBQxwrba7tfztHmHTTkjLzpJLgxO2dDUkC5HjemGSfNAx9bSaHpfz9UcqNqa6/p1lOjZoOlT4hlZ0lBXx+g==","signatures":[{"sig":"MEUCIQCUpa+Jp6SVBAhGIuHnTK6DC5f4JONr6L4UmM7rZslaWwIgUGojxQM3XDs8OwdO0RE1Rpf98d2COocEK6FnSOYSY5k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":764505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgepKiCRA9TVsSAnZWagAANq8P/0DGNps2aFJqCu/mBzi7\nLAeQ+9w4UxXJWI14LFAA2Ld/FkI+Y5n6g6NIDLFZYgie5+Xb+EBRWNwwrfCp\nnwk38xXloqg6M/4fjIOugxSviwTYyVxpx7zpf5T0SRb3a1Rz3Z4/oicqMnui\nYGNbNfYMKOHP1gzwOtQl97+awNEHVdZLoy0d93LvhXHi9sEk2mL/gcrvzChP\nRZxkLQ6po/zuvl+t9en4WWObIEgK0W5vaG98f8A/T+8ue++RHZD+hGfUVSyY\nnHCfrjAxr27Nfwig69tV+HhPJGNhGszPhTBspYjtmRqcfRdcwcMqEQnjKFwV\nF1XQ4cf4IL2nKTchUZ1pf3XNVHJW9Y0vrHbk8nAPDVwypjc61m6KJ9kBxNyv\nKYubhUUE2PbEXUjbjgEJnjeUnkbubuKXQLos85ZvMJNQfm7NCi6MGjcWwOD7\nPhf2fMla1g3QEUEIXSbIu6C2lDmVR1NqnKqCC5D0FiUCfr/X2YZTqvZ0p+cg\n9pD9FbyN6GVXNBq6d3OjcaQu8oNEgOSYTNY3vgPMj1RrhDGpCiQBsGETq39x\na2lnwci+DD6ns4VznqY6VlYSk7koDFZU1kX0rzWvAfZxDh8aBittm/4Tw3XJ\nzJR34i0W3osNs15KnL/XVSZfroKE+7cFErJ234gSVyYF9xjOp+9elkXpZvtu\nFv3y\r\n=yVdq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"497e1a2527ce0368b4038766ea4893675ced3523","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5631828e1.0","@material/rtl":"12.0.0-canary.5631828e1.0","@material/base":"12.0.0-canary.5631828e1.0","@material/shape":"12.0.0-canary.5631828e1.0","@material/theme":"12.0.0-canary.5631828e1.0","@material/animation":"12.0.0-canary.5631828e1.0","@material/elevation":"12.0.0-canary.5631828e1.0","@material/typography":"12.0.0-canary.5631828e1.0","@material/feature-targeting":"12.0.0-canary.5631828e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.5631828e1.0_1618645666475_0.25716884257497474","host":"s3://npm-registry-packages"}},"12.0.0-canary.bd685395b.0":{"name":"@material/tooltip","version":"12.0.0-canary.bd685395b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.bd685395b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4b44c18ba2f82b7450ca7a9d25af75ab9e1b9f98","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.bd685395b.0.tgz","fileCount":38,"integrity":"sha512-TUCAby803AVbG6u0feu66+RFrAFzvaVXyFivm+J2K6AxkG2DuLLr+VhacbV5jjj/pXwynFo9H1HoAcVIE5h8ZA==","signatures":[{"sig":"MEUCIFmt6lw1DyuBjX2zPRhgIfi3hgqqDtp545E/79Pf0rL1AiEA8HjqmiQcdIftvCtPR9mvZdCuEGqlVkFu95zkmkLl68o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":764505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfc8ACRA9TVsSAnZWagAAlBYQAJkYlwbPH8UlOhk3wEYA\nPG7kppGTzfgqpScq1ATtoS3ZPHMbKPPsQHwUCdDsxqobO4dggaIXlX2ylkfK\nLKN9dQpAB8NDOBDf2hEONV2ca0IN7LLhoWpcI4BlAnJvXesCheb3KmrJO0ES\nlVAb6f2KNWPIJ7zsqH+DcDuQCbGFegTPEM56S2k7fH0NEfyJfUe1SwhQzove\n+X9+W6guEL6TNBBCYeTFs05iDs8qph8H64k+dxxCMiCbI5u6ZyRGSmRrFGuN\nyAuBE1jEgBZ+wJvPnI6DMqsCDaOdsOWIAjxaQIKVQC7Cils4MSUKJBZaP/uU\nn0L6BJIlQeUkgD6yuHl2krgwACPto+S//CbjoFGJeXMImMWQYMY/jVCUmW3q\nN3XtPh9qMAQwXfgNgW7YwOjdJxfQSY/IQurz5RCtcT5nIjOHNDhfiPaXirN/\niY49qYmSparHhesGJLzBxPa8tp+2hIcQQZCeAvB2RSRP3ln2yXgW66rWqMZj\nZN2vpE9xmPZi1bTFC7PGoLDfcJHnuDFPw+CFiYeXD9lFVMyaOKKFZy23zOIZ\nKu9Ww22TfpCQoqO4rVsbJHTybrovfb7toekuEwKSfYImo9UuiZnPP0F746sd\nfLjQ4uvl0RIz9guzP2ZMsgZ/x+ZWmpmUHyVNPFfOGs0OMFlfQ3kicJpb6OVX\nt2tK\r\n=cK88\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"69c7d9ec7c5de65144c3b2a9b283b6baf7af107a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.bd685395b.0","@material/rtl":"12.0.0-canary.bd685395b.0","@material/base":"12.0.0-canary.bd685395b.0","@material/shape":"12.0.0-canary.bd685395b.0","@material/theme":"12.0.0-canary.bd685395b.0","@material/animation":"12.0.0-canary.bd685395b.0","@material/elevation":"12.0.0-canary.bd685395b.0","@material/typography":"12.0.0-canary.bd685395b.0","@material/feature-targeting":"12.0.0-canary.bd685395b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.bd685395b.0_1618857728368_0.9982029078694947","host":"s3://npm-registry-packages"}},"12.0.0-canary.b52196498.0":{"name":"@material/tooltip","version":"12.0.0-canary.b52196498.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.b52196498.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"39888d646b147372d5127092d4294760e6a0e935","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.b52196498.0.tgz","fileCount":38,"integrity":"sha512-t6J76sX3ByujSTN9IeVj3wKCK64lH2NDki1JKoZQ+Exo7Cjx6A94RkYAfGOkAqdOx4f895nr1hef3jWb0XWdpA==","signatures":[{"sig":"MEUCIC/RMsM7GvvhmwYa2svM9KKq09T3PdCUzn3OS5rskOvVAiEAoDpSZErB4lwTOieLLD7gJY8OkWNvWSvm4I8BYMUSr2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":764505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfeDyCRA9TVsSAnZWagAA1tkQAJd5acCVtdYU8ir3Sl/l\nNa4t8hqFtWZBR2fh7PqbWdle5DlUpGP7+ZZsybLbteKhCs4eud3mXNcFpqTV\nxNVekOfQVX8hl4efHR+auMkdgasc8LDgrDx7/UfyjhSwk7ImcaoDuYtKkcpJ\nqfn1cvrleOH5fcwII7HCm/73Y4jf96kM2m1sUKyKcsJNJV5AuHlmfba4PRbA\niof4heKN/7UVnvqlpbU4M0jBGjfhaR4WKtbjFH+trBCMufgeM2Uiwe/bgrgR\nKj9EY9HZqBw40HegB5VwoftmErXe4iV12Zwp1yT+zU9mlPR7Nkp4mEK3HB52\nBBulmhy0W4PCrm8YJbXE0npeALULxXPzlsBszZ3v+BOTqBwffKTAc+HMC2b4\n/R0LEDJEuf7TJY7R1RgDJGXt1YWzpaggsVRpsa48qYVtwxAjSlU3e56OGnQ8\ns5XFGLOu+N7UjK884raWCQk1rPAfDxnHdW+v3qgO9KXGOb0DPHqZOh+kq/Qr\nvzecXuuEGWgJpljkz8vzYfEO+1BJLIOwFcpYEV34zxJxq1GdQPc7CYl0dhV8\nL3VjvTrAySkVF8I93YtsujzYw0Us+hDMFF8GkvJ1ZK7PfsQOXJkG62OmvCmu\nJ3y/vvLc7RDXZ99vlab+doWF5Eww1BWAxOXxWaET9fB5Z7rWzFLG4MscczNP\n8gig\r\n=socY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"953cfdd3bde4c66a4b6b90171d4ee702958ae1c4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b52196498.0","@material/rtl":"12.0.0-canary.b52196498.0","@material/base":"12.0.0-canary.b52196498.0","@material/shape":"12.0.0-canary.b52196498.0","@material/theme":"12.0.0-canary.b52196498.0","@material/animation":"12.0.0-canary.b52196498.0","@material/elevation":"12.0.0-canary.b52196498.0","@material/typography":"12.0.0-canary.b52196498.0","@material/feature-targeting":"12.0.0-canary.b52196498.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.b52196498.0_1618862321455_0.8226634865739788","host":"s3://npm-registry-packages"}},"12.0.0-canary.8ba3e298c.0":{"name":"@material/tooltip","version":"12.0.0-canary.8ba3e298c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.8ba3e298c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6dfbfe917313d1be188aa72d9bee8bef413e7661","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.8ba3e298c.0.tgz","fileCount":38,"integrity":"sha512-a40B/JL2MFeJFYrXDPPfYE1SVNW2J+Dfm4twlYr7FpMDCCxfCpst1jIOUV8axrNSSYNs7nvWeuTzTILGbr/BkQ==","signatures":[{"sig":"MEQCIC4QiLE5SIBnOsnrf4z72pdP3cJd4JVBP9ufXlc1RH5MAiB70jtfxUol9+Xw1xaMutSiH62NtjVouoANvAmROXoZpA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":764505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggDIdCRA9TVsSAnZWagAAYRUP/24xr9+wXZGTftLIMtC2\nViKRmQVG7zDDiTEM1PKqCvmMEQrvTqPaSxyLfWxwZYKhbULhtSHwPoUZRXfL\n5Gy9pKwVhGaoY4/2xHoVVYCQ+uXl7tOKI4gBAcQwbj29etsNUgM8B3OVYwRD\nt39cKr5Qtf0ATTfPRvY4mM/sYcdP4ppYs/ZeXoLkzAirXs2a9b/k2pDb46qD\na/37k12OjYyhi/vidVzE/g8FbIbHJhKZL6vxwaQbnqxEcp2t4AJt7N8AahhT\nLgEbBM6im6SemS++F1FkRCEZqVG0pb+fqkt0A1lg9SgxX9Zj9NQnb9upQBqj\npbSI6sREZMWb3HkVqWRCZJACKuvJVZF58dFb7rUXuaUqw5iDlO1SxoldAJPe\nJHLqa63ISL/4NuQ1039eAmbxnb88YEZqqdFbl+Wlr3N20cEXZ/spunOqSIoJ\nbaDv9E0fP/u/Fy7Mu5BP07VwqBm1q26+V3wCa88LX3nvDuyjl5tQ2RXt8MUw\nWrdoPOuklK23sKVd6wpVI7HA6fds6MKHKFbThUAJ+hGKCmc8CdpuJTQaul09\nwCoKvKIVSXc+tYjsDbIjurgvpsXfeM0xRCZ+XsMXdY1nh6OCRlEV+oJ6rW9Q\ngPcAvECyV1HNlbU9WkMy7ClpnIYdlHNuFcZJisSHd3/QIRlKUIl4HqG5VyKv\npgtz\r\n=5pBj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"206fcb6cb686d5de97867cb4e4005926e2a94501","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8ba3e298c.0","@material/rtl":"12.0.0-canary.8ba3e298c.0","@material/base":"12.0.0-canary.8ba3e298c.0","@material/shape":"12.0.0-canary.8ba3e298c.0","@material/theme":"12.0.0-canary.8ba3e298c.0","@material/animation":"12.0.0-canary.8ba3e298c.0","@material/elevation":"12.0.0-canary.8ba3e298c.0","@material/typography":"12.0.0-canary.8ba3e298c.0","@material/feature-targeting":"12.0.0-canary.8ba3e298c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.8ba3e298c.0_1619014173046_0.6611623530603254","host":"s3://npm-registry-packages"}},"12.0.0-canary.c629eab71.0":{"name":"@material/tooltip","version":"12.0.0-canary.c629eab71.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.c629eab71.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f031db9ddfade934b3dcdd32686fd15a21bbd5f7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.c629eab71.0.tgz","fileCount":38,"integrity":"sha512-Hvn8RUcFt5f/XpSEBuyVBuD3FMg88gvRoR4zOX9crsyuoIV4PQrwiNgTRadvGwUcVUUbL5o7mkjCJHPlJZvAsg==","signatures":[{"sig":"MEQCIExskEuoPEQlrU7wP5GEK5xOyOGcmYqxJopmQuTskfXUAiAs4jAqJLvZQR2+89BwqZ0NHZ7KApk8rv7MSVWfqIyVmg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":764505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggIPLCRA9TVsSAnZWagAAd/wP/RTrEEzYyNOqnfDAAgwW\nkTo7YJVs1A1NlXh0DZjuuBEnXOsTkBH8CrNeFg0ZddDMbVw7OaucFjUq8S82\npKfUED74CHHyL21WBXr7Rrse35o86wFrdt9ih267CqGC9WCy91qt98O2AP5c\ny6ayXqC4MSeBBcZ1ynvFZv2DvcLkU/nax/melV1EE7Z4soqCoFjMnrUYw4hD\nQs0SIC1yJ03LuaffGfGYFk0l3M7DB9zVabds7Pw/6FQCfOxfKiD2uDKPJ+ep\nz8hoJWNfUrGEgLARtzVa+s3sOMOxXdognx/QW3UADgp7yb/sfFxSQamp3KPC\n0p4UuZmfC2uaKN2BpF1R5srx7twoV2d/w8nctf2Rx+CYdnvdkcsaALnU4y9t\nUlX9MBHWP3XCc0xvanOY8J5lHAu2lA9Dc9BVceF1bYLm52eKPPaAUpCph2zJ\nsGLImT1XolihLRrb3Itxmnq682Q8owoTyQ7uW/h0O8w436tRZjG2lbH0CLFn\nh/OPcGw48L4ydfHdxxSKGalbJDXkIBtJz6pNKivF8ok5hZfyaDToTbruwKtY\nsApkwqDXugdQ4jdg7pgIkC7rJ8T1V9AUqmZW0HVniDGi8tbIquryLMhwADfF\ncD6dgY1VqRh+y6divwoBwX4ihdCpQIszZuOCJDH34HJIy7G/Bs+75nsuSn+L\nGwTs\r\n=HD2J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"13ae4a821cd20abff4520de3f38c689af7cd0edc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c629eab71.0","@material/rtl":"12.0.0-canary.c629eab71.0","@material/base":"12.0.0-canary.c629eab71.0","@material/shape":"12.0.0-canary.c629eab71.0","@material/theme":"12.0.0-canary.c629eab71.0","@material/animation":"12.0.0-canary.c629eab71.0","@material/elevation":"12.0.0-canary.c629eab71.0","@material/typography":"12.0.0-canary.c629eab71.0","@material/feature-targeting":"12.0.0-canary.c629eab71.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.c629eab71.0_1619035082417_0.8110365542336972","host":"s3://npm-registry-packages"}},"12.0.0-canary.8ace3b810.0":{"name":"@material/tooltip","version":"12.0.0-canary.8ace3b810.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.8ace3b810.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2147b9f0f72aa79f031d8d43868aaac003aeacc5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.8ace3b810.0.tgz","fileCount":38,"integrity":"sha512-UOvAIl0TFQRSDR1jSMDEBG2+r2t/snMK7AAfWUPRCu6X4Fq22kAtLMGyXjN4AQ4XeJwSv0NFVInIoYkaVIzlhw==","signatures":[{"sig":"MEYCIQC0uyUpm4E7ucgbytYaZWXX71xEFD2f5vnbiQ6rlwSiEAIhAMRPIf5yqsl6d/Q75Wk9mmhegQmAD2JKiJEQXG/Rg7FG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":764505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggI1XCRA9TVsSAnZWagAARN8P/3VkHePE9bAkenx5o8Xt\nOZcTpzyTsYvBL7fqNWdBNonmccKvMcMb4j8Ggs+wYnX5ubjtPII4iNKa2Tjs\nUY7Q/+SToysg8qrQnPPUEUWJ9zNGPUkgkg2UzUtHQ5q03kaNJbDsVOtoXO0g\nG8kIHnXH2uAdok30ueVXz26L3ra3XlrNFkLVNMkfiY7jVgS9qOOwv2mPG5pa\nVzJut5qYM9/Vav3nKhlzM/vrinGaTcmPhlMHZRuPgSGZZcWK10CC6KIu/eoB\nYziHCggAn3GkBEu6CiBtqbd6r0fq+dc3fREFOL9LSJn9sk4h6/VeLVK8v8Dr\n/9OD4ribtAJ42gMhCq4MWGZN7nglyfQz/CC3acqb6xzhSSyYLeXPjZKSC4LG\niF/Frb0Yw2pN2xMdnr3mrf1a5MdQOp2CBsopjNnuy6/OhyMF1kpwPaaXB558\nBc8/glIQxqli8IkUpK3wRRtNDPBUJNcG8ABEKmQHVU5FMpFG/iurkS/QZzN7\nkRxOhY1sb7kpNhV2pxmO+rwHNCUNG3QK4zbqr0d4w6T94lnSTioVkhC603Jq\nfQa9YQX8kI69B5RPjrO1f5wVU6XIBN8k+ssdfo4UsdtaDcuzTSU0EE3GRj8F\nR0UkutNY7yUZQcXzn79xsvyAszfz+E8gIJ0Z8gCGWDGMV4wNqlwlHK054BpV\nafPp\r\n=WY80\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"622173e8e2308a6104e06bf943b6423381a17e5e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8ace3b810.0","@material/rtl":"12.0.0-canary.8ace3b810.0","@material/base":"12.0.0-canary.8ace3b810.0","@material/shape":"12.0.0-canary.8ace3b810.0","@material/theme":"12.0.0-canary.8ace3b810.0","@material/animation":"12.0.0-canary.8ace3b810.0","@material/elevation":"12.0.0-canary.8ace3b810.0","@material/typography":"12.0.0-canary.8ace3b810.0","@material/feature-targeting":"12.0.0-canary.8ace3b810.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.8ace3b810.0_1619037526840_0.7522958926085472","host":"s3://npm-registry-packages"}},"12.0.0-canary.70beaf42d.0":{"name":"@material/tooltip","version":"12.0.0-canary.70beaf42d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.70beaf42d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0213123234540ee25819f81b910043698b84c31e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.70beaf42d.0.tgz","fileCount":38,"integrity":"sha512-oGq3ZSY27eQXbOPokRdMNP+1Ebih1XgjOg8RstcPwdZ1WaItCBDTWYzk5swFhsk8a8STnz9QzxbIUAWc7LawaA==","signatures":[{"sig":"MEQCIC2QksGkH744bqGRv0ztRWK+VxjJSVdqvtMAJ3UeOqcqAiBfhg9Macn1GjpNaoEUUrHP4V5cN4C1X6tYB9uVDL3h2g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":764505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggJALCRA9TVsSAnZWagAAgngP/A1xWHaiE1YSblmrVp2d\nzNSnei298EZL3SmMaDQ3buVZ5vRz39hawbgU3Ksa8kfpIdrwX+hXTlD+LzKx\n1M5fiXNeK8N9wRrGGwtcNZ8CuHOINjezHBnDZkJnA0+2QBlNrHbaF2tcgfIK\nmNYQ9DwJuOq2IKrZchAqQzyqICPT4K3YlpNNUrzZaoyi6ze31WsL9BBGJEw/\nqvt8BsMcswRzVaxNVjq+t3+iVakdY/x9f8846K+OQ0qCgno9LlWkqzQJcm+6\norsm+szxvjHOuKxlDWOdAHvqPPeICn3MPNXT1MZJxbJvTRvceEJlcboKumGd\nMuIzmDcJ6Qgb3o4AQVx76IhuxeIbcRx2ll5w5WYq9mS0cDBzctro3WKYbWF5\nsDivwWexftme2hYtfmNodjm7/n4nUFPBTDxC8w366zLyzz33fA7e0cdWDUFG\nJfbWe6V1EFAKf7FBA1kz2VKw3P02R0JAhoiFHmuXdkzkDdwT7mSD5gitdyRB\nVXfVERPZIQUmcK327p1aefQeSha/GwrBagfu7SqPlLZkqEQmJ5nEiImeCU7v\nTcI+1W/qo/9KD0DVkjCZ2yBuyyi4oLyalHKgo5PAibJsoZjmO+vrmJVvxEk7\npHbxWNEW1XaiF5Qsfo13LUzlDkj2/SO98v3J1E06FzZLyWm+tS9SE7ZcfCz+\nekHe\r\n=38UU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c5b29092fb8fcd0102b908417d8ed3d61c3448f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.70beaf42d.0","@material/rtl":"12.0.0-canary.70beaf42d.0","@material/base":"12.0.0-canary.70beaf42d.0","@material/shape":"12.0.0-canary.70beaf42d.0","@material/theme":"12.0.0-canary.70beaf42d.0","@material/animation":"12.0.0-canary.70beaf42d.0","@material/elevation":"12.0.0-canary.70beaf42d.0","@material/typography":"12.0.0-canary.70beaf42d.0","@material/feature-targeting":"12.0.0-canary.70beaf42d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.70beaf42d.0_1619038219210_0.5771166660189466","host":"s3://npm-registry-packages"}},"12.0.0-canary.cad489689.0":{"name":"@material/tooltip","version":"12.0.0-canary.cad489689.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.cad489689.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9589e5f54d9fce3f36277d16c46575bd4933899","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.cad489689.0.tgz","fileCount":38,"integrity":"sha512-titQmjAtB/gNJc+Rgf5JwluumWtBAceGWmV9mVySL+dPocWiOwabQ+cGJWfU6/ps0y+DDWIDMIi73VI0ra45nQ==","signatures":[{"sig":"MEYCIQC9NdpBI3wDyBrXVw+EZ0SCxNxa4u6F2rGlgGDQRgOz1wIhAI05Jo40V1pJgqML4D6KYuY2p+1ljrcCCN43GTCrOTtN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":764505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggalOCRA9TVsSAnZWagAA5KcQAIitVH6tavmMqpZw+niz\nn0xPhx+8Kwt9i1WaO4z95HivjK6PK1xFgx4ZQpKQZyuGvrBrH3SUI8j+RA/i\njM2gYUgbkPkNjrDEsLzufMLWG8Q248vwsIGOFrQ+45XQhezupJ/lnEUELy6P\nbMOmDDU4CpNHctHK4f3PgWnkcEo8sHGxYDUtCDk64Ft3bSWdnk6f7bb4ZRhn\nttaBfCgAGlHWK+G4+iWMujOfMv2cCm0U3pkiYn9PFzYwJakXZTGgO5ErjCYZ\n5T/cI9gK520nO91bDqcE0oXOJmAdjGSsfuY/x3okzDjB5/pAGwcaoCTIfqq+\nSK1xCJHmuV8MZwH/ybB0XkU9QlrVVbH1c+mPNIvngIWY/jMRTF/OOoGBpDy8\nBKOuJ0SGhDRQ/0jlicpQzfuYPg1P4vy+VQHZzDDNE46KbVhAkVVbSG+sSfMr\nAg8Hwn9phx8x5faUTwzwobpqcxZs4zqIpEYssBImMO8mS+55ngVZDr8b4msk\nrGckYPfa8x9bQBFE/xKLqa7SxMDOqifxc3IeOeJQFicz9no1Dlh1NMXLS8bi\nPVJOpCII/yXC1xsemtzFybai9xfjK4VEdWmMZkzfDf74+NGc3/wPkv4SMtae\n+V8C1J8p2QNE13nx4yTZPRu7pDEHSF+CV6f1C6hCQvO+7BTn+kdxLLO05NzD\nXgo/\r\n=z20A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3e5c20e059b33965b63d0073bed7e300c57d5781","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.cad489689.0","@material/rtl":"12.0.0-canary.cad489689.0","@material/base":"12.0.0-canary.cad489689.0","@material/shape":"12.0.0-canary.cad489689.0","@material/theme":"12.0.0-canary.cad489689.0","@material/animation":"12.0.0-canary.cad489689.0","@material/elevation":"12.0.0-canary.cad489689.0","@material/typography":"12.0.0-canary.cad489689.0","@material/feature-targeting":"12.0.0-canary.cad489689.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.cad489689.0_1619110221858_0.4569335492565856","host":"s3://npm-registry-packages"}},"12.0.0-canary.d928692b5.0":{"name":"@material/tooltip","version":"12.0.0-canary.d928692b5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.d928692b5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7f5f36e9cdfc63a0b2fdb3844d3a65ec6d005348","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.d928692b5.0.tgz","fileCount":38,"integrity":"sha512-fru+4RJ2uNhf0FloALZf1z+xE7Joz7qRfXZzAcvAxL4RQMk+kiipLQ+m9Dd/Sb3niyVk8U7aemDaAsqTQPq4FQ==","signatures":[{"sig":"MEQCIHqRAQuzlMORbMephvs2pG4JWvyplV8scnbUVd9KagzWAiACKJrZtr+5bo1N41V9hXbUNid/Nc2yJH6g2dIUjpWvcw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":765180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggwVfCRA9TVsSAnZWagAAqYgP/1tHqcBjlRzx0RtADXfT\nxLBJlHYAYDRW3da+6vhHuhuZOcgHMC9/MLO9KWsX8EXmZvkxMEvVUhDz0LNh\nftVzJgEhARRwcADBKBL5Ul7FrJPY1ldZELLba6ST8BXJCWLZT0wGs+qhM303\nFdgcYP2jJc12c4OCsq+ydS51nSFkN1POUQXS5oioD5C4/UnN1dxWAz0y+jni\nD2EihbqOfZ3nVKMPEdY8HD8ljLXsycXJHy0wFmSvdo+rLMcx/5Hx+jZxE1dv\nOCMM2suKzO4hvhBg6MHMe5+HGPPs9UHAkviV+bwXTlcAETUL2zaVr35bd5AT\nosHTyv3nnEu/e2c7CW/opr1iDMI29BMJF2V8MLbXlfAXNEJjw1LkuNlrphYI\n5CGWAfI0YkgrJ6bcybnDNSPCsuhDhqMwgxR0KwrFeeGK6kJgras2mWrCSDyT\nPUK05WFigjjOYKXl2nL7ddgVSb4fFK2hOKAfsnx1Jx0EZbltCtinaJznabma\njT68NRlXiIkrNNvrGznkrvg89bMnbbe4S89y7aDf5hg0yCYkSkkPsx7dDxdN\n5XNLT8neItXQnCqiHkwXhfRIEToOiXzyHkDhefuevfBPCMFMSKMi2Tb7roj6\na7S9VuT7RHF5bzVP6QQND3+exiBuR2Tn6xPokeyYWPmyLYsQBilcszOSNqlt\nYMl1\r\n=hgbI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ced6a0237d36ed84c4d277fc25a11d9453108e12","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d928692b5.0","@material/rtl":"12.0.0-canary.d928692b5.0","@material/base":"12.0.0-canary.d928692b5.0","@material/shape":"12.0.0-canary.d928692b5.0","@material/theme":"12.0.0-canary.d928692b5.0","@material/animation":"12.0.0-canary.d928692b5.0","@material/elevation":"12.0.0-canary.d928692b5.0","@material/typography":"12.0.0-canary.d928692b5.0","@material/feature-targeting":"12.0.0-canary.d928692b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.d928692b5.0_1619199326486_0.6951842411036391","host":"s3://npm-registry-packages"}},"12.0.0-canary.8f68de8f3.0":{"name":"@material/tooltip","version":"12.0.0-canary.8f68de8f3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.8f68de8f3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1c8cfd28a88dabe03032a2e73e2e2cdd662245c8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.8f68de8f3.0.tgz","fileCount":38,"integrity":"sha512-KNSuOvQb01lvUrnJH5EAH+nmrjmB2GPZx+Cgyx28zhw0sQyNCCroS1u5F23rF0WOZwm/JynPwcMNt24wCr3s0w==","signatures":[{"sig":"MEUCIQCZX685la20/0zviffI1AS70JsEwQO7eLZrp0Kb/V2KhAIgHSauo6NDLXul845yVSJ9y6yaG4yOPKUYUWF+MN8G8+E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":765180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggw5wCRA9TVsSAnZWagAASNkQAIl6RFRfnn/xacsiI77+\nHLjrYGoWJ4qbCS1yAcAr4HTbhNC1NnmTRpwbBIhb5sDxunYPxEc+nBXpwcNP\nv1PI+ZQeVfWSBrOLXbmJacyZqyqTjIM/9MebIWLXF3G8ZzEBmGDMKljtlX4u\nI3sd/YNwtnEfUOkMpszlTABE6u2Ko8OQpYto1tAebVfFxP4Oprr62bWyxbOr\nl5MmOxVKgSaninreMiVOOJjlMVzBbILWzUc+KrIWHZR6sdFITUa7KbBtj3N8\nd2G+PWgL/Sbjd9t32Wusbs1uw5mBUlOoOqIifPRSRb5mt072/oymRdHxY4SK\n3axuK0bGSc8XLDy4Qo7t6CkJ1ttNuv3SRUo6QT4oArkR3M3YBvI8ZFsgrxp6\nZywt8H0tIxlARPhUVoVyOJjbARspvZDv38Zj402v/LfWQcwKtbkPvDmwIA8S\nyXSw0EjV2gyEMj6A+aLGqcd8pmJIKpD26E7YGFQ88MgvGI7Inv2ytGmV6G5A\nbNsUom+TACIWhufD22hz0Jg17L6yCUT149Irae4jxjxPl9Hx/ukI4Ze2Utfb\n4ZYAGCqKElB7jYsQ5WJvxSkgX/wGoyZ9Dg8G31UY+OSSYw/2BbXMNdsIQWJB\nykul+KKfdhRoydzoT3RTK8bqqbbLWjg25+Xg0c2Fs/vMOO1/U3W9gq3E7k1p\n0/6G\r\n=HEmV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5bf06e910f57a544c428d7559d72d5fc2a5f30e9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8f68de8f3.0","@material/rtl":"12.0.0-canary.8f68de8f3.0","@material/base":"12.0.0-canary.8f68de8f3.0","@material/shape":"12.0.0-canary.8f68de8f3.0","@material/theme":"12.0.0-canary.8f68de8f3.0","@material/animation":"12.0.0-canary.8f68de8f3.0","@material/elevation":"12.0.0-canary.8f68de8f3.0","@material/typography":"12.0.0-canary.8f68de8f3.0","@material/feature-targeting":"12.0.0-canary.8f68de8f3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.8f68de8f3.0_1619201648086_0.7985968875105183","host":"s3://npm-registry-packages"}},"12.0.0-canary.05753cf77.0":{"name":"@material/tooltip","version":"12.0.0-canary.05753cf77.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.05753cf77.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f9d947fd80ea49fa282d0b22a389c1772795be6f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.05753cf77.0.tgz","fileCount":38,"integrity":"sha512-fr+Xe/ioThyqwtSd/CHvAzOb6OrH4t+sDbcSKKb04vmXuPHvRH9wu+yfPzThOeh6/Tv4TU9ph1+dRSIHA6HYFA==","signatures":[{"sig":"MEUCID+nW5sT8FwMikYCh6kOmFRejDABl1EiaJM04ZI35BIGAiEA2typEztBprGVCBoPGixm7PGNpUNhoAmkVtlGS5C7AWU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":765180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgg1vBCRA9TVsSAnZWagAA5ZwP/0s5myb3XNxSwxNpstx3\nBKJzMiHpyVl2B0kgF5HvC1i2E9581QCW2LbMTU8E8CUdlwV2P9epFaBdgf53\nqi/ZY7KweosoqPx/tt/Qx0MHjhvs5HQrFE9oEuaqT/V2xsFGqmdtB2P58V85\nlxAuX3K5YrZN21mNJupWBBR251glqyJw3Occ9BcekmJZF5wY3KESWz1WNwPt\nefNYIkMs9+kjXXa9KIfT+VcXMFEqnWkZcLj/Yp33IrA1T8Z8NzhIrpN5hCf2\nFq1KJpBJwU62yGMV5DJF5NN4vgBrtXi4s7Q+xJMc4+askDujNkxl6TJmLjLW\nX9kONpFi20hoee1Wq37ELvx1SPaZyck0hBMhFWW5vENuwKFAZLkhbG44/8QZ\nqIZ7mFa5/sfXfbv8YFOsHYF15p8qSwC42wM4l1IQho2muEU01k/sie2lV1IY\nWCmf3I1cU5yHJE1rHAFLCg5/z4tkUcmjg6a88w0ve1HOFB2WcZmIXzlur+lW\nHvXh5NvZGCGXcxbJrhBiXo5DScJS3b6jlp6MqpzHarRaxfsHskoLBTK9sF/7\nQwFOqHi1BjdyhvkbQ6ezF3SQbfUyedkhSliswoG0B0g4VCM0DsUWji7s8JSP\nqYJtRec1Dd+xxSMGZcY/cBuTnHiE/HTHuIhzRjDPcJz2x6uD6+6+dws0y/bg\n8p/J\r\n=II7b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3557c74d7c4f9400f0a8d2c88bc2610c1d600199","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.05753cf77.0","@material/rtl":"12.0.0-canary.05753cf77.0","@material/base":"12.0.0-canary.05753cf77.0","@material/shape":"12.0.0-canary.05753cf77.0","@material/theme":"12.0.0-canary.05753cf77.0","@material/animation":"12.0.0-canary.05753cf77.0","@material/elevation":"12.0.0-canary.05753cf77.0","@material/typography":"12.0.0-canary.05753cf77.0","@material/feature-targeting":"12.0.0-canary.05753cf77.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.05753cf77.0_1619221441132_0.18324357359708854","host":"s3://npm-registry-packages"}},"12.0.0-canary.ef43e6d96.0":{"name":"@material/tooltip","version":"12.0.0-canary.ef43e6d96.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.ef43e6d96.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"16e44e0b491b159b86fea6b83fc2b1cc0665f598","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.ef43e6d96.0.tgz","fileCount":38,"integrity":"sha512-mhnm6mF6jAO16LQNVl5vigu2Yr2FcXKeLOx/z7Mhhk0SRiwKVfEqOb/9CjYNBDNkhfg/k3+zVCFQSTcy1/aGOA==","signatures":[{"sig":"MEUCIQCo/cPYO6Hy8UfgT17xU3pg8VPfCPt1ZiEtFFLofita1gIgZPyTzcbGcFNePgv/sTjTRDjhB39zhyuleG0Z+IPiKkk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":765180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgg10+CRA9TVsSAnZWagAA+SoP/1iq7cv4AXrGxPA4U0UL\n5FsB7WfOgdtTv0QYdUaJqpRYcopQOeu4rYf/LGC7Fw5/6J2ZTHsYBdAgyvSl\n0ETxrBPcGa5cA6mG48xbUji6JALt68QQ2uIbm/KTGmTrBLqpTNboOC5sLZ7P\nlZ/LwDB05ad0k1SuB/VVNuqCqdoCxPSrs651hJnztHdIpjBbCNpe9WCYSp+R\n9o5kkIkgwS6FnZFp8Cnz3i8mHq/tw7rIYiekQVt6vwXkJhQslofHq+1HhUZ4\nyeaEmnBzjSFA5fGhRabsza6nfWqhayjXYfwEQFSm63RDj4vJB9VOm5QCSbln\nHowuaeOYhIXq5bHuUlEPTCKHzkhAzW+Ewwk3XE5NyLs5WcUMSOE7aXUXmVJ9\nYzy7y6XuxyZDzcmAET4Gp9Q8IaZ98aGmA5kVaFjkqsLBmbkOehETI6nVKXak\nk8s8JN7I8kLLN0O+zpNTcAtGV9a2z7SRnHzmBuFQaeYsG+YvrCqZsQh+YfcR\nn3ygQFqzE9ear1tvQac1mEqEYf8zC+Zad2c60IE0dDpCCzXGSo2ARHE3Lnvv\nxMmQNPD0R7KRpp/I9PtZMbZ9Tm83K3uJHoK7oVZIYj1NKnOP1WHWCsCeTrhs\nVe7Bx0cUIUbepWQjuKi+PXQ3ocQdjlnadkiSKPDc8FkNuWjPvwuXZXBx0MvG\nrgjb\r\n=k1kl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bf61e37f943b49cb1c3287501ad6fc31f8c88687","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ef43e6d96.0","@material/rtl":"12.0.0-canary.ef43e6d96.0","@material/base":"12.0.0-canary.ef43e6d96.0","@material/shape":"12.0.0-canary.ef43e6d96.0","@material/theme":"12.0.0-canary.ef43e6d96.0","@material/animation":"12.0.0-canary.ef43e6d96.0","@material/elevation":"12.0.0-canary.ef43e6d96.0","@material/typography":"12.0.0-canary.ef43e6d96.0","@material/feature-targeting":"12.0.0-canary.ef43e6d96.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.ef43e6d96.0_1619221822073_0.9432339844061997","host":"s3://npm-registry-packages"}},"12.0.0-canary.197f64fa2.0":{"name":"@material/tooltip","version":"12.0.0-canary.197f64fa2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.197f64fa2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"41d22bda4a4a436c28538e7ba785db2138f6cbbb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.197f64fa2.0.tgz","fileCount":38,"integrity":"sha512-erYJpIuoi93QfnyvP76TTN3K2i3a9+Ffkqx0UvN6IPs7xzhGyEPcYLxfX571QlWEZjrjn5v8xADqMyjIdJUlbA==","signatures":[{"sig":"MEUCIQDP3BvlIVBq/bO2Itky9WGBx29GFBSVY9Eiw0TgagCgkgIgVAJfqb+J5rEMFPRoPos8qUTacIaXPS2n0tfJ78X4qzI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":765180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghvQaCRA9TVsSAnZWagAAHOgP/iAA32HvvYZRDRBtHXqC\nQVIzi3E9cxbNyTAmUi9YATkJGZ53T3QqI3Rao2MWVqdnJsiH/5VUGuQW74v9\nFUeZHcEcvdOE8Iox0mdKCUa064yrYr5glsO6JwIF1cyz513J3TxBXRC1j3+s\ngEvdSt7ug/qHi55eyDx5V6W6gUPXuBARIRZ/UMjUd/bOL6/HqGFbMIuXnL0T\nH+bgstA48ZxVLfb0BsY3iVu0ITQkvOHs+vaq70CqbWwePKMAoW/B/CkJ1om8\nvEulQRmflZXGYe3FsXF6ea6euNKb0DO8hV4g7dHzRsWVwfsNVl/vilBJ6ZeV\n0aRSSLKT3LmG4l1mEX6bZTqEUerElcQiqjgIUJDowZq0Pa+irnRp1IOmJXE+\nmkCwE7zVH37m2oBrJJn3k4p78cHHgrhEsv8LVZnuJ/OljhOheBi3eLM+FdqZ\nAu5Caw0/iW7uGJtOUaN4KePg1ii66npGlo7+ovz/84TcP1JXqHt27hu29+x6\nJvzkI90xXZ5ZTaACeDRP46dCKIdk7mz6WpCbfguhsexGncd1Smb0sErmbc+x\nSbnyEwBLA/jOenC5VJ4dkB6a8xGsf/3QikdpqZ8YPtlAqDZkx/kFCZ2tYyC4\n9D2ssPHUluQ8Hd3LAdN9NxiZQspI0KgES1AwwJF1Y4XidZfsHcvAUMv5d8xK\nFgbE\r\n=TFIG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8ddcd6186c353b0d99439cebca29eb95eebc705d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.197f64fa2.0","@material/rtl":"12.0.0-canary.197f64fa2.0","@material/base":"12.0.0-canary.197f64fa2.0","@material/shape":"12.0.0-canary.197f64fa2.0","@material/theme":"12.0.0-canary.197f64fa2.0","@material/animation":"12.0.0-canary.197f64fa2.0","@material/elevation":"12.0.0-canary.197f64fa2.0","@material/typography":"12.0.0-canary.197f64fa2.0","@material/feature-targeting":"12.0.0-canary.197f64fa2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.197f64fa2.0_1619457049611_0.8423042565176102","host":"s3://npm-registry-packages"}},"12.0.0-canary.55ad2d7d8.0":{"name":"@material/tooltip","version":"12.0.0-canary.55ad2d7d8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.55ad2d7d8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e252959fad731319722c1c8e581ff47bb6e00b6b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.55ad2d7d8.0.tgz","fileCount":38,"integrity":"sha512-xUlQmyjJnGMbQmMC5F9FRMXjIojCojYtWpLZwZ1dGnQ98QZW/YIWQuslLwFT9lqm4ly/QMHbZM5ADzvC/iYw8A==","signatures":[{"sig":"MEYCIQD9r3lTXwlhcBC2UNHc1/S3wrGUITBdyGf5QfIkEpKriwIhAP1QmVHSBJKbM+Mjq82LbQlddWAxe6Dk4vsR9nyTCp3O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":775830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh2bvCRA9TVsSAnZWagAAmnAQAJSKhYGgqECJ2vKrdSQH\ncm5iRtLpKr8/v8P1t0AUW2FT8LGaGJehE1ASVwAbW5CEW58zVt9xYPJzanMr\nRviqYZLIuecR1MmhQdWkmVbn34vs0yan4wnyBp4Pdtk3g2kUt4iajcDBMbld\n4OqVbN9Mf8aNtHVlC7eX8i8l9amcVGs1+8fGuXU55EQ7Iq1s14l4OINz0gXe\nKd5fezawMufVepBjBlP2xm00w4cBTW9jyu4z9YWabYpW7Oz28A94EPUoRY3T\nl0tRO3zsVur7hUXI5O65HpbOv4eHO9UGvZcM7oXpWH2DLSRcv3+c4ykppiaU\n85FfJjdGeBuAUfIXU5eP+zfjDvhCQW8PRUdStKFTmoIJ5gQzrBHxdlQjdsGe\n8DtGgPlqLylM8e0hsMKKVRpHiQoQX3uPlcVe1XvinLmNS2zBwIl+9tn3Wppi\nQEERC2oa8vSQxbCCv9AZ+Q3oPRT5BGHirJNiW1xn3LeXHiYCv4hhq0w9+8FF\nxVoZCDQm3YfTa2VTl9aNU3bsnJIwZeBFjoC3Ii5Zy/jgRhQb3Y1QizUMW0GL\n7kdf85YafgbyFpy+YqlIbHvuSiqY/0VyVmrppkcY3a6Eiv3psn7bByhJDm2z\npfRNBxgNKroa1CnrX3HrMrEjRFmDs/Kqb3A5F5BCPcTBEQ/Yuej4ojOkUae6\nHODc\r\n=w58H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ed8a5f8b1756d56e3973815a51d6fc7e51c366ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.55ad2d7d8.0","@material/rtl":"12.0.0-canary.55ad2d7d8.0","@material/base":"12.0.0-canary.55ad2d7d8.0","@material/shape":"12.0.0-canary.55ad2d7d8.0","@material/theme":"12.0.0-canary.55ad2d7d8.0","@material/animation":"12.0.0-canary.55ad2d7d8.0","@material/elevation":"12.0.0-canary.55ad2d7d8.0","@material/typography":"12.0.0-canary.55ad2d7d8.0","@material/feature-targeting":"12.0.0-canary.55ad2d7d8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.55ad2d7d8.0_1619486446909_0.08351417231019975","host":"s3://npm-registry-packages"}},"12.0.0-canary.ec4ac5234.0":{"name":"@material/tooltip","version":"12.0.0-canary.ec4ac5234.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.ec4ac5234.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2127257d3204ebaf89fce23df8e10b7ae58eb64","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.ec4ac5234.0.tgz","fileCount":38,"integrity":"sha512-4/AAdVDhOO3nO3HD3UhFy7Lq0SLe9TQGmIR2sOOlLCekYhWMMU37hQE6HDWHY0xO/JpBQSvLCeQ6P0zSUZ2s7g==","signatures":[{"sig":"MEQCIFEmPmJpIGzueW39HgHzrcrTpacDqLksN7IAHq4/GTzdAiAtPitSI72yqmt/72NQWJXNuUMOmdO+S9oI/mBssal1TQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh8RlCRA9TVsSAnZWagAAlRAP+weetPkMVXY9HLuUeV0g\ncQPUFxrPBr9PNoVH1I+TAKuNXcXbV1qKafwkINLoBWHYd5FcSZtvOj3Rfsjf\nGidj1qHKZuv3iq5HErn4IfD9zhh86mwdEcP/1JpUyH2aKXhQhUqEhNqDJgSs\n+4jtnicSIW2nzIf3s1P9hhmyasBIdfvMUDVlhfuwUZXyw/IQB6AZkAN5YX7C\ncIhY54a8PkX/1fSa9J45/hewxhnuoExDizjoQkAiyxBU5MKg2cf6EqIwvxoj\nES5Kx+BLFfcI3VJsi8wKcHITgv6aGYoiHyew0lcStC5o+XkZldAoXXQP2og9\n/bAbYkaH7GW0Y4BDnrJ4y1G5mOese+SQSaTuULOVR+CxqAzAsaybriRho22w\n/kMb+o40JGpGlGrcorD/F3j68+NuGgIET3Tbk71TLPo0JefmLSjIRUHUcsIh\nIdRBc+aMoYIP+yzfattuLV0ldnzgGrqaYro/wunQlJ2DIem2dyL5uyyhK+wg\nGsjPushV8WeeFp/0GAgpDlPdn2/O2uyYUqR5bWUgUVaxtB46GliVaaxQAktw\ntOfeEwFy+bVNvTJtR+dy5IL/fYpMZ12PjvvpQNZ0H1lukBilZrvPetbOmlrU\nzL88MjW57B3mNYXIJh+Ar/vFEQaR6WUy6Lh0dhJp8wX37fncBlmk9dowWrvL\n6ALv\r\n=aE3q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b189e0be8deb45b4e94790f21c377c3884f551b7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ec4ac5234.0","@material/rtl":"12.0.0-canary.ec4ac5234.0","@material/base":"12.0.0-canary.ec4ac5234.0","@material/shape":"12.0.0-canary.ec4ac5234.0","@material/theme":"12.0.0-canary.ec4ac5234.0","@material/animation":"12.0.0-canary.ec4ac5234.0","@material/elevation":"12.0.0-canary.ec4ac5234.0","@material/typography":"12.0.0-canary.ec4ac5234.0","@material/feature-targeting":"12.0.0-canary.ec4ac5234.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.ec4ac5234.0_1619510372819_0.6169014793679821","host":"s3://npm-registry-packages"}},"12.0.0-canary.b0579acdb.0":{"name":"@material/tooltip","version":"12.0.0-canary.b0579acdb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.b0579acdb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e46b4da5ba98a4cb6f0b0efea971823a40e941f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.b0579acdb.0.tgz","fileCount":38,"integrity":"sha512-Cr0S1JfW1uYFwfemPRCPRk/b9iuy9o3q+B2gWbqB7cxu+lcCc9eFC5LZ+9+oDHMKROasUOnaO0p7656ShCNgeA==","signatures":[{"sig":"MEYCIQDZY/ZmKpNUz3+KbsyZ8td7FpgH/fEJQ+gN2gsywK0dgAIhAMv86FU15DwFonFwTO2RG2jRCrsnPct4kL/2tb1CjCgM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgh81ECRA9TVsSAnZWagAA1WEQAI/TnJU66qbBb2HmBjlp\n8/2YrsopwuMxhsTYuHo6BcXlNHHc1K/OBmZCOh/alRsQcA9fPPk+edRgFHSD\ntJPtJTVuN03z9+S3B2J+NcqJD1gzU4/Sq09kr8Tlj+bFy9hd4XqUtoZH0YA8\nRFkqBuqYYKqUiR6xGPmY9p7qLqO41j04ZoxXzL6fsa2OFhihUuGPo3Pu/GQU\n53qxM4X0TRSfC0tvAURb0GSkJStVx8K0cs1aCy+bqyfHW/Eg90Bhfe6bc0ER\n6llr+7WGHbZrGosRsDU6L1OHXYnJ1vZIQ4qemChCkYRD8aG8/IhqxXseK76J\n/pAKjqn6QRshRyZorTOSh934GYpjiOu8szXqpYq774w0q44DfqI3VmYD4fvF\nznxjiHAhD1el5VB0hBIQcCaNW1trxmReGDNFM2KJtf6tHpfXZQputsX3Insh\nEBO8NFwyNLnsB1Xe6g03tTKrqFWG1oSj9VgKEsknVcA9WGKRJhKWpABtoyhs\nSlN7SfAoyZ3GvR9DHnqWh6esRM4y1S7Z5Czdd98MYAwbkvfox8CF3AOqtIGx\ncIivMFdQW99s2qSRX7t0apvJ1TMcBq9Ox4JNK0FMFRib6sPuPqwQaC/eRjUo\nSaLdQOnO6bDz/yX48ryleEoVs8vjZ0bEpdZbPzMWeix7xuoK6FMXPXBoW0N8\nkfMD\r\n=fRdv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d1f704610766e7d0c46b8a40beb1848121809a41","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b0579acdb.0","@material/rtl":"12.0.0-canary.b0579acdb.0","@material/base":"12.0.0-canary.b0579acdb.0","@material/shape":"12.0.0-canary.b0579acdb.0","@material/theme":"12.0.0-canary.b0579acdb.0","@material/animation":"12.0.0-canary.b0579acdb.0","@material/elevation":"12.0.0-canary.b0579acdb.0","@material/typography":"12.0.0-canary.b0579acdb.0","@material/feature-targeting":"12.0.0-canary.b0579acdb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.b0579acdb.0_1619512643810_0.2892354080947852","host":"s3://npm-registry-packages"}},"12.0.0-canary.81e2d4ff3.0":{"name":"@material/tooltip","version":"12.0.0-canary.81e2d4ff3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.81e2d4ff3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0f7f6f7c0650390966a5013c115d33ce9ab0c366","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.81e2d4ff3.0.tgz","fileCount":38,"integrity":"sha512-sH/purcC0XTIR13a6Q1H55KvoiUt2Ey8BWOtcYQ59virlR6B5qjWXn8cRPpfhf37zhZ0MWqORH0WgQEC3GVYuw==","signatures":[{"sig":"MEUCIBT0qsKZvlNUSQpKJAtr9Wq1stsyALi/HlNvc+x2C3PjAiEA5hHLV+rHVEbyYPwkWn5kC0BJORo01buz2ziOWPUVvxg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiHsICRA9TVsSAnZWagAAg9gP/2Oj/cqkNA79j0bpRz1S\nkTKV3715lMUzPRCpH9a8p4GId9fsCiC/VG2xPqlZTjc+NlLuQaJCocISQwNE\nU66qM5a2ApOZtmQFSkO2gzeCor+NLILiH5OQLWZFJH8KJyR0nEivPR7YEocP\naq46IRCKi8cNmTtgQ9Go0Shg/zJ8Em6/dYYM3i2S17uMZqjHcxQE9ZJsTvwj\nlqhbcaPpbbZV3f3jY0Tieev1gVBojGRwD64jnopUVri9rqp5E8FYx+xxbOuN\nzdgYjRsOSL4T6wl4kzJf1nmN+3N4hF2+lQEMV4aeD35Gg0j4j+4q9dL146HA\nwIEKnOwdpiSNLESmRvlIbcgkBKXEwX/hrqYhbH31qM+un4tVBUC2/8oEddh7\niy/HCCr0WvqZiShnrU0/gEpzdPTh6w8vFV9QggJVagWuBhidQwDNunkinokF\nuMOGv18JhDM6ttIo4ZU3sKM6jJr3enya6hVojCmlk3XFcvB3Mztr1lcL0LQG\nvQaZftn6PnJlNeqQJG8LuSaK/AGE1RESZUgw1fUUdF9XZEzdz1Bggc77gDhT\nkm56pz/yKmD/SedmLiPBW1VfX83kdKJJefWXhGZh6FKPXNbRWsFEP0JYmAj1\nAFq0aCR58s7V3XPZiv/hgXVlXJe2sw89zPt1RdndsecwAl8yFrUrySOU+ppB\nUmiQ\r\n=V2vl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f55512ab74610e3f3cd0db70822ad9b52b9cfefa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.81e2d4ff3.0","@material/rtl":"12.0.0-canary.81e2d4ff3.0","@material/base":"12.0.0-canary.81e2d4ff3.0","@material/shape":"12.0.0-canary.81e2d4ff3.0","@material/theme":"12.0.0-canary.81e2d4ff3.0","@material/animation":"12.0.0-canary.81e2d4ff3.0","@material/elevation":"12.0.0-canary.81e2d4ff3.0","@material/typography":"12.0.0-canary.81e2d4ff3.0","@material/feature-targeting":"12.0.0-canary.81e2d4ff3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.81e2d4ff3.0_1619557127812_0.07094276043412218","host":"s3://npm-registry-packages"}},"12.0.0-canary.c8edee52c.0":{"name":"@material/tooltip","version":"12.0.0-canary.c8edee52c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.c8edee52c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"37190ba049333d2011a2514fc803df567bf2e2c6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.c8edee52c.0.tgz","fileCount":38,"integrity":"sha512-yMcIUsVTcDXJN/y9rDYRoDrWJcKHUUVQloHp0V8OuTXkWaV9DoCbK8YDsl67RBmtEp7kiXDuuqgnwlcIE+G3VQ==","signatures":[{"sig":"MEQCIBd8jtWd1sBQPI6Nm7Lo4GYFpYLkg28uJVJpkcv9h0KUAiBpWh1wRzR/p3juoTeDkRXdB9PFhtF2Co+53AYNEq9OOA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":776608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiIZbCRA9TVsSAnZWagAAW0sP/0vOz0eF0DWhHCT4phk7\nSc9tV0vUSJsuNhltY4uTr65D9EpXQkEUkliS7vmMr296VmfUX588mTug+RUJ\n4uvYBJSGCojWCa/WyXNqfcoP87Daz7UUCs28PDget2Rx076BcsF5srdvLCs/\nqOixNBXT2TgoeCwpsB3rQP9PjIBpFIRwn7gb8u9cO+dJnEVQNyreZKt6vAQt\n9SPDvKwHL5UhChWilAVFrBMamVf6I2wV/qCgu8t/lrBfob0hlJPpRK9Mtjrk\nqO/P97qMglEQGnT4CSqvP5w6neFQL/m0IsrjC9SQOQ0yy0LkivrY/mFEBlFe\n+OoXIDxR8psarCaSimbYWnBllReChHnXO+jriaMYMOI+LajTknO1m0AW4RF1\nFAdOQG/w7Bj+37HJ/q4eJHGlQ9/qzieDYLTZipUXPd/oInHp3nNwQtwKaRYj\nIhTxrZYhOJvDla1ogtcOsptwhwl15Yf8wN+zWJmT+LnG2vHQVuYNdmPJgRdM\n6PFujanxo38lZmUYqFvOFKyTsoLr465IF+hi7DoIkoycjC1DqMJMoq/cOP3v\nu7wXDYjYpltDq263Req4GhAdcr5JtAeIghI1RIoukK1yI6W6truER0VIl+vf\n86IEm4LKdhqUq1Q8B16sunJBMVSPq9VJKcd6Z76cvCsvbhBI8EHOsoU7ytbD\ngDVN\r\n=vX7o\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e8c7902721c81225e1c8b750094cbe6ac4666a0a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c8edee52c.0","@material/rtl":"12.0.0-canary.c8edee52c.0","@material/base":"12.0.0-canary.c8edee52c.0","@material/shape":"12.0.0-canary.c8edee52c.0","@material/theme":"12.0.0-canary.c8edee52c.0","@material/animation":"12.0.0-canary.c8edee52c.0","@material/elevation":"12.0.0-canary.c8edee52c.0","@material/typography":"12.0.0-canary.c8edee52c.0","@material/feature-targeting":"12.0.0-canary.c8edee52c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.c8edee52c.0_1619560027160_0.23962955032105349","host":"s3://npm-registry-packages"}},"12.0.0-canary.f5b6110d6.0":{"name":"@material/tooltip","version":"12.0.0-canary.f5b6110d6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.f5b6110d6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"668589c3cd7d9ce9e6649f37990aed7a3cb21735","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.f5b6110d6.0.tgz","fileCount":38,"integrity":"sha512-jljcp2t2gvqnOtWX46ZJYt5PC5VhXqVx0Hl58TofOApL+NW7yFjNFFb17L1W/cNK0kpq8wTabPIozrh76Sb68A==","signatures":[{"sig":"MEUCIB7SFkTnoSf5JbQ/YU49ekYVXEEeU0jAMyUlZJhtvvaCAiEA6y9tJ7LCuw5lXj7858M6VeySrlCbhg5sFDwoV89jmgw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiItSCRA9TVsSAnZWagAA9fcQAIqMvn20GklcDXpP4Wvm\nRKr22bJ8Ngg3lspV8Ym98XeglnVL0PpL6zgSVJj8pfifVvUE5mESfnIjlvoP\n93Znu3uK+6NJ+NiGNPhJl4kVe5wYkr3D6Xx8j1h5siLL4oI7DRQqWCkGHn3u\ns0P3jpRXgURrNopvv+Rw0QjGu9qmfUNXcPE1EOWaGegIacFPTq/2sKYdq2S1\np47AFooG1VZQUmbBotVt7LC373zrgVWqVzWg8b5CAHQIbQ4a6t5w3Nleln7D\nMXNvbeALxSYrvt5LWfwgl4YwbleTSwV6ydnuWSWI1Ji1uCKQ7yTpw5BTJclT\nP4Bc39Q8agTecNQAIhL1ZZ5IT+8AziNL0oPjSL7FbGocPyvXjnMXEPNrm/kS\nyDGVVn4DBWyStnNo3sjXEybgvfZTQY6Uurb771ilEHxSaWXh+3XbVzGhHLWN\n9bj20RUUbLR0+oXHrScEPVNPMpOoB+8xKcm9iPxDCNiFoqPYnQFcO39YPRpG\nViYxSe6zDTNdzNzzNJfi/PawHzLJpS6Dy2hZWPPlloU/VwTJ8xqIBJCFF8xd\nVFXQtpHunUzVKHb5UC7kVwIstX5e3zBv1AudG0hoXkJd3aTtwBV4zDboClnF\nJblo659/XejsfBCyFSHK9tQ/jZmPuMi9Pd8rbzJvHMoFmVng+WFmUaiCRCds\nPuUI\r\n=kZ2e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c7be6486c9ad6826105a70187add5afee2a6b50a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f5b6110d6.0","@material/rtl":"12.0.0-canary.f5b6110d6.0","@material/base":"12.0.0-canary.f5b6110d6.0","@material/shape":"12.0.0-canary.f5b6110d6.0","@material/theme":"12.0.0-canary.f5b6110d6.0","@material/animation":"12.0.0-canary.f5b6110d6.0","@material/elevation":"12.0.0-canary.f5b6110d6.0","@material/typography":"12.0.0-canary.f5b6110d6.0","@material/feature-targeting":"12.0.0-canary.f5b6110d6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.f5b6110d6.0_1619561298523_0.3115471949573487","host":"s3://npm-registry-packages"}},"12.0.0-canary.cee9b9e22.0":{"name":"@material/tooltip","version":"12.0.0-canary.cee9b9e22.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.cee9b9e22.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ae81bb6fc2e9fb9948c795348d4fb9214fc9ce92","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.cee9b9e22.0.tgz","fileCount":38,"integrity":"sha512-PpUas541KhVWoorrkonTHAicnayT5xirsGo/utTQtNy8fR4xwx25hOKFyQvIcZd3jEHAzTfcRvcE0N0ozT8veA==","signatures":[{"sig":"MEUCICx7+FPrj/aR3dgz9nNEVeiY818SRe2HbCvYap8H7E7EAiEA6KtovC6DFEVMrtVWyAu/MJPpgXpIss7fZ5O/G1cBzYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiKjACRA9TVsSAnZWagAAUDgQAIdooPc91vtmKgpDkkS3\nAkvBhrKuDVxZCPRsR0bh9n9U/29A/Qa33nHMlLsXCmTBBHlN4sAMADFwSkjy\nymnPYDwGkEex277v8HnNNGM4nVoZeahWLUH3b3vjmutTI0mBx8s/8wPm4nqS\nYpeRemFY6wdBVQ+hRwa55meGHQdteFujYY57fcYkHe2ulm/XFMqV/DdZnmQY\nPrSvxongBIlzMW4eHv0BffDDa81eQfKHDzdjU4PvfCV37nc1JsvYLYMloLoJ\n/Inkr7w/yICJo/4IhDL0SlJDB27JTNHat+ktptl3dwReNbxvwdW+V2nWeXh9\nB+aEOF4Z7XoXweGVan7TQ8MGwRlNw3JetuveUUqncSa/SR6nmlfKmFhDsZOG\n3+hTaZhg8tR/DcbZWxicOgj2aC/stGVXET2upvNMH1ved8D92wjLd1OEqyeB\n7YPXOcPt9lxIuvJgPBIB46iROGI/PJbXwoLQ404ahHE0CZwzT7+iu09VxJ4b\nKCG21q1QKexjjfqTd5rYod7qTBdRuxB1z2oglkuR6p3ZmsZynb1RyF6ywdwd\nHI2R8BKc5qkBUUjo8PZRVDEcAMGmN094nn6l58KPW7jKF/zC9vKScqRp+ERm\nOrAAdPx+FHXRbEVveo/fHKM0LwFmW7Iy3F1efnDgr8/bxCNIAUI1RQyfa3Ox\nE08/\r\n=xG+c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b0c779970f0809be4565910c1abadeed4dab0377","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.cee9b9e22.0","@material/rtl":"12.0.0-canary.cee9b9e22.0","@material/base":"12.0.0-canary.cee9b9e22.0","@material/shape":"12.0.0-canary.cee9b9e22.0","@material/theme":"12.0.0-canary.cee9b9e22.0","@material/animation":"12.0.0-canary.cee9b9e22.0","@material/elevation":"12.0.0-canary.cee9b9e22.0","@material/typography":"12.0.0-canary.cee9b9e22.0","@material/feature-targeting":"12.0.0-canary.cee9b9e22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.cee9b9e22.0_1619568831640_0.0510152470424452","host":"s3://npm-registry-packages"}},"12.0.0-canary.96e83fca7.0":{"name":"@material/tooltip","version":"12.0.0-canary.96e83fca7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.96e83fca7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c1b20ceeba37bb917fe4027aea367aa545f95c8f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.96e83fca7.0.tgz","fileCount":38,"integrity":"sha512-wRCd2J1Hqi9y7rSTU/J7Bb8rBTx+qNC94FXLg5rTGmMHtGuTpJFGvrFJ1IsL8QwdzoAsxpu+qCvUDbcKkY26cA==","signatures":[{"sig":"MEUCIQDtXHaO6CrdJzeGzNvfpOuVjRZ0mLxbEoQohGmozcYQ3QIgdQcEXZ5CTF9SSRPx1P9sZfofwn4FBmXoH5hUi4920Kw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiM0TCRA9TVsSAnZWagAA8NgQAKT4kgtjTur0G0mkOAbO\nvaWcaoUiGySLYzrsnZtS/IqR2Xvr8ACczC+9ndEaevdyyZy/l0TxPRajUtd9\nabkm3E53jHMfd/u928X4An+7h3wvuMLRj86I219FhgfIomXvuM6yheR1mR6u\nuG9ve7zm5NLYl4RBjdiWUzsW9J3ak33Vaq4eIwmX8LX9LjLeI1PZY09fZ2/p\nGdjBvJX5o/YT6sz7+8wlevNenIazaQ+DNrJGGM/ZlHh/AqVqRdveWZ3lsOFb\nwxK1KNVFKA3VnW0NBXlT6eEdQNSA8IZ8gKcqynwixhkhPquTBxFUTqvejYxP\nBqULJJbldG6DWP7GPkPEZtYwHrMlDWJAe0j1JuT1q3Q8nNf3UnpttHBpjPgi\n+NudKiR8UQe6g3k+T3eK5FeQYcwpGKAHefSDL60JUBvY6cMihrol7PomNCRn\nKwwiV3wB1OpNAXFHImxy2jCDHwAsHDVC5bCbchAmIciTq01jXhPdFEv3kEe8\nkG5h8gRuzc3qU89bJ7b0X58EqQubjJswHB4aBEQzLrQMvrcggMJanlLVhkB6\nWnqn+wMrIat2taKecbs+wdPAGg68rFAXImX4NS+h4xwa1cSu4wBNPUuOGgm2\nGbaznOHSBa7uexyFCHlIcjEXbt4RsRu1MaIKMZ9V7nzWwQGe7AZS34uR+9nD\n8mIy\r\n=KSsq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"377f0025088676d544c1393884e5f27e96143f16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.96e83fca7.0","@material/rtl":"12.0.0-canary.96e83fca7.0","@material/base":"12.0.0-canary.96e83fca7.0","@material/shape":"12.0.0-canary.96e83fca7.0","@material/theme":"12.0.0-canary.96e83fca7.0","@material/animation":"12.0.0-canary.96e83fca7.0","@material/elevation":"12.0.0-canary.96e83fca7.0","@material/typography":"12.0.0-canary.96e83fca7.0","@material/feature-targeting":"12.0.0-canary.96e83fca7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.96e83fca7.0_1619578131221_0.9879364086451059","host":"s3://npm-registry-packages"}},"12.0.0-canary.4c497bd19.0":{"name":"@material/tooltip","version":"12.0.0-canary.4c497bd19.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.4c497bd19.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"47920e36b61c15825fe760051b73ad419673271d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.4c497bd19.0.tgz","fileCount":38,"integrity":"sha512-Sb9y3KQPcLNE2NZZYi6MlpuFgY3laTqsqfPRaSrSpaQloUaTvKMTr37pXKIRanO0ni9v7ERTJJ1YbvVya5U1OA==","signatures":[{"sig":"MEYCIQC52yvO3qWCrY5N+9FnKKJnOLXqQtXQC9AGMvC/Ngmh6AIhALLjy8AWCCYlAINIkx/gLE1P095rqjztNTF5iqOsA6fZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiaFdCRA9TVsSAnZWagAAMkUP/AxpvfqIHOl2k3Td7Hjj\nvIsfheAY7ZVa/FU7Uglv0wPjo1xvoiSuGVVlhnn4AJ4LS2m8BST+t6n+BJh0\nlp6AcDcvB5TywPKcGy37bzi3NcS6hraMmWLIngTifqXKiIYOeE2+wjQhP9C4\nHp7wfZua7bLPcjqJyJ8+Yp+QbO4g4TF5aFPIq9yb2ej6godr+HAdJIZ8+LHy\nDPLck91Le2a+mVYY0DEp+HNZOyTAH54s0bGJId/qSqBto8PO9ooD6ri350m1\n2c2aWygqxIrsqZQH1tYl8jFix2ve7+Re2swA4mEBLZ4Tj4qmnoh6us4E+zOL\nOd9+WqNEt8dK+JVN4KoKejsDfrQnsXRARRswrH8NttUtJfBBNs5boqFIB6rt\n2hnAFMxAtq1j0G6kRZJGs2VlMMT6iN1c8kA2ForO/OEJyxK+J8Y/2J7Xl1IJ\nC+4qGT68EL8k9BjZ67R+dzTmz/aeisDYIslmkXyMqTzzDRnKJimgiW/ROFBh\nZVFfXRqlws/eTqZwzZ8aIIF15VKY6ueLzcBY5gTRPLZkmgQcu1CvSXSea/10\n3z60pycSuSVjXA62BElKBYOYyq7StAaXHLR2g6p6TUWa24VOKE1Gqbb97yL3\n4sGw8GdR6CgQatqlsp/0eeVXisiMFVZVQ3SAWp8jGJA2W/1Y/GJp0pJrmAvn\nyRiS\r\n=SFlC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"beb4a14c8f43815a21024c26a96e3c53851a9b41","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4c497bd19.0","@material/rtl":"12.0.0-canary.4c497bd19.0","@material/base":"12.0.0-canary.4c497bd19.0","@material/shape":"12.0.0-canary.4c497bd19.0","@material/theme":"12.0.0-canary.4c497bd19.0","@material/animation":"12.0.0-canary.4c497bd19.0","@material/elevation":"12.0.0-canary.4c497bd19.0","@material/typography":"12.0.0-canary.4c497bd19.0","@material/feature-targeting":"12.0.0-canary.4c497bd19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.4c497bd19.0_1619632477412_0.9477891669621714","host":"s3://npm-registry-packages"}},"12.0.0-canary.105b15b96.0":{"name":"@material/tooltip","version":"12.0.0-canary.105b15b96.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.105b15b96.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1b6358f7e323247ecf1917f77c429370f9ac8c96","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.105b15b96.0.tgz","fileCount":38,"integrity":"sha512-dwxEhLw99Cpne1e2RTjeOLtnp0LupWkl1j6RipEAUb3AJVuxN1MqwdPCGeoIbU4IbYu+kjsvOVNuxnn3gfHdqA==","signatures":[{"sig":"MEQCIFtOwgz8KiBmCoAnxnhGrCBl+P4E1yIBHqs3nW4puGzDAiBN47AG+RxNRPDMyOL0ocbZNCghc661jfz9BshqNWV1iw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgideKCRA9TVsSAnZWagAA1KoP/iJyr/tSSYkUc9F5tc36\nX7Hfl3snSi3MVkFw4qOjJHR2q7Zh+s3v9nN6iExFxpmjYbRO6O9uNcDXiF+G\nu5/kxvsi+WmkKnsIMYSHb9EIBKQ7A6EeslcjAVJgKa2B7j7ftgUNvbDJgqi6\nQYumfPacYedqpOt4KuosP/2rKUOd2WrG6wrVq4IOeR7Q9SkAP3mhEjCYwD89\nhHr3qbqX8GRr+6zzwGVkHg0WJ9QXdlfnBOGBA/tz1/uZMfSQv+R6eVx0scBq\n5L/FpwRFrV8YRIJqpgApZN1nAsXyUcPCBF/RdRL/GGLtqwNupNJnPKQYpz4d\ndyhI3zN2IZR9i/00QQeOn8WCiN8uYTl9LZU8ITn0GzfOHd9o4jqXERHd/5Ac\nCWWnOZ18TKKy5wAiQvQlL4Jg+KtMnZQMkbSfBoupPTtMLtnUYBU9SyJcb4uB\nQIi70ZwdRDmRYsl9iMiaVe7m4bWCc6VxUfT9xS3uB80LhoET2qx5JmFM2IfE\ngcqT/EPsSDoVgAusFcKdf1s36v4Vvy0MqQfGyodQ5RZ1cIuXYm3GTt7Nry9v\nU9Kg97oHXtKsdK/oU/r1dw+MoUhi7XRuFb7Xr26a/lSf4oBkr4+2BMsmXxtd\nREXCxpzzQaWRFCa4MnJHu9w9R1J41mI2P+0PVBwrh+pV9JddkvV7sDfzl2Lv\nC1Bm\r\n=6mts\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"762e9351a26c1968c772104d6d64f7874c81528b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.105b15b96.0","@material/rtl":"12.0.0-canary.105b15b96.0","@material/base":"12.0.0-canary.105b15b96.0","@material/shape":"12.0.0-canary.105b15b96.0","@material/theme":"12.0.0-canary.105b15b96.0","@material/animation":"12.0.0-canary.105b15b96.0","@material/elevation":"12.0.0-canary.105b15b96.0","@material/typography":"12.0.0-canary.105b15b96.0","@material/feature-targeting":"12.0.0-canary.105b15b96.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.105b15b96.0_1619646346027_0.9115317416873603","host":"s3://npm-registry-packages"}},"12.0.0-canary.6e20259e3.0":{"name":"@material/tooltip","version":"12.0.0-canary.6e20259e3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.6e20259e3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f87e0c09d768612fe739189c425dfe93fa979c1f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.6e20259e3.0.tgz","fileCount":38,"integrity":"sha512-WAkm1Ycu+36Twlp8RDe8m2VyX5agJUhV+HKxtDQpfCUO/40A2tu5aVVBpdSEVcoeIhMZU/DhbKaqmYIvLR0S4g==","signatures":[{"sig":"MEYCIQCH+8DdrICxyV/+1JWs3/B0CqcCtQQI5yF/p32EUJhiDAIhALM3h/qUjB57XjMzDMidTFmhPzsGsLsdXNpHSzo3WmFM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgidiTCRA9TVsSAnZWagAAqCUP/02UhPfs/ANees/03eN5\nrOGjTVqAVVON3aQ8Lxj1YI1W177pYz0Up3hsHnq0qosz4qajGyQ60FTyNnk1\nrFleFd0rJXvAjZz392YFnEqR72yvZEKA+ToVL9bIqiCytLFrO5pl0fDL9eTs\nMKK/sAMxWdUkTfpG0CWFXEUhuFINYBPLK3omJC75RyG+vAsBXYzOfN8hRCaj\nYHsu/swzO6qSqDhjm3j/E1GiBpiQx4nNKCeE9QvElItQ48H2Nfj5usyIlOfD\nvIPrnJeCa4Mu1XscAuSUbs1BqX0A4cSf3A5DjHTenMvYudz182VSnAZspG3d\nDClrHAw3rroyJGX0ScHMLJH2ZQ/E4mBuRqcmJugzUaLlafJK/kIdJuBh7BIG\nOoHHdIByDh3yBRPNle9JmzxtopnZMIF1BCuJa+w+khEhbZj6zdtqR685HDSz\n+M90ocw1s+puO75sj9kXl/G3/FCMJfVedEYvYa5goxx7ZziZNOg6vAuOLLj8\nF1y5WCU3q+3/XdyDH/JRxFNvUayeBRgLsz3AgoFQ8tdIDOcSIFKMWh/YB7V2\nS58GhWIyqJZwH+Kv0qjytWEMOI5GodI/qEViGKkmt/xLW2RDcvE6hfl0YypL\nnSL6nhFfJJJVw1GJU7O6VTaBx/neIBiPsHeLrszTau92sgnz/eOIr4oX3W9x\nPdER\r\n=Zws6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"8e07864b42f463f977fbd0f9264b8930da72711f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.6e20259e3.0","@material/rtl":"12.0.0-canary.6e20259e3.0","@material/base":"12.0.0-canary.6e20259e3.0","@material/shape":"12.0.0-canary.6e20259e3.0","@material/theme":"12.0.0-canary.6e20259e3.0","@material/animation":"12.0.0-canary.6e20259e3.0","@material/elevation":"12.0.0-canary.6e20259e3.0","@material/typography":"12.0.0-canary.6e20259e3.0","@material/feature-targeting":"12.0.0-canary.6e20259e3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.6e20259e3.0_1619646611431_0.3637021367703259","host":"s3://npm-registry-packages"}},"12.0.0-canary.0f79a5d74.0":{"name":"@material/tooltip","version":"12.0.0-canary.0f79a5d74.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.0f79a5d74.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ab259e8459c902b362bb0e15b07233ce90abd35b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.0f79a5d74.0.tgz","fileCount":38,"integrity":"sha512-Ux+Fs6YhYRc+ZszhCZ8N675oOp5HqvLhMepD5fWwtY1CMpIo+y11vJoloVtQXqoYi9PBTzUR1Lv/w9S5REN8sQ==","signatures":[{"sig":"MEUCIDaDxzqkNzRAid+EnbHpyizcw4PLGxOVRcH+QHkUSYCmAiEA28b62MCEwqqs0U6Q+yl7YMr+OBAfU1sARIgmEtUelh0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgieUwCRA9TVsSAnZWagAAF5EP/2vEFvrSfb3VFBHmwD5i\nZ2BsB4xiCOKEV/lhOHDyZFO1wrBIdIZD39VrLwRxS2lCrLBWlbgqBkpw6KvF\nEL91GTsgMUEpp9DFf/2v2JV4L4kBh8HwkDAP+qOgbT1jMQnjMeLepOxk7uhI\nP5hm/Ea78JlESKvad06TI38eM+0yoVdlu6EUQ7HSEHSve/VySX7+QFnOGT+o\nKf2sGqMb3i4yTEpoRMmhYIjeJNZ9Jb9mHCTXyba1N+T0MYjw5xl3airn0mts\n4oHueupRByLpB13qnrSZiVWeBbje1B0Tc871+56lRXBVkY7x+8Un6xN6VRXk\nestEsTz75UHZWpuIOGP+w95/sLSc1aM9BjeVlrhcoABaFJdAoKdlM4e2OVNW\n1U+fyQvSQUtaPZ7MwZuwC2KSWpepa+zOpZM8G+sotp2ypVeyP+1jy5r2FDSO\nhg3LMFRIx1AHqPUp5i776ppa7GCRZ9RlqDyMKSrjXL7JAQfeGIE+We3L/p2w\nBte3kJeyEuwFhP9fjVhVr9AXcaBQFeEpWajCmXaeWBJz3i+Hs9izm5EkjoRi\n0Ou2qlLYNstj7+bsXiFulYP+hbYVRSx397IR51VvKVLUJYYar8GegggpNsWc\nxoPffX679PjismxC2hf1mJvunH9W6dsfeaDkMPybzarKnpgkHXRaH5jD4paj\nOJ3v\r\n=HEmQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2fcb990c07fcc62dc025eb258f87a8f04f08fee5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.0f79a5d74.0","@material/rtl":"12.0.0-canary.0f79a5d74.0","@material/base":"12.0.0-canary.0f79a5d74.0","@material/shape":"12.0.0-canary.0f79a5d74.0","@material/theme":"12.0.0-canary.0f79a5d74.0","@material/animation":"12.0.0-canary.0f79a5d74.0","@material/elevation":"12.0.0-canary.0f79a5d74.0","@material/typography":"12.0.0-canary.0f79a5d74.0","@material/feature-targeting":"12.0.0-canary.0f79a5d74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.0f79a5d74.0_1619649839878_0.526971478175049","host":"s3://npm-registry-packages"}},"12.0.0-canary.84f3db9ed.0":{"name":"@material/tooltip","version":"12.0.0-canary.84f3db9ed.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.84f3db9ed.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3aa574de10adf2542ae21803a865f76451b8badd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.84f3db9ed.0.tgz","fileCount":38,"integrity":"sha512-T7D6UROzc9kvnaOR+k7+ectTNJYe3QOxczJN9EmdoDiMmg6yFmfMPga9ayzbFGcF5CKdjYpAOBWq3AtCjSmj8Q==","signatures":[{"sig":"MEUCIQDwe/ZAXDthxJ23qWH3TV5rthu99NgBoiZbTG6/JFyrfwIgaBjFaqB0pj92Yc217HlbihRJ+Zc00ufGqW1/d57wS8A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgisBVCRA9TVsSAnZWagAA0mUP/RBE+8NrF5c2egDS444L\nouX/Naw8EypTjWUFDCjUy5x8y4NkAlqublI3v1O8zlXBE836DQocT6Xqb2rf\n8h+3SK02Tkh/dXLzLwA3OWEDRk8AHMJ4gZoNWqZqZu9dLwphjpqFsaVUXgkL\napnT4nTyUedTtEhrY7QG7bQdFQ4Mmd0tO4B6mOzOKTllVW1UwW4i31TvKHK7\np24oueOXYnn7JgL8+gr8zemrHdBW1fceihuvEPTIosREqkbXI3cWkqYe3mwE\nH3XxwhUPH0W4apcLly3c3HKnMDU7ePQqYhSuYs0zX9o0O4KeI4gPrXR15WRT\nw7LXi7Ea0MUErCOsQD4PBE9RksDV7COnKQiRK9rRKmu23bqdQs2vcqJ9vDEg\na9KttqVqmI3jpkDNgfdzKClOkAsl9JQMCAaqspizaosb1IVniPHrdgcuAFY/\n0XVEmIswPSUWSjy1mihojBCCHmgpVo/hiy7TwM+cK5BvoErE73AMp6I0Y+Qj\nHAtvfOiw0/MLm0maUXf/vzv26/1U0RV0mY5CtisILPlbiOdgTzcGtweg6sc/\nha69fSlMwP6ofvinhOkEYvIZruJjVpYBmssTEgaAbEpOhZgtZObYk2Eh5WWj\nwL34Dgej8LOf0/rnXxgzX5tXMOijrHIOawZLMXAR9cxsKNrLWv6L2kOBkwkM\nULjl\r\n=Ed6U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7c4b7e41edc7737412479194451432cfd33839b4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.84f3db9ed.0","@material/rtl":"12.0.0-canary.84f3db9ed.0","@material/base":"12.0.0-canary.84f3db9ed.0","@material/shape":"12.0.0-canary.84f3db9ed.0","@material/theme":"12.0.0-canary.84f3db9ed.0","@material/animation":"12.0.0-canary.84f3db9ed.0","@material/elevation":"12.0.0-canary.84f3db9ed.0","@material/typography":"12.0.0-canary.84f3db9ed.0","@material/feature-targeting":"12.0.0-canary.84f3db9ed.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.84f3db9ed.0_1619705941219_0.24263179506504695","host":"s3://npm-registry-packages"}},"12.0.0-canary.8fc29273c.0":{"name":"@material/tooltip","version":"12.0.0-canary.8fc29273c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.8fc29273c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ed4996600087086c1bca3eeaffe042d76bb674c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.8fc29273c.0.tgz","fileCount":38,"integrity":"sha512-s12JxGePJcR+bSCH1ATyyvpbA+VQX8L5IaZEGaqLr3x3J4qaK/vwEYSe4Qlu2qToiTnbXaL36+/AWelIpHBChw==","signatures":[{"sig":"MEYCIQD5Y92/14waxwElsUFEzWYDtfzVRVlAVqMoL9mpRh52BAIhAOF7jMGub9giMeAEJT2kF9axjRqUKCZBSaGpiLTz1cKf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiyQbCRA9TVsSAnZWagAAQj4P/0XBpeBaHTZELQnrfk3U\n0Pj2FsBN/R1e6EK3C8cgnmOiU4ZCxsuPIuFXAjll1n/NXithHSECkPNVrq6x\nOxIfijJWO9oM9Wd6G/LRYBPXhVc0B5LAw61rchSV2pTste9E4vOMIjxRG7oh\nDhzXQd7S+HDo+fuc6YD/VO+YajfExWcwzyWC11XjFzlpmwrYQeKBQpppmGUS\nT961ITuNYBYlKHayshBwSPU2fsnblcPYqxi0tFTsTm01RLIJ0zCwgiDaZocE\nqUusCsAw8OJs+xrci4yl4eO+mdP2z/fifcvRZnmD86QUN3+XSmzKjUYqb3pz\n+366X4WmSpuAl8wQBYUMUYojrlxeuzgfWUXDTvGsXr7FH9ScUr1BcuRTUrWa\nssRA7nzYyWXRzP+9xj3Q5M1eFYeyzF8FU9O7eNF+1xLWgX50TwGlx2SXhXep\nl6GEFM42CdgInJ/plyxle7Dsrg2Zku3L3A1OFcbYjxhhu/7ef6HnTx5/nwLj\ntv3ROQQLU1e5r39a9IABMXP7WaAIf5+iwVad055rxmAy1ogpJ5oImmpHvw/2\nK9nDN9K1tuwC9VBYr/pxhaZgNJSa0AGARS1TKF3NECs4GMmrb4q24tovxZQD\nqD4XDVyVaxRLBp2j2wVkUMBXCP3BqSrYlNWn0gE6pWA1oOM8xDiNOXNgHbLt\niPLb\r\n=F6dA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fd877c3e50788fb95663fb8213bcd66f347cdd0e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8fc29273c.0","@material/rtl":"12.0.0-canary.8fc29273c.0","@material/base":"12.0.0-canary.8fc29273c.0","@material/shape":"12.0.0-canary.8fc29273c.0","@material/theme":"12.0.0-canary.8fc29273c.0","@material/animation":"12.0.0-canary.8fc29273c.0","@material/elevation":"12.0.0-canary.8fc29273c.0","@material/typography":"12.0.0-canary.8fc29273c.0","@material/feature-targeting":"12.0.0-canary.8fc29273c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.8fc29273c.0_1619731483469_0.6202620904219731","host":"s3://npm-registry-packages"}},"12.0.0-canary.c50d20bab.0":{"name":"@material/tooltip","version":"12.0.0-canary.c50d20bab.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.c50d20bab.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"07c0514f8a0666bcc1f7324091a3c58fd6ea4b7e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.c50d20bab.0.tgz","fileCount":38,"integrity":"sha512-CPx9MaKoDikqWkhNW9ggzJTu/IessGazYILwfKlJuAr2lPtX847VSNV70ldw51Yjpnfm8Jk9AfYtWtpJjsgPaQ==","signatures":[{"sig":"MEYCIQCT08IxjlXGHrGpuFmj/rrAlJYqMwlLX71lHZbR3XgXUAIhAPgo0cVu3jH1rMsjWgYM+Rf2C6/o1GYgfQVHyBAPnfp8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgizseCRA9TVsSAnZWagAAVn4P/RazYvuMoc8CDjnQTquD\nytwKpRROVpWnLWycoBodCbhJuyHzdl6pW2/eZox9sddJ+UHXmLPfrlLfMA7K\nh+ZDmDSw05FG2oXXW/yEQv0e699pDELpHMsMk/nYxHSqQgNvMA+YI0ilwFjx\n86zoiR5PTMPCANwzggUmzxYlCfKbgXs+atxrWcnCR48ggleHNlulnTbrXG4E\nNlZxguiTum6inW4AjCSRdxZOtpWoqRYs3m10ZIiJD69sa+w1aAzje4kyTJq8\nx5ggiVhAsOTEeq9YopqVHtqZaTiyj/m7D4sHbrO2QCWKHUaOTKkKRg9z9iFn\nANbVAUb4dtH6Q3VWMZDDkCA+Xd1dciZ0aVSsEwi/kMeiZKxhLwnYehjH7ETt\n8zGY2Te1Bk2gllEUtv+PKn1QKK/+ZWBY0rll2SwEeH++Qe+G6euPnioOFjH9\nLr3qmZQZ/f91NdY8d6k7nEE9mazURCye5itx5fAdm7wOiJLrp1HvHq/Fohrr\no3fXupY87Ls1uEdgQYkSKPDrKjiLe8eeQ0r8dIbHvXTN35n9MzZ4aVhl1R5H\n+xI/JucsPGoPpNByJuRbT/N+S2N15g86yFy8rCmyWEsw9kONV+hkNfiCXHgz\n5yn5FWFVbq6DGi7jUNPu5KMtbFfJyX6pflDJHNk2YwOVh1pPBg4Sg1/sSynw\nQzbM\r\n=UdNc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2aee1fe5eaed5267b0e67f1610c29dd399d323c1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c50d20bab.0","@material/rtl":"12.0.0-canary.c50d20bab.0","@material/base":"12.0.0-canary.c50d20bab.0","@material/shape":"12.0.0-canary.c50d20bab.0","@material/theme":"12.0.0-canary.c50d20bab.0","@material/animation":"12.0.0-canary.c50d20bab.0","@material/elevation":"12.0.0-canary.c50d20bab.0","@material/typography":"12.0.0-canary.c50d20bab.0","@material/feature-targeting":"12.0.0-canary.c50d20bab.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.c50d20bab.0_1619737373783_0.38412636816426216","host":"s3://npm-registry-packages"}},"12.0.0-canary.474836ad0.0":{"name":"@material/tooltip","version":"12.0.0-canary.474836ad0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.474836ad0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3d644e9c8e82e110508f4ee17b76689c746bb2a6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.474836ad0.0.tgz","fileCount":38,"integrity":"sha512-fRqRQDwjcU7qinifqCWFCRTY2+OLTWht2LqDTSno/qtRpFB7lGgb/bHaSFZlf/vLnIgFK/koPvAb8NItekl3mw==","signatures":[{"sig":"MEUCIQDLn/Xy0GrJ0LRcuJ8zUq5ndd9iYTGkPtUBtkQQJvAkywIgeanMDxPV9ecG+nHq1BrwxHXJurokxfEvR1JHEfC0ras=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjM1ACRA9TVsSAnZWagAAh5sP/0qHw/kxq6hB/8cfQd33\nrfz+rgbQBpNTkKsJjvVhvCqR8cHv8Y6TtgAYltumF2X24Bz5zbBa0blHeMRm\nr7CZ1PzKGGntPMs/Vewr9REPgHs/NA8L81V9KFSGc8rhsNuFjxLODpoK1zTB\naL6ueG+y8RPrRvF2yWkMAVGm3JVx/jVb+7HJAKTq0I/9zi11MR1XZ45y7qkn\na3GF2/YW26gIOZICHBsgweq4i/JtIg4hZtOl/NVmJMoYd3LQ5sXG+nz3MBVx\n9YJsUVFBLVWK1kDKhNekOZ9l+jKdEJq7b5pbO5iSNpLD+6GeNw3Ubhgk6xM3\nh2G1Y2cHZpildeEPiRmEuIrHsZDVBplwPACMzz6UDq/Q61MmlVhaDK7VkIKg\nAtGPWX0/Mk0w2bSKipWe7BjueCaKoApaRIUoAzs1Jm1Zhs7rSZj7iVHSNeGM\ntumAvAsTGMu6zZ0GKCBvB7RRU56M9f9xHviKyTtIBd3qyq+sPkABV1DQOr2M\nTbH//ULaDkL5gDROq4RMcUSAmCKNt5zWvXOHDvS89NuUfoR3AgvXQ9m39GuO\n9Wq8RVW2k8Rz83SeQnkwQY832T5GcQUFHk1lrm5nojX97LyFzx7LvzbuFspZ\nymUYRp2AvTJaPLy7614q/TnJdKvezL0AOrR2FD/ucnfUj2D+P1pgDbmes+2B\nqPz7\r\n=DI7f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c9a6db3013566afb165bda88b05607f2ee398718","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.474836ad0.0","@material/rtl":"12.0.0-canary.474836ad0.0","@material/base":"12.0.0-canary.474836ad0.0","@material/shape":"12.0.0-canary.474836ad0.0","@material/theme":"12.0.0-canary.474836ad0.0","@material/animation":"12.0.0-canary.474836ad0.0","@material/elevation":"12.0.0-canary.474836ad0.0","@material/typography":"12.0.0-canary.474836ad0.0","@material/feature-targeting":"12.0.0-canary.474836ad0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.474836ad0.0_1619840319568_0.5546302120822295","host":"s3://npm-registry-packages"}},"12.0.0-canary.f5ad92287.0":{"name":"@material/tooltip","version":"12.0.0-canary.f5ad92287.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.f5ad92287.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"54b75a33701f5191217173df8f00d0acc259f5a9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.f5ad92287.0.tgz","fileCount":38,"integrity":"sha512-J/CyBmbvNf1aWDBFNWsvDvTH4xqjqaawG9BrLbZwUA8TYNszbLMVYyg15OzI/PEypw98QO3Olb0201vbNj8XKQ==","signatures":[{"sig":"MEUCIFLI87skR4A99ngHkjMtRTBWixhBME+4JObKJ6eZvz66AiEAwHczTH2uVG7k6bESoMbEWN0z/G5ynXqTe5kp1HWX4BI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkD+UCRA9TVsSAnZWagAAvQEP/jdjprkObc54x6VenioU\ndSlmkNDhRhaY7TfHfFvl2Jw7k1T5R4D461XJU0LDZ8Yh4mDtYxxpHe9hpOfP\npC9ZBJFcvEaJYyRfINUMXLSCU4zumkIf8pLMX6Sk1ZY1f25mRuaCeUZGiZIb\nBqrPnD3ktNLNXwU6Ftt9o3ehGLBQsT8WWKwUg9KtuJD7yhKKi8+745LMG3+y\np/1RtYkg7GVxYv3s2mtSUI2ozuDo67sPNUsC50q9k6BHSyLu0Ue0c6iZlpLT\nsMb8osc77L50VOQmbRlcsKkv6nbPT0Tb7ZI630UFYuXTOlWoYqcy8/N1yeoc\nEy2YT+RlDFrl63I6uUpHOQy1SyccrQCK7cyT4snj0ZtC/PwxboRqCKSkejsf\nz8cYV23mrBrRiTLgx67V18GV35NyOcRYH+aaBJcADGjLjj4mj4lk+HEDThQj\n+pjTiFLpSKi/v/G8g6n3LjTg4lctdsUocEb1+rVNRAykZvWANBa3a81O7sN6\nqKFDIuQbSYxQx5vEAFdEVyjsqooqvugmKvzYqMDi6fAbxkdIcUWa6HARwtD6\nFLT08atCZmWzoreJGo7yPgy57uN+4K3JGK2zXCfJoyJwUi7qje5nwJCxiaXg\nkSM1lciwR4yi3aHfnuMJJjrqHQ36ZG/FpJ2d/+8XOMHH/nkIFF8drtfPeD/r\n6Hec\r\n=ol7O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"493c206bef4cedd10981093c61731e1c1547227e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f5ad92287.0","@material/rtl":"12.0.0-canary.f5ad92287.0","@material/base":"12.0.0-canary.f5ad92287.0","@material/shape":"12.0.0-canary.f5ad92287.0","@material/theme":"12.0.0-canary.f5ad92287.0","@material/animation":"12.0.0-canary.f5ad92287.0","@material/elevation":"12.0.0-canary.f5ad92287.0","@material/typography":"12.0.0-canary.f5ad92287.0","@material/feature-targeting":"12.0.0-canary.f5ad92287.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.f5ad92287.0_1620066196127_0.5765906384040582","host":"s3://npm-registry-packages"}},"12.0.0-canary.af453daf8.0":{"name":"@material/tooltip","version":"12.0.0-canary.af453daf8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.af453daf8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0e0581f20b033fd768ac7b8134906026643c2d29","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.af453daf8.0.tgz","fileCount":38,"integrity":"sha512-75LO8b61l9viH0Vsd8uZo7EMVL7nj1lv9qC5nstnq8cZdGp2A82AC8NHGfjx3w82YjmUUs1CaOie991csqH9FQ==","signatures":[{"sig":"MEUCIQD2FvhVAKxns3E30idaguX9CZuL9fnXfmvUw1fqjizYzgIgTU5MplXklMrPqPfAkRHKl+QRxBmuXSFCIz75YS/vFo0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkEbqCRA9TVsSAnZWagAAMNEP/iFWDXT+ZEiVWyeuqthL\nevYWAavLARdjAVrF6kN6wbCdNY9jXLp8c+OSTVTBwyHXuQVhpKsgdi6CJeRE\nPBcFA81/HSG+XH+5w7jiWDcuTW/S3AFDBNVhGQOo119z1SmAZK7ojoe1SSR2\nvg/MIHRdvUViqatX6rWOkqUwBZy5PWj6KWpEkk2E/DmAloDQ6S5TwiNqFlLs\nUzFNQUKKt0zJK61h1HPV61IWdaFeQBVO1alS5CBXCALV2M/rbNopHk7WcmXH\nomYhRhxGJ7UefuGq5fuiMtNbeMklGa19FNjaElddMuV+GjF3ryJ06TGt0/dF\nexOLd5ionpJAk/oqb9qvev7hK9bj07DVcjNmFAgg1YwLXANFOc4a9FalyH16\nXYM5KADiX+V+sadKFVrON5OP0z5kmx34i5zgk2+Rk41HO9QF/9YF+C1mTknS\nIq/eY+v6ngqdf1MhPVrIK5LYLQtEmmxOWzSox/CctNSP1+EwFpj2IUYtugI2\n4IyoPeeKBn8B1TuZCAZqxi5mRkwDGgVdMW0fdxRH0zSM8Yq/cP2Fb8DmIBwA\neanyHFGqk9yoHARZj0wvywhBP45AM41hu1cB8ibCHjhwiDURpie3DEgRNR2m\nPsCYBLSarwNNLaFyiq2p5DrUkt/5qpDIX1q2UTUNmvMPa4PQ/Z+c9J+NrNb4\niwLV\r\n=VN+g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d55347cda19a4d9469eff68955185d9d5e235a16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.af453daf8.0","@material/rtl":"12.0.0-canary.af453daf8.0","@material/base":"12.0.0-canary.af453daf8.0","@material/shape":"12.0.0-canary.af453daf8.0","@material/theme":"12.0.0-canary.af453daf8.0","@material/animation":"12.0.0-canary.af453daf8.0","@material/elevation":"12.0.0-canary.af453daf8.0","@material/typography":"12.0.0-canary.af453daf8.0","@material/feature-targeting":"12.0.0-canary.af453daf8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.af453daf8.0_1620068073995_0.20499742269211696","host":"s3://npm-registry-packages"}},"12.0.0-canary.1f1918c24.0":{"name":"@material/tooltip","version":"12.0.0-canary.1f1918c24.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.1f1918c24.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b167a2e7f8ad179bcf2d36da74a8a9d375ba7797","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.1f1918c24.0.tgz","fileCount":38,"integrity":"sha512-mXp4meNO2wQTZtrFcjbYH4ymRJYtFnOABgtxE0ZfF5Y5e7P/pY7Bca9Va/+6gYmMKOcD79ZchQBD4OXum/epbg==","signatures":[{"sig":"MEYCIQCPgf9mIg52s8MP7b7ARH5HqLwpBl5vGZPp9vBUVXGhOwIhAI1cOZx162yFq5Z7zoP136EckLw1qlIicl5JMYw8iowG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkE27CRA9TVsSAnZWagAAq3wP/23Vsakibo1rIWPjU33s\npbJeaFkxJFac5Y9+BBj3RyivQYykgg6Ti7xPlqPLDpnss00XsrObK+juhwcN\n91J4GrdnIQFkWGXo0+WIwqsiJPE2ukF/ijECIdlSCZRCY2XjLHdzMQdohqWJ\nOfDsWWBnyGHQJ9XQ4Q/5wBjTJrOEArnvw0zbOlPTZO+oPsrs1KYGgbIcqsAf\nAjOZl1mLEb69L0+H5LnZT6K7oPpEaWFeixyzqEoGQQCAaWKTOKavapi4UPFg\nEYfkaLH0ewWsys8tdDcxKQV1lSZIwyj5cjKHFJRrYEDY34EKA1iFBuI7DBdI\nEdKA9M4/ypbURLb2YalgA/EO449/QEnZFkxplIQ/ayZuxbgzn8l/s7INqjzi\njb2OurvGKcLoksA5Nztr/Z5qmtqjKt1x8cZDvXo5fBWS8/qRyTQ2iDrTdci6\nMURzkNBTD3hoZMSbBQT6IPDf7/0jLlTBCi4Br3xpjz+/eHsjwU/tJAZHT4ah\nMzbXiSyReVGeWZjAYSCaS+7H76SgEs/Oh3l00OeMDzoyfG025ZlReGK1veOI\naVE5bvElqjQbMH1Bqgz35G++XpuiamWtvtPqYZoF0BrkXGF7h5BEhWGOrHzd\nT5S22CY4FtMklnI3VXdTEooNuNv1njZcQvxADcKOFNaZb9KVKwQDL/RqN/Tk\nK8NC\r\n=ExNB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"cda2e786bcb73ac46385a1c6459a8ab7bd9ef6a9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.1f1918c24.0","@material/rtl":"12.0.0-canary.1f1918c24.0","@material/base":"12.0.0-canary.1f1918c24.0","@material/shape":"12.0.0-canary.1f1918c24.0","@material/theme":"12.0.0-canary.1f1918c24.0","@material/animation":"12.0.0-canary.1f1918c24.0","@material/elevation":"12.0.0-canary.1f1918c24.0","@material/typography":"12.0.0-canary.1f1918c24.0","@material/feature-targeting":"12.0.0-canary.1f1918c24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.1f1918c24.0_1620069819182_0.8152015707830607","host":"s3://npm-registry-packages"}},"12.0.0-canary.33148231f.0":{"name":"@material/tooltip","version":"12.0.0-canary.33148231f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.33148231f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"815e6a52ad177448d28687210514bb55d351859a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.33148231f.0.tgz","fileCount":38,"integrity":"sha512-UCXgh5xSyeFNJMND1L8MMJXCHiiNx65LB0ivbQ9lN/Xd/ryEIwDEl0E7ljrf8nox7NTcLgfrZUDS8QBXsWeCRg==","signatures":[{"sig":"MEYCIQCsSgTs3wswDoGr2eF5hCrrI3GN6879NFkvUKVaWr6ZqgIhAPosKmhuXRhPDgNlbf+Ctky2Fu6raBjafoOZy5f3EFMS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkFGBCRA9TVsSAnZWagAAjGoP/3EbiL5PrW6mzCGy0wXj\n9ErMDKVngDElOZwstHndA2kmwknjMNiDNtSFAwa87ZaDI2jsrJffDzbsTlQF\n9LjtM4MUhvZZ25qAKnrpMfJh2BIWUTo3BjZzGy8y8YFMGgI1PAtSAX8/Dwwt\nCDxpZumwTucbKCs3y2jw03xDB/5/YN0S2uVp5bCv3yUfwP8l4f3iz4tlCifh\nYb37wSHGbMGxcGvBkuGtZ11EF9KLXXiEqz5SIB8ozVJx9dskguwFg9ZC9xg7\ncycZ1OXE4AcgpV6xWRJg0qU5nS8yO6P6/u44EqWr2CK56JF2uE/N7hnjb5Ii\nvlrnOGwiYw1FhOad2HzgDcI7MIOldpfq56UHYtg+QGVlF+FbBErz6XFw/Beg\n5iKioK67jE0v6T+jJKvU0qiFhYKRzRC1J7pCkDoAdFvcvWhHwUAZH4ce+8ye\nnxopgRDe7vU2vY5cfcCJHrJzVhc+gSKQGe3OOdKnwcAckIZSJWt4wZpTO2KG\nsdjGjjNzyar/E5AtACpQZhDggfgM+3jjuj30SwoGZPBaqfiVDMnOhqaqWesD\nEFSEfDtgiPBow5TJrDcmSfHiAoGyfnzoeBuGOPcO3MbwjkbcDWhZqBDfJWoI\nkCZ3fN88lAt+VpPC9TiuvONU5MlXlNXNwH6741EjZyXiOF8AZDXN2Rr2cAnU\nFhhN\r\n=q1fp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bb5a14b15a74fcef265050ad96f737d0acf36987","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33148231f.0","@material/rtl":"12.0.0-canary.33148231f.0","@material/base":"12.0.0-canary.33148231f.0","@material/shape":"12.0.0-canary.33148231f.0","@material/theme":"12.0.0-canary.33148231f.0","@material/animation":"12.0.0-canary.33148231f.0","@material/elevation":"12.0.0-canary.33148231f.0","@material/typography":"12.0.0-canary.33148231f.0","@material/feature-targeting":"12.0.0-canary.33148231f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.33148231f.0_1620070784559_0.6353772610118089","host":"s3://npm-registry-packages"}},"12.0.0-canary.06b76fa74.0":{"name":"@material/tooltip","version":"12.0.0-canary.06b76fa74.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.06b76fa74.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ea2e896ec84d1ab41e87b210d83aad4e317c35f5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.06b76fa74.0.tgz","fileCount":38,"integrity":"sha512-wIm0OaSAwMMb/BCYAmu0+H7jQFLJHRxv/mMFeCpy6pbfZmm0Qo4bcJTx2p8lN3BhXV7gwir81odxw1pg2gF1Hw==","signatures":[{"sig":"MEUCIGN8iJQkYyzKyfOVZ9Mbzb4klzfZ92Gtn7e4aSW1uvKbAiEAoHowT4VEaS1jtAUJCmdvORAYyLMGJ0No95xOACbyyEE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkFMnCRA9TVsSAnZWagAA4aEQAISVIKz+diGX0YuSaV9j\nET8FC4+HCvQoZ7T6LhuOaMBx/BlfmYb504Lbq7SJSImgFZuF95/irf/mxn8l\nnvCEhwI3GV/HvAObMq3J5InB45yBbNg1gEEa7g5utWbtNyY1forKuh3EPFa0\nOlEW1BclQt00AhZLVgkAe6sPqz5t/zGSl/ge0HNfsgcRmY/qPiKy9zOggkzh\nQWsocB4IFC9wmgNqCyCjwfymPL5FSsVAMrVL1FLQ/hXW8Xl0fZlinsIJGSoc\nRxIOKPhAR+k48itEj61v5dQjkoo5i2DKs7F+9SOIkXhdcoMedSoxhPiquwEe\nse0F8SUU38X0N51FPBdKBjOdap/VjbGT774klQUtcPnA9rliPP6DRqEDGGzz\n4mTPOAP9hzuXDppRYkeb97XXswnGGk3Vf8RAGGW7972vYtApSrHKwzMCIijL\n9ZPU499ez99rvKk4h4GUukdHPtfeE2fI/CEEQD/cjQm6CAVenHySoG3vmaJE\nEUWU74ugZdfVFC+f0X+gigrGd5Y3HT99xIPDDMpjlf3IPc4kOT+R629dIn/h\nuDhHTKDvb+Zsz7Y3adVrCAcYjlhsFMMBa8YmQ0yjkrpKt3mSWT0PM+wW/fV2\nc52Z0IepBdogo2xJo86okbSXN5gth2kGfAv5KWrJHvALmyW+MxESOxTGtSQS\ngNxi\r\n=iJce\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6a6a73c9687e196677329640dc1ed025d13b44a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.06b76fa74.0","@material/rtl":"12.0.0-canary.06b76fa74.0","@material/base":"12.0.0-canary.06b76fa74.0","@material/shape":"12.0.0-canary.06b76fa74.0","@material/theme":"12.0.0-canary.06b76fa74.0","@material/animation":"12.0.0-canary.06b76fa74.0","@material/elevation":"12.0.0-canary.06b76fa74.0","@material/typography":"12.0.0-canary.06b76fa74.0","@material/feature-targeting":"12.0.0-canary.06b76fa74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.06b76fa74.0_1620071207463_0.9376645217109536","host":"s3://npm-registry-packages"}},"12.0.0-canary.7c5000473.0":{"name":"@material/tooltip","version":"12.0.0-canary.7c5000473.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.7c5000473.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8eb7ca542337626d2e0ac9edef403c041316b644","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.7c5000473.0.tgz","fileCount":38,"integrity":"sha512-Gj9chr8Iwwh5cn/mqo33oVQTyJKsMtj8dcdQphe1mbC7fROkhTwhgtAIH+QyPwFU1pD1zEVS/GF3lPUkV/MFOg==","signatures":[{"sig":"MEQCIC7G0MLZ3qrXQAMf7Pcs9WYmwVmRanNVP3TMGuQ63maJAiBnRFz9nGz1iP+28lYTYaiO0PSfj5JWQSgdcs3iUX1t9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkHxeCRA9TVsSAnZWagAA2zcP/0qj0cJS7SNK640Ac/cC\nQVk+KYFZFRm3M5kRROUsWF+O9wXyc2v2nHpcofZ+DS0qt/fvj82YhOqGPowA\nuPaclbHvTxrZgghtMKA9RO0m2WY5xhufJ8eEpyT70/I+Lhb4fZ9oM0/zggmH\nlDa8XhhysLd5DHp3dX6Vq1owLA5BgjQbHD3HoZgun0/UBm95KtjGYRoZYcUw\nVWKTeTV1PUrr8yp1wX5976z0s47jd2ZXH/WgamTiY/Ebq9HQjM48gK12E0bM\nF8kQg3YxVgN5g1nTNgr4GbQRFpwM6Ahvmo0epzyRf96lpzHcGCgQcVYxtFjr\n/o5KVqn8MWj2iRKhTGYzwJRq2dDdsdeQ71OUISifcZLKZETB6Po8DzsUl1qe\noyX9wf4SUrpxSt4UCgu6PjApddWFl+R9aoFS3lNDL7zZi/L7XL2f2TY5zJ/1\nVpxGeGbNhqapW91yMWp/NI4X19y4maH+rg36kCzVUtkQmXRIpVnE2m+AftnT\n8sPEY9t4KqtCt8ugYHneo11ePZ5OrFufRVBm/TG2sIdJq13ZitowQ6A1esEr\nvTFJlhhLLhVuqnUnah0pD4v6nBFe00spvlJWC7DhOjJpPrJc58IqHpFQ7eTm\n5g/15OA+pLFae1VnE4ayym7gbp2yLbcukuZUDaa0+DzNeVnvpW6DKNYOL4qr\ndgfl\r\n=onb1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d53e0032497f2efb6a42d541ce5cd2072711f86c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.7c5000473.0","@material/rtl":"12.0.0-canary.7c5000473.0","@material/base":"12.0.0-canary.7c5000473.0","@material/shape":"12.0.0-canary.7c5000473.0","@material/theme":"12.0.0-canary.7c5000473.0","@material/animation":"12.0.0-canary.7c5000473.0","@material/elevation":"12.0.0-canary.7c5000473.0","@material/typography":"12.0.0-canary.7c5000473.0","@material/feature-targeting":"12.0.0-canary.7c5000473.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.7c5000473.0_1620081757490_0.37909612385613145","host":"s3://npm-registry-packages"}},"12.0.0-canary.de997644b.0":{"name":"@material/tooltip","version":"12.0.0-canary.de997644b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.de997644b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f61b1f4d5e299720b23649af780cf772fe53eff9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.de997644b.0.tgz","fileCount":38,"integrity":"sha512-izeTu92BDCip10VW7ztpTLUDSzxb9wMcflAqCfkqf9YA8HqN96eUULj9Pcd2dnoW3O8ErMQGsOY8ucV1bnjAig==","signatures":[{"sig":"MEUCIAM1gSLYEsFbPdcv2NMgBWubRsEO2MfyxTxNmY7q7M60AiEAzz2GlcEyv7xNRHFR7NoQwTHru8mZ+kNDgSCtVUunsio=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkYRrCRA9TVsSAnZWagAA4ysP/3gfDgGFoMmCvc+i10CS\nnnnxd/NE50wWXireUliSnaY+9+UH8BozmFZ+R9+h3/yzCbBxQtnTsw+rUDMT\nr6NGDw/F0N0u5hN7VBYORQcw2x1HPuvI7OGX0DYTC5ZcNcozjD/E1Bxte4fT\npyDLaGb/V5d50nN1Mw+jb7LVBmVAcl9adwjWaMPAAwGOBvLdhk6/0uENjKJu\nKSDY9QzoKpeqYulwITS4qowrpG71wihjwDvIIDt0fvCcrESG9+jSJSyMeWL5\nWxT1VH+i9M8hs0FurRwmnIBcmg+wQmF/xBYuNblspW/hYHV2gP3SlVh5E+Z+\nPjs0kQB3WxVHjN0l3p3UMNHAyfHZXN4GJS7tTwP8jgTgsmE3PgXCYuufKsWY\nCSFYUhjCe2/MAM2fi6sCop64mupt4q2ESm8Si9dzMqSOITQAZT3SBjoSZgqN\nbIt37gdf3am9Y2ctnHYSRry8VXnjf2YxmkjwApldBI9eEudE3OX5Rj7TjwEU\noZja64cAWqsj1+NkJ8XEkES0hk+xh99FUYXZwOYSVjq4paWdldP13+6Fzaou\noEDTu7xb7OiIPGXX/a+W07QiBppj3QPnvkc6o330gBTVOwaNfbBmkZVOmUNl\n/JxNKCJYhkgE75pKdj+hbX24gO3F/tBVoqrOtyrG+6dlWcZ0rDcmMWtcguiy\nsGLw\r\n=IMRJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"efb97e2ef70bfc07ed9b429041e4f201bb0d3a53","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.de997644b.0","@material/rtl":"12.0.0-canary.de997644b.0","@material/base":"12.0.0-canary.de997644b.0","@material/shape":"12.0.0-canary.de997644b.0","@material/theme":"12.0.0-canary.de997644b.0","@material/animation":"12.0.0-canary.de997644b.0","@material/elevation":"12.0.0-canary.de997644b.0","@material/typography":"12.0.0-canary.de997644b.0","@material/feature-targeting":"12.0.0-canary.de997644b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.de997644b.0_1620149354586_0.13026018384012383","host":"s3://npm-registry-packages"}},"12.0.0-canary.d4d7f1cc2.0":{"name":"@material/tooltip","version":"12.0.0-canary.d4d7f1cc2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.d4d7f1cc2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f8b4aa0e3035c9a94a040dbe2d26ce3dbaf2903c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.d4d7f1cc2.0.tgz","fileCount":38,"integrity":"sha512-aFdHRrgML3mrxzOXEqg8Po9+PlC3UrLT7G8m9+horEThovw0sE7M2s00GsTKMWv8KusHB/0U+sySgG43UMyi9g==","signatures":[{"sig":"MEUCIDcpH55HswBq1OigZD1Sb9lUeep11ZMhiqLV9fQVtw7nAiEAqTYDgi7UyN7I8OJvnpNuWYmCpNQOHMI3WhVx9WTfUic=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkYq5CRA9TVsSAnZWagAA+UkQAJrtDtsFapmU/1qv9D2j\ns3awrLdEfdyxRMzpaaGY80hW6uWEDgO4N4BV+fb16k2eGpAEKlQ+2BASPnTV\nVN7hfnFwfPHJx5RO/H9fzuGhhC8eVJWWTgjK7gCiV6YCnaDvXCeERy8Ho3KM\nYDKPJ1TnLZdUGp3D7FaIB/dcALWG0VunJEh0YiVjgMKLri4VEA9JqxLM1h0i\nzDFB6Hyw4oRtLfL+sVU833n7O1HTq1SLowUOD4HEU+qAel7WfGagDM/gfGdX\nnOTGJBD05yXbspN0qWjDt/niaopfbYegpURp1uqdpLN9cPX3zdsgKEgYJ9NS\nJ2Q2iUgWEv6eYzjN2rXbmYcvTX+Gn3hK1SOrCz3mN3AEBeBO+iQQ3DBahQpl\nY8da0ebBXqPpVlOTFNE1zh4N49lstcxV82NvGsmpukOamzfdGuXmTMe/3CFT\noc5y3xO6JAC9vZl3RIwoIPBx8hXkE4DlgiU6n/fy5NmvQjVXtTRZTwauKafM\nxap5rG78dksJgI0Jz02wiVxDTk4+RA4jwEVlKd2SzDAQDctMKHzgmt+Fwyit\nIRJ2MwHjdLxyrEBUbFZjWAjsp+KVlpENyopJa7jCOP8AHSqU7bjL3Vh1BqAC\nIdpPGYyrFbr91fywr7MvDobdE54kfIsi3+1Ggq0feokidzeiqyqUNoZ2SpJ9\nqA3W\r\n=j6q1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"473ac5e3a11b87616a0dcb004bd5a9411a271f6e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d4d7f1cc2.0","@material/rtl":"12.0.0-canary.d4d7f1cc2.0","@material/base":"12.0.0-canary.d4d7f1cc2.0","@material/shape":"12.0.0-canary.d4d7f1cc2.0","@material/theme":"12.0.0-canary.d4d7f1cc2.0","@material/animation":"12.0.0-canary.d4d7f1cc2.0","@material/elevation":"12.0.0-canary.d4d7f1cc2.0","@material/typography":"12.0.0-canary.d4d7f1cc2.0","@material/feature-targeting":"12.0.0-canary.d4d7f1cc2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.d4d7f1cc2.0_1620150969355_0.8165496188887829","host":"s3://npm-registry-packages"}},"12.0.0-canary.be999eb08.0":{"name":"@material/tooltip","version":"12.0.0-canary.be999eb08.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.be999eb08.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4595e7050fc4d959f93b7873d4e4f4ed78e10a35","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.be999eb08.0.tgz","fileCount":38,"integrity":"sha512-yGkkSDwKHkB+DkZ45T3fRA/D8tlBpJi8iW+a3iqhj31uSlz/apNaprfmWIwkAPcTlwS07X6ZYiVrUjrGWEkpwA==","signatures":[{"sig":"MEUCIQD24Da3w2VKM/aNQhwL2jpDlaVxOL3XnLyY9X4GOn2vbgIgPhmJiPIZApMDz0SAHhQ/Nl4xToCkiOhcDX9okpWMVlk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkYvuCRA9TVsSAnZWagAAkX8P/RIbAvZ+O9BQt27wrCRA\ncsRUqc07YJ9fFoUEGkVdh4S9xuULyv1Dxi5PFIjx8qAcyE5XVAUVsz1RmWG3\ncBlojzjDNEW0GNyxx4Su79qpT689Y4/tfgQXqCOsgPZZxHUWbo8M7n54/csx\nRLF92jh628qHygaNQFA0Kd4c7kUo7CiePR2vueojiJlytq511cAyA0ZFHX5F\ncs+N+oImT0Gnakh3fSmoquWV09NDAgVeuITtCoys8/sdI6fZIm9BW35jh4Dq\nTIXkuVqlXrmwymQvPKSqCr6r7KNBM3Iuuf6iqtiysNErKEL8E3HJSA7xY3DG\ng6sUJjfwR0Kx1nvYVDDGip4NiIy5ibRiBTQF1Pafz378zCV+riSDqXYEyqVD\nDR2phkYo5Ws1IE+1kE1EnW1IS9+OOdIr0C8zIXL3m4yLA+yKNGggGsrTB7CN\n3TqCPhEYNgkjfKwkiCrbsZDI5mUgez6tDxkSRzIaTmfJ6OZQXsc0La0ZHD00\nwq1jdMbmTGtwjJpV/eRNs1J04hAS+E3XrPuB4y1YmTE1XgwCy/qdt44940iW\nW5+dOoe/uZVsmQxkAtkAvRGlX0quMXuQOrhIkoEBpliOdixn3Rg9QDoFw7zu\nW8I84KlhP9TtfNDJqsbhh6au8goNVthQNMUgwO8pDvDhyzdw9M5fjhx6cpNp\nbN03\r\n=zmFG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"78911f7ba4a7d68ed38f554357f8f224ec7a15fd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.be999eb08.0","@material/rtl":"12.0.0-canary.be999eb08.0","@material/base":"12.0.0-canary.be999eb08.0","@material/shape":"12.0.0-canary.be999eb08.0","@material/theme":"12.0.0-canary.be999eb08.0","@material/animation":"12.0.0-canary.be999eb08.0","@material/elevation":"12.0.0-canary.be999eb08.0","@material/typography":"12.0.0-canary.be999eb08.0","@material/feature-targeting":"12.0.0-canary.be999eb08.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.be999eb08.0_1620151278150_0.35437509841593196","host":"s3://npm-registry-packages"}},"12.0.0-canary.eda1705fc.0":{"name":"@material/tooltip","version":"12.0.0-canary.eda1705fc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.eda1705fc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7429e6e4058c113e4d562c4ede99cc8858c24a26","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.eda1705fc.0.tgz","fileCount":38,"integrity":"sha512-LqsrXXUo5qwgCzVGPJXPdPK8v5cmOVoNUUnYME8V8A/GIQY/GyZ1XIDpYnw7IwxsY4oioxqDFcdpyq5qR2uxdw==","signatures":[{"sig":"MEUCIQCLl7q1D1WU/I+otXnG8vOCxfB79aLTbPwQrNjAGBr9jwIgB2ONQBQWYWwjsVU148NHhaPSLDw3gq6TVjVsO7NKDvQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkZxfCRA9TVsSAnZWagAAIUsP/ixcACswnohtSNdxbQ56\nR8ugrSM7pvXmjDMKSvUyAWIUv+pEmgZzUwNwRDAvyHpp7M2jPVXY5jdhVUlH\nBLzFDnSR3yGl84qFSsXtbkB0wZo0U1opKZ1hrPCeD1eX/QWiS6nBo2Kx2Hqr\n8Pu/te3sYrD+FFNgAQStrwLjdfO4lz4qGBTeoypcBVn9Vh7sWX49GlmpTyCU\nicaje1HjzNLpf/NeCK6JjnJOZ7RkLkXSIntlDJ4ije2dFWGEiqJhcSdQF8pK\nCJnykC99NOUvTK9eAFDB/h+yf+ithP93OZQ9k36qY3+Ffnm8dptH1CqsXnMQ\nQE6vTASszWkhF2UgVfYfHtYA3Zi5CT6khfNBta6iVw5AQMzpA3Z6ewaWXebn\n5eqYPGZjnbiPw+KG4gI9L45Rt4500n0JILm5QGQ+keIUrgDHJXFhh0CH/Kh7\ndq44eMJDYwJntDJl/7r94OD57l3sCuyO1XGnyZjlmMqdNDkwqbq2hX4Cn3hc\nb1nsOtJcgEtpckmP/CARsrVhXaxHoNNlUUZ9PwggglYT3IlFXTmkeC5CTZ0/\n06WuVrFxjMAydsEjI1grLza+99ACbf8YAgXGR2eGJIibgYUZy4xHPGnkOdlz\nrEx0lbThmsBjCP2A6sEIWxFFnxcS3RqzCNI/rf5D+KGR9Z+QOuzlkseEZsJ0\noqx6\r\n=1s+s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a4c7f355f27d26cb39ac4876510254d165a5645d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.eda1705fc.0","@material/rtl":"12.0.0-canary.eda1705fc.0","@material/base":"12.0.0-canary.eda1705fc.0","@material/shape":"12.0.0-canary.eda1705fc.0","@material/theme":"12.0.0-canary.eda1705fc.0","@material/animation":"12.0.0-canary.eda1705fc.0","@material/elevation":"12.0.0-canary.eda1705fc.0","@material/typography":"12.0.0-canary.eda1705fc.0","@material/feature-targeting":"12.0.0-canary.eda1705fc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.eda1705fc.0_1620155486800_0.3791289174448673","host":"s3://npm-registry-packages"}},"12.0.0-canary.718c90178.0":{"name":"@material/tooltip","version":"12.0.0-canary.718c90178.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.718c90178.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5ad2af8e08a63a67a786ebcfa35613cc1bf9af9e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.718c90178.0.tgz","fileCount":38,"integrity":"sha512-XMbHAYeHKgIBUvhlF0aZbWqwINLhsiRKa18/4JaIbxMfDCbexKw7s/D8bjLK/ukNLz/+kLwY2l6zB8ff3ZpgHA==","signatures":[{"sig":"MEUCIQDfdO+aA4I9FoFsRxocCq62Cegi//NibK3BTbRZ9xKZOwIgUzmb+YucoSr4YsQAuUX66rNwQfzxA8Uon+15ByRIGwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkaBuCRA9TVsSAnZWagAAMrgP/1uYzEiPXt6o5qHIV+BD\n/fwNbm3ZSq60jU7GE8yVlHiLXSrg2rrizvd2TkEuWuERz2PxPORx1b8++jYZ\nAlE+kzuNPVGcyU0OGQeK2QUaIqr/imonvtlQDY4gfxJMC0M3VYcCir9P7F4n\nQXhMUuJcCeIy6WKptkRuwE/ectTdnJlIxYpiX73QLDaxBkbioKJsEpHKBFTm\nUtgPu24M0Uk55EtIb15Ihclr11l2ZNu5AFZtGmM2jIh0piTRCAueUhLjKkTW\nY1Dn30ydU73y4DY6HkrvgepWjeVGJZ57cnDG+kcTDlGy1kYZDkVB54L5TBpD\n438qQm+uTIIYKyaFsIA+5buYbXsrriHRHGyScAHxctbpX2LkDgoyRoimW3NU\nUX7Qz3T55x0ndVfO5XdmaNcN/XHpsrmtO/YxfzqhHjJ24NxUgUWXo6ivCp/U\nTBcyFB9kSx//8RaJYqKuLmS7l+JDW00Zbdy3xR9gaDQn6SjgRlBVtwuLzeLn\nrrjNGofKVeTSvrliz85pAsS3aGSBap/gsRI0js/wCU7RiuIlim04fVgjLtgD\nv0c+sMnmclheWeCNDlgxzL3ZSQ8vqMQc1l/cWZ3G1GmW3T/2IJPm76ac3bKZ\niwqrFSp5vStdh4ycrXDRWnIHQE33jcjW0hNjIPlFQQOb0f4fB+Fl+45VdC4/\nbIOY\r\n=GOjq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"38bd77e93e567329d390e9784d4f591d6dd41191","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.718c90178.0","@material/rtl":"12.0.0-canary.718c90178.0","@material/base":"12.0.0-canary.718c90178.0","@material/shape":"12.0.0-canary.718c90178.0","@material/theme":"12.0.0-canary.718c90178.0","@material/animation":"12.0.0-canary.718c90178.0","@material/elevation":"12.0.0-canary.718c90178.0","@material/typography":"12.0.0-canary.718c90178.0","@material/feature-targeting":"12.0.0-canary.718c90178.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.718c90178.0_1620156525740_0.5625096189425154","host":"s3://npm-registry-packages"}},"12.0.0-canary.0e3917299.0":{"name":"@material/tooltip","version":"12.0.0-canary.0e3917299.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.0e3917299.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"91b93764cbd8ad04614e5381240ec26781f6a182","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.0e3917299.0.tgz","fileCount":38,"integrity":"sha512-VpdDXpo+/DE9VPfd4ncLu3f7+IdjbIdPmJaZujkn5LpEzcpzIVnDyo1KaYMpnKhxAMXNX1nV126KIivwwZLFWQ==","signatures":[{"sig":"MEUCIQCdGxzdQCW6+a3EE1MZj5R2Yvb4bJlLCjU+YLcRW16RXwIgOHe6z/mszTFnQTqaj1+DelTSMd/JoT55Ox2dQPf3PnQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkaERCRA9TVsSAnZWagAAXLUP/3+d7BcZq1Hac7+NrLVe\n5Qq03AYScApaUU5mjcQ9zboAqu9Wuh5AWbqYV9Os4anu6dab/WjTvtxRORRd\nY4Dimd9CmhwVoCBbOZpdZw5o5eIz7AF1dXjFBDSE5mXRV0hNRXrwxBfxTcMq\nsHlc1xyT3fYt/ojv7iTJe56t9p8/+WQmawbEgVpuiGdkgfH0tepPCCOgIZlW\nBcy52s9tyEOjW+Tfo0KLofdoyQzlJ8WafySM86jvIvXi7KUE7Hlr490Zuxn+\n9c4S6hWWnXKWgquUA4/r3/1mNV+wa/GWr1L1au3qGfAG9fvNmvLqKXiYuPj8\nQVa/Y+D/UFVUBqeBPLhKjNv9N0/sDrvQfvdHVlWQZpSjgDH+k665x7pDKpau\nN0ppLNLspeiczZK4bgOphKmgHfrWLYitzyQDGB7DKsg5ZDnxFNBJbG/TyCiK\nhCRXICtMo8xE2pl6ewWQf44dSjwV36x21ziC3sNMbWGid1A8CrI8FooOmC7t\nCXML8fu9dQ9g9Vijzu2lgXpYhMD44rXMHyPFPCdF6QuVeEN7jVJ31R1I2WkH\n5Q/rGkQspigXXHqfSCvfFqW+oI3Ui78KIJJjagGdSVwIFqPSoUlN13wD2mUZ\nwgateZIv2ywmzLnIamU7No5AVSIfllT5VlN3atrgIZ81QDeXw5/nuoiFJKgk\naOKq\r\n=eMeZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b53d9d2ca98f518aa071c4933f2c0046916932d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.0e3917299.0","@material/rtl":"12.0.0-canary.0e3917299.0","@material/base":"12.0.0-canary.0e3917299.0","@material/shape":"12.0.0-canary.0e3917299.0","@material/theme":"12.0.0-canary.0e3917299.0","@material/animation":"12.0.0-canary.0e3917299.0","@material/elevation":"12.0.0-canary.0e3917299.0","@material/typography":"12.0.0-canary.0e3917299.0","@material/feature-targeting":"12.0.0-canary.0e3917299.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.0e3917299.0_1620156689266_0.5847901718778645","host":"s3://npm-registry-packages"}},"12.0.0-canary.836b3c7db.0":{"name":"@material/tooltip","version":"12.0.0-canary.836b3c7db.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.836b3c7db.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b0f74dfae1b59cc0838fad25e50e54f3a78a007b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.836b3c7db.0.tgz","fileCount":38,"integrity":"sha512-Gl1IJz3G6hLStLoa/svgykASQW+F9ScsfTBrJG6b9oaI2cPp3eiZHqF/ALWStAjSI/GI2b8Uhtno/KENGYEJBw==","signatures":[{"sig":"MEUCICzxn7ss93LWvzdx+/885VslNkBOiN5yEbUFpP+ntSCWAiEAyzlzcB6p+SsqxVwIn+EYhBdMdB+vhw9J8AZ9tSYC0WY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgka/uCRA9TVsSAnZWagAAV7wQAJNUYDVh9qhVXjlSff3j\nPPTtKJmbPQKOMM1uD9tnlLZNs9QZ72pdsW1TR0wUZyCHKwu/LBNZZtza9WjZ\n9mbpTh/y03aV1li02ghp11HBM54LBN+MCyAZH+5VfJp23RkqehqiAtIINBZG\n9oppad2c/4lktcyqCT8auq1PYr2F3mO6RPCInW5jOplyD9MZQXYxDaRWbywA\nqd1CcXbeUY0pBZfcLPRfZgCAaRDZtPni30WNvVSNlgVqFK2a6hcs+Mp8ulzX\nF+wOSJYLC2uxKT/y0QaHSraSLnUzM2dm7dxXmGSzw0zv/JgCxY/Xng9pzpFP\nyh6V1+MGCFjfaG8ibIU+IGJ8HyKaIuyoLTWQvKf5fqYDIRBYgL4I4wNHnlxh\no1YNPK2Jw5ZEIIQY3V15E4/Dw2gony+9pkylmDxAigLHrv6eMxz8JeQVxm74\n0VRTDEnfF4gCkvkgg4DN4uDxox22Sx0eX67AkjzURcwCA2NWkPCbcEE5+GJF\n7QTJzws8bSri8/gON3Ci8S+pChPll4V+0uUdjbVRbGuL7Tqm+3J7WxI57jKh\nhbiXXpXMjv307mti93oNgBYdAbfGQQLa7hYADwwVw+rd1NfGBSUplB31bgTZ\nwQonII+oJVbx4Wgg7zbNywcL0bIkIDoqLzFk/EgrZWKcH+4SHEiZ1QJ4CNuq\nXoX4\r\n=c0pn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b39ef8f7b55792965f33ce0e4907f1811ba2b17e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.836b3c7db.0","@material/rtl":"12.0.0-canary.836b3c7db.0","@material/base":"12.0.0-canary.836b3c7db.0","@material/shape":"12.0.0-canary.836b3c7db.0","@material/theme":"12.0.0-canary.836b3c7db.0","@material/animation":"12.0.0-canary.836b3c7db.0","@material/elevation":"12.0.0-canary.836b3c7db.0","@material/typography":"12.0.0-canary.836b3c7db.0","@material/feature-targeting":"12.0.0-canary.836b3c7db.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.836b3c7db.0_1620160493990_0.46462260400462996","host":"s3://npm-registry-packages"}},"12.0.0-canary.53d4e6d59.0":{"name":"@material/tooltip","version":"12.0.0-canary.53d4e6d59.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.53d4e6d59.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2c6d4e8f174f8454f6143b06654c174b5aec6088","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.53d4e6d59.0.tgz","fileCount":38,"integrity":"sha512-nUCHtIRlP4Vsu76BT9AwRDtGk0Es5RJsoHGBVzAVaLhNJc9IZrs2s4XvZDWC171urAyqk3uU+OEA7hWm3RY0Sw==","signatures":[{"sig":"MEUCIQCCoVmOmu7iLtc5KzYTt9qn2AI6LRWAjgaFRG0R+T+vRgIgM2yDHPdSxfDDTTXWFVj1b4f+wWQfZcAf4BvpvrEnWEs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkbOcCRA9TVsSAnZWagAACS4QAJijm/aWTKtUF2lir4HO\nVg9AqYmiQcAun3eYzS69CxuorxsOyBb/KY8gRQb1tz+n4q5wm+zPZKHWgKhY\nF5v6dsET655y1/LQ82J0Z9NjklYc8MMJl8VgpY6LJ8OUGbXIRnVKP//43opd\nCvprvT3daXxx1Fv42uhlCnJwtugo7aoXyLAtqqj9NAjDM4kItcoY0yFLazsG\ntYUDSsK+vR5yzrpM9Dbqd0XCWDxA4xn+fxb0Von8JvXUReC7tb6xVOYaE2DH\ndYmDTGFy/Kt1YbWXqG98eM1MHZGiQcTQd1c+vxsX4ux04j8x5EaLDFBF3wje\nMtPduHfSFGWPdCuL2giyN70YLf4iBdz238bSscgpbVDc0X2jKsixyTLo/TDc\npSAGwuT3q3zyAT5nt0lwkLicG90hQQl4ySARH76NiP3bV1KQjc05/CSDOYKc\nz30XPYOpuo8uxo6fs6pPgDQ8AOtsCsmSr8L+UW1QbNwp0yg7ehbJeWSiYfyd\njZSfv8gKa85zo5cr94ZecddV/4lEN7L0DWufzDjG0TiMd3RQ/pNnGUNLD/7+\n2F94qZLqIsY2JjfqHd6/6/0u5x/bAjQ6ivWdr2TcH96jyfRNDLbhXUxANR9t\nQFsmGs2zUdYgcMZ58YgoIb/ZiOkyT9qYD3ZbAZAbqakZ0YBUewDl3ZPUHPww\n09jH\r\n=UL6H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a89a7c81034e7bfbeb469ddc1e1e463b018f7179","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.53d4e6d59.0","@material/rtl":"12.0.0-canary.53d4e6d59.0","@material/base":"12.0.0-canary.53d4e6d59.0","@material/shape":"12.0.0-canary.53d4e6d59.0","@material/theme":"12.0.0-canary.53d4e6d59.0","@material/animation":"12.0.0-canary.53d4e6d59.0","@material/elevation":"12.0.0-canary.53d4e6d59.0","@material/typography":"12.0.0-canary.53d4e6d59.0","@material/feature-targeting":"12.0.0-canary.53d4e6d59.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.53d4e6d59.0_1620161436138_0.877618730437923","host":"s3://npm-registry-packages"}},"12.0.0-canary.18d147e27.0":{"name":"@material/tooltip","version":"12.0.0-canary.18d147e27.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.18d147e27.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9cb77c3bc2da9f0945fe1da5b023aae43e6801fd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.18d147e27.0.tgz","fileCount":38,"integrity":"sha512-8+4fWzRUUPtcNzR3H8jGnMTLnt2qkSkC0iK/jVdGwNnOOxX/pjUvGKCITiSXQKNYBTqZaWqKFBSDXYfKsC2/Qw==","signatures":[{"sig":"MEUCIQD3kOzzsEF+NCFN8PZPG9wFS9ro/jXsAxrTdeFkBK3/hQIgGcFbgVgu7zIlBF7NCIl2lvfryAwcLrZ8kOLC/33N1bA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkbWXCRA9TVsSAnZWagAA1I4P/04wV6bPZfW8OfY4znp4\ndlu3yk1VHHm6gaD+iKa+UXRS1YlK+tJ5UNEaW68YTatRoX4rAC/zWJKI8nGQ\nwmt/m94jD0dm+mMdecfyIbnUVUx/rfxxLVjiI0I1fqX/+h2/mtAAPyy4loH+\nicYJpxwy54usMM03BZk2j0ZbcAScUQwDvIuefHXQwCGfsFVRhOgwwXmhnJ33\nHSQ4H9msQZYXzed/CzQA7GYt2KqOooDs3uNHVaYGkCtGSjyI8nOChHyY+jHR\nGZCtSZkQJurBRRrOyMrtkkATEme7NC+Tb8O/xqPtXm4wHz5o1iHQ9GNx8rJM\nVDqfOKqOg2oipH5OWrBsA4byjLVoCHvnipuchrrY2Gk8Bg24CL12OjVlUaeO\n43Q2Yhdla7sm7EbxBDLGNsnBLk14YGr6OmspJ3VxhvYEQgC5v4Q1wO3yzoiA\n49ZT6Tf+fg2KFSiCzrhqLaTPMk3MqHtQ8TaDtT8os3LDvkkx28FDaAicf34L\nuWST67JpS3PJ7yMw2UfH13/EjUEV2b3x+vbUcNbs+MB8Q6aAMNn4xd3Ac9sk\n9d4EjuL/one+IyK3J43E2sWrIr46MEPfiUQLJb+Dbk/g9zTnZCkRs8t6SPsl\n/jUUsRJ0dYQ+QJzVLB62rBmPpS9K3kRG0NFd/xWqSyO2hzVTn95XV5eSpyCJ\n4KlS\r\n=3mMR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"02e686390dabbb1590eba968246da65476db162a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.18d147e27.0","@material/rtl":"12.0.0-canary.18d147e27.0","@material/base":"12.0.0-canary.18d147e27.0","@material/shape":"12.0.0-canary.18d147e27.0","@material/theme":"12.0.0-canary.18d147e27.0","@material/animation":"12.0.0-canary.18d147e27.0","@material/elevation":"12.0.0-canary.18d147e27.0","@material/typography":"12.0.0-canary.18d147e27.0","@material/feature-targeting":"12.0.0-canary.18d147e27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.18d147e27.0_1620161943061_0.9117028677945227","host":"s3://npm-registry-packages"}},"12.0.0-canary.b9984794e.0":{"name":"@material/tooltip","version":"12.0.0-canary.b9984794e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.b9984794e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e26ee6f8ec3caefa6ff0afc8e33dfbfeaccbbc41","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.b9984794e.0.tgz","fileCount":38,"integrity":"sha512-IFQiB1joCZY6lf62gmTWs5WcoBW8GFh8sCIeAHc+SI2sNLWFoIz7+Wr00dz84LW6krIjNx60oOcusyKOTtc/gQ==","signatures":[{"sig":"MEQCIE2HKqxb3Vib2YY5s3RFgRHpJfvNYfh33t/Zcjv5TXooAiBW4BYR+v93lQ3qKJ+OwK7kGovGBSJv+REzHsNCslzn4Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkdLjCRA9TVsSAnZWagAAjXUP/1Av9CS3zuzHsUXjH4Ai\nX4O+obmjBXBaYNPLbByPiPPvyjo3phaKI1twuSB9st2kQDEQuYpZtFw4c0dC\nuOluZ0suGm4clytGjqHWxqw4c1E0YiU5oW1jbUUzOwtDR0CQ3DMmqDA2ulo/\nV7en2WIkCg5zWDqNOBcP3dIfbqW6JMSeb9FoxPm+shDLMMNxgMneJZk6HXYW\nXHVT38Ev9+fPdjAJhfrung+3A9t/F932TGkoHzi5VzZJtqP8v0nn04StUjQL\nDeIVWRfyqhK6igBWi7Ywrwc101en8T+ppLcvY2D+o1GVyOYRdsfvrLvMItHG\n+DzRv/S51HQlDQqmiPcZCMLVnN+qn2/eEImLgU/P9Dv/NWlparxsiVIGdobH\n92GFFloGMZsu6kJzD51Ll4jpEIG/jYk/b3IGhjowFD3G66jGFhEHFVL8aIZP\nuMIJoThzFcGwrUmlZBUo3M+ELpjbf3Z/tz8Lqp+fC9ah8DyzPsv+cDrTXD5u\ns4aTT0nrHkGcTYgPE60iJWOwptElpcSBGNU70vJJEXTWMDRDETjOzsJJ9+8O\ngtTUwAK3y2V7fgqcy9yij8TxVWxQNm/4/92imGzCrTeWpqJbfc+2pSZyXyU6\ny4X0XACiBBZNJH9QT5qQ52vwzH9xMg2s2YKuoVv97kriveE0M/AMmZfI8uro\n9lbP\r\n=ob9W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b9cb2c88737add4e6d3e04893ef4ca57b7848549","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b9984794e.0","@material/rtl":"12.0.0-canary.b9984794e.0","@material/base":"12.0.0-canary.b9984794e.0","@material/shape":"12.0.0-canary.b9984794e.0","@material/theme":"12.0.0-canary.b9984794e.0","@material/animation":"12.0.0-canary.b9984794e.0","@material/elevation":"12.0.0-canary.b9984794e.0","@material/typography":"12.0.0-canary.b9984794e.0","@material/feature-targeting":"12.0.0-canary.b9984794e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.b9984794e.0_1620169443278_0.053511371703809374","host":"s3://npm-registry-packages"}},"12.0.0-canary.b76f5fc9d.0":{"name":"@material/tooltip","version":"12.0.0-canary.b76f5fc9d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.b76f5fc9d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2dbab8aa166179c566a6366fe22db1f326b681fb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.b76f5fc9d.0.tgz","fileCount":38,"integrity":"sha512-YfNRS7uYvXRbw7qgrTLsKjkzmPfMmhTBohAOeICPKR2oYhJWpZ8udJDdEBsuxAFk5m3ldUtKl7UqkycQntB/Yg==","signatures":[{"sig":"MEUCIDKQNFeMOBlbiUq+c/XWmljS+UoKZcitiNRcfAGSldkXAiEAwX8uQp21QtbUvXqWsnbXH/uDXUSnz9UsL++ibHj8Q0w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkdO1CRA9TVsSAnZWagAAAc4P/2z/bUmpFV1tAVBMQk+u\nIzz4KuDgB8iEtg73KQEFlXitJokvx+dtbXj/rk4wESTMnDlmcp9ck46xqxIZ\njVvdWUV2hmpoQhtQLv3INH+raGF7lPWtIX51w8nWiFgZp8OE9LqRsc59BSuY\nshr4A4LGpLIP0ivUtTryJ81M+m53hCAcWb+fwr7mKMm9/N7qQQdAoSKRdc3n\nTswN4aJ+5VEDBGHVrtV+KlXqUzlQB/axj42D9MsUp5jn2BEMM+YGsr4eYHk0\nPOe0Fn9IR/p/sEatpE+Ns4v7qc5RzEwdMPl5nG8LG8/L9r2R2FDOj8N6WEDr\ngav+thxZI2p8/6LkqGV2rg3+5g2eXY50gdwC0sCSUQYzosP/0wZh74HSg/8g\nk+TkFQ6iUCYB6qw1r3sZOz/8MDUQUiDZn6gsNysc8hcnnqMwShDGU7SAwFeE\nvmuRrCXINNYeD2DOZ1eTx8ZHID1Styf27CTrS8d3bYslcq+/ciPcjY1dza+J\n1DCdwzL7/fggJcSnb0m0Cd7Ug3Uz21wxSqY3wFlf3viW53HoII93hl1RusiX\n+3Hde2fE4aTkYGCOzaeYGVFVoX6v6xu0n095yT6r0BzWHl2HIPmKK/n6wYVj\nJyVj8huDsbUALBUBFg8SakEwvBYtuQ8VGOXRL8VZJyLH3J1iANVk2mtY4ILS\n4/M0\r\n=lhTE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"219c30995da49f5c5f458aa1b983f09054c2d4d4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b76f5fc9d.0","@material/rtl":"12.0.0-canary.b76f5fc9d.0","@material/base":"12.0.0-canary.b76f5fc9d.0","@material/shape":"12.0.0-canary.b76f5fc9d.0","@material/theme":"12.0.0-canary.b76f5fc9d.0","@material/animation":"12.0.0-canary.b76f5fc9d.0","@material/elevation":"12.0.0-canary.b76f5fc9d.0","@material/typography":"12.0.0-canary.b76f5fc9d.0","@material/feature-targeting":"12.0.0-canary.b76f5fc9d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.b76f5fc9d.0_1620169653145_0.35126773563688185","host":"s3://npm-registry-packages"}},"12.0.0-canary.055d4f10a.0":{"name":"@material/tooltip","version":"12.0.0-canary.055d4f10a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.055d4f10a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7db69a1713725048224e76cdc39e8012d135d51d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.055d4f10a.0.tgz","fileCount":38,"integrity":"sha512-SCK2H1sqpELFGnoLw/0lCEcxb5YPxlkyofW9EXwT0LlcOFqLmnNDCfhvu9tRbztHylsJW09+G+79B0ydaLRmiw==","signatures":[{"sig":"MEYCIQD4ms0gVq/gk0rjpkGNpOCyCRAMV/MDQbhVzbeduOj2kQIhAIAzZ5DgWFiYQoH5mvZTMU5lcgvmHnVB2TrpUNPr4JOf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkddGCRA9TVsSAnZWagAAPXIP/iZBQFFW9I3VM/0Qgqti\nwXtkbE7Vs4nSt4Jns5aTj7LuD0cn9jR7wLFriU3CLtGsTEx4jdW5Trt60et6\nVc8TN5uROYMR14DpvJYZd5q3h7X5kj3Kv+UFquFiPUxEOmDtK8J0KjN9k4Vw\n//293cnBzjXVV4rjR4CpjG3g2WCqspQsj/Dop930j1JYnC0E9TSl0M7B1TqC\nSdzJgufEfM9Zw4LzyUbFBJkuEO0Tvdfl5icnxbUkW5IInrHCY6UlcPiZcTgo\n7ZeoR/DjJtyGURwQKIw6fB6KL6PSNMzHav+OOlfMkMsmQ40fzdW5K2nQ/xLa\nf4GC4MpWkHNe+J0rGanwvF8TpFCDn25cSQBf7af5jlwKeeMImuBlZkcEASah\nxTkGxlkMk4csrDIl+KlyxKJExUgO2RA1JkFhXoEsfxO9WDpJw0Y2IwfoE7bV\nPfNjCROsJzkFxdkc9W+ZBvwUrX/32vcjJYAleKmtkU3RCpJN4AFbHzR+QoGw\nBYpCKhRqAoJNaSwVB/xECWkS09ACW7mfAX0i5WqjijVAL+Sbcp/8YeQWQj95\n9d4CgjHtJtRYUg0Bgt11xStSl2nGCScTTJDfiGfy4ZdIMVVaPH0hMYbKHWF7\nQcrW1LvpvVbJBZbiK6NkAOgFT8fax0qNn0qN4kCusxzoE4UslI47GxIBS55M\nJYKV\r\n=vzbD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"df8d3cdf52cca2c339c1fa1cd18129db35422c55","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.055d4f10a.0","@material/rtl":"12.0.0-canary.055d4f10a.0","@material/base":"12.0.0-canary.055d4f10a.0","@material/shape":"12.0.0-canary.055d4f10a.0","@material/theme":"12.0.0-canary.055d4f10a.0","@material/animation":"12.0.0-canary.055d4f10a.0","@material/elevation":"12.0.0-canary.055d4f10a.0","@material/typography":"12.0.0-canary.055d4f10a.0","@material/feature-targeting":"12.0.0-canary.055d4f10a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.055d4f10a.0_1620170566163_0.08231037618537407","host":"s3://npm-registry-packages"}},"12.0.0-canary.5b6a46016.0":{"name":"@material/tooltip","version":"12.0.0-canary.5b6a46016.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.5b6a46016.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bbf0da6b5094e47b7e1ea149013773f3be0f6cfe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.5b6a46016.0.tgz","fileCount":38,"integrity":"sha512-H9rSP3lhxE3XHuF0h9d7GEXxWJY+hcx3LZ03oAD+ZaszMCMvc4mrVGSs8aOaJBHXDadPAREkmSSm3nrNoUG3iA==","signatures":[{"sig":"MEYCIQDlzM1w22pAiQRxungEFfyU4fZeLRLh8Te73REfAy8iUQIhAP/kpJCHisUBq8YI1j6lxmhKglTuegkRwozN5+f3fPLj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgksUSCRA9TVsSAnZWagAAtkQP/1mC/JxD5Nct8UV31GWX\nq0fJwqOfCsrRVJAiThbgO73AztObgAVk9ZvL3hrUVUpbyHw8ONMa5ZhP72Z1\nd70X9TFqZ3+r3ZfnUkyqsZWXDfW1Jn1XW3tIzvXtiinIVCwtDTCQKDt6pwj6\nfSik+Eya18vFkvhoDc/SIE3Q3bDd4+dKel0/3g5l5KgiM0Pf1OpMBdrCXHXm\n8oCc8MwjYAgJ0h/aoLTnqVY4nK2YY0kfLWAIQbGcV7eZAeTe8DdE5eB23AJT\nXZ7n+CXguDBy0ScKXCac7yA4/onUbtX1P2afHjvQJszWYWgzcr6GQfGTBCVp\npnR5izc6sh7ZfIl1TBpM506eWgKizvy3PcFVR9HLmPDgrMbttIDOnAjAM9KF\njmupv3Vcc/Vyfglcd30QGk9EpB7k2qljjUu7tZdmX8o7nyliVkeYnTRLpKra\n/iDw+Wi8jCKPeWUY/A+oOqkSBXUgIbZE6/o6PJkhdqmbU/YgJKPVIVp/g0Q7\nAgW5cit8BZJ82+B5iyWRR2kHd8lsdHj9+nXGJ7U3qvrpS3+R0+7f4PUFFCCY\nWmXXL6IuA17GUrfZT/wYTRu39m2BBYfHOGOjbjxvKeL7hyi9Db9dX4tJHDQO\nxTQXgd3YpDaTPqhdq/U1hYu9E+v27J8/lJllwHCCgfoyfnndr3VMXreZd/U9\nvDD+\r\n=m8sr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3d9c7e3c179062db8b5bc243e8bbfbd9d9132e50","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5b6a46016.0","@material/rtl":"12.0.0-canary.5b6a46016.0","@material/base":"12.0.0-canary.5b6a46016.0","@material/shape":"12.0.0-canary.5b6a46016.0","@material/theme":"12.0.0-canary.5b6a46016.0","@material/animation":"12.0.0-canary.5b6a46016.0","@material/elevation":"12.0.0-canary.5b6a46016.0","@material/typography":"12.0.0-canary.5b6a46016.0","@material/feature-targeting":"12.0.0-canary.5b6a46016.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.5b6a46016.0_1620231441787_0.8075960033551493","host":"s3://npm-registry-packages"}},"12.0.0-canary.33c9a737a.0":{"name":"@material/tooltip","version":"12.0.0-canary.33c9a737a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.33c9a737a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e3415c24a6593170f9ce75cebb1f50e093c79534","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.33c9a737a.0.tgz","fileCount":38,"integrity":"sha512-ldQBIlNl+BLbQXB5SI3iwDb+RqIJHqGE40NkfINQvJDOBO0XL8xILPD93Gh1+tg4UN74bKngbkw/AQ9uNN/gUQ==","signatures":[{"sig":"MEYCIQCpMhlQ00TQfIYUIa6BlDZmJqCAdihvu8/zknGqrW0RwwIhAJOwNnH+cYrM4pO2kEd9kqLFF80ZqmyFPVeaeBm5MSyS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":777536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgktWxCRA9TVsSAnZWagAAfe4P/iPyX4PvdU0oyB8qhIGK\nf5QXOIAgtVr6NOl215+HWMh8soDlX6AvRfqVx74fAz3DNJQddOx8OuQQNe/n\nYqBquv8D7RQZ6QQdZBnDVeLTBeHyGPGWLQwuwCjgP3MqS9seZAnrkMftVEMW\nqG/AWJAHykFycPEAo/Wf4nWw76E2GI2sarBchwU6lopm6HOaym4QFtxLYjH1\nQDWGCO4Am9RbEs0krmdqZso+iCT4gwZwbTSuGs/qsjflGqMJpwFokA3L1kIX\nSKCIAXK4Xb6gckBhHK3MrR+7H1IRp0vqOVWcUPXIyV2/eWdz6hYaXZnoOkKc\nHGQCrGGakH/rWcoMRXRiPmo2z38H1OUSWsxBj1zDFGhnIxBXuY6XUQbyiBVM\noFdTda32G7Qc1XCMFxbI4JXq4dROMIPcMgk7XbC9OQ78WpBjokY9TR957tAu\nX6DBM26LzXL+8hYr1GY+0XF7CznqPDU/TJZH5o5/nW9eV+PfXKQkd9MBQUxV\n7Cw+AxH8e+kimpMQSeLEu212MlmGVKSUw6yFzTItpqb9AXbGeOgdxzmBS0/h\nLwOFLT/0Cq4bXhlmNSm1b+/VLDMxDxN5NdACAyPQ4moQo3OKc36F92Gfe5LL\nyccH7KM/M8xsHNGRbBpr5kxLtt+OaJhwzCGfZmrCSXq2Cco7mnt3yPR6m/J4\nVe14\r\n=ybyy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fa5c97d28049bf03f5b138c0d97bdc267f43c363","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33c9a737a.0","@material/rtl":"12.0.0-canary.33c9a737a.0","@material/base":"12.0.0-canary.33c9a737a.0","@material/shape":"12.0.0-canary.33c9a737a.0","@material/theme":"12.0.0-canary.33c9a737a.0","@material/animation":"12.0.0-canary.33c9a737a.0","@material/elevation":"12.0.0-canary.33c9a737a.0","@material/typography":"12.0.0-canary.33c9a737a.0","@material/feature-targeting":"12.0.0-canary.33c9a737a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.33c9a737a.0_1620235696773_0.730040371561185","host":"s3://npm-registry-packages"}},"12.0.0-canary.9bc0effaf.0":{"name":"@material/tooltip","version":"12.0.0-canary.9bc0effaf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.9bc0effaf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5c07d7334fe28f3046b0273bd9e297c07a596711","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.9bc0effaf.0.tgz","fileCount":38,"integrity":"sha512-8QhJHg6p31UZcIwbvtdq3RFliKo40HNV+B1+9xHY0EDA9Ro0R6vYbcogha4RtjLOMZM0QCOFt0NzARXGA0solA==","signatures":[{"sig":"MEUCIQC71Cdwf6IAaiZDn3IZNKHJDZHqVOVRX9q/tMAsR2vYeQIgbzmyqDfVCjbIpRoehZQwlnMN4X4RqN1zz3V7v58UjYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkwePCRA9TVsSAnZWagAA+QMP/0neE/LSYzXSrDTDicni\n6XGlgf2r+4GZrDE1iBa7C8nNXXPygSLS2CA1GcIIBQunleNhbVyGTBvCHFCw\nCZtd5i0fD2ia3d0cnVeYIuZY7E6m+fw1eaidFD8fB8c5v3futJIMN5Rc+/CD\nHrV3mlhk81jeii5VasEqkjikLkBVrOWtUWAXKOTzWZqRLk9vhPhgy9Ou94xl\nZ9vec9j9wHnonqzbNDfLOnHjIXokUZHhZ2xZebi9Yq2yr6lfD9YTC2RLtcAc\nXvDWWs5M1+L780m07fixF2U3FS7w6zyvSPprrY05NHzv2tz6YxuBFbE+qsjO\nzm2FZh3R3pfn8Y5ZJfivfRE0TpoXa1eBLbxOF/oZFouKu+ODr8brJUCQ8Lca\n0ntQANFU+v4Y50eJVf3Cj82MZOUPU8d//YhSO++iISFZ0hcdThhXly5ZaU2C\nxrbmMHgbIatNlaS4heq9MJZxbjtnneWXl88puTIKgyc9glfsqArqzDEH6vNS\nqIYz8PUMQANuRO2rGVHaTPHvEX817P+cefjBOW6TSQIJBXhmfXLp9KCy/FQj\n80Dxhz8KQO0Rp4t/qI87kX3QpZaJb7xUv1GhUvJ0PM5qM+65FxpLiFbhVt24\nOe44RCveE6ne8KRBSV/n7RkWCyryWqh9u69m23hLPUyEUuNb7ZzN5k+9Vjr1\nxOq/\r\n=TNJJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e671ae06efdf42f7ea0cb40bb6700fc57f6a35f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.9bc0effaf.0","@material/rtl":"12.0.0-canary.9bc0effaf.0","@material/base":"12.0.0-canary.9bc0effaf.0","@material/shape":"12.0.0-canary.9bc0effaf.0","@material/theme":"12.0.0-canary.9bc0effaf.0","@material/animation":"12.0.0-canary.9bc0effaf.0","@material/elevation":"12.0.0-canary.9bc0effaf.0","@material/typography":"12.0.0-canary.9bc0effaf.0","@material/feature-targeting":"12.0.0-canary.9bc0effaf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.9bc0effaf.0_1620248463197_0.8106684850383663","host":"s3://npm-registry-packages"}},"12.0.0-canary.a1e0f2af5.0":{"name":"@material/tooltip","version":"12.0.0-canary.a1e0f2af5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.a1e0f2af5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f4420115630af7e7603ab04ea904e9452ce0ea5b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.a1e0f2af5.0.tgz","fileCount":38,"integrity":"sha512-QGOGtmInckH9yOUxi2a3ZgVHaklXZyPDHZAT0BuQ/p8TTGqfX85LKMX/0tAtY4m8QcmnnWFd7ZCsy8kHnFagwQ==","signatures":[{"sig":"MEYCIQDdIjUybX+arr+jkYwC2AWWKPuu8DpYSAICzwNb5n/x1gIhAJwntqgmSVaE8aPDTgdml+1mK4XVWqKKhFWzqxg2Rnh8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkxEsCRA9TVsSAnZWagAAlKwP/jCz/o7L4U6Bhjr5eAD1\n76QVGa6i0LYhbVPruw6epaLcMcWP+y+0+zn0qSpyYVzAIK1j23urod90/M0q\nRm3XOo5DiP8L1/OqR8R4JAe5NbJs2zIShiItL7EEex0WuIg7E0bdGxdUficI\ndrKYr5N4H2sX8KQMSk63++2Mf82cQSKrt8O9DpD7kLQLhpqa5lKcsJmSME9f\n0/NzQrGplce9iQ3ep6q9bHM4/d0DDKdYXov5Id6Z5z2pB8kXc3zQF1HBEcyx\n0UcIvZnj7Y4bNpbpPeD6SgeCWBq1vsz5Yhxe1LrmgUlcttZjC/r0YuBLs86p\nGs27eCoc1rVz6fvoTvhXHDOBesUMRFtIvEcRBTss0NCOQssaIT2+yZWmheEc\nJilGfq8rDv2VDdwqYXwvnuHCByKiWuzzaKMNkAZJ9s4hr0TmT8RCdcAv4TC2\nlrlq94i/a/DCYBo7q3NnY24UCCuM2nAc8EIeKx7fWL+FYR2vIp9oPVpgDIdK\n84jaYUbF3xahuEQKqOaA3cAKPerr0G9R7MrTPwPub21glMi6CRm+Cyflu87o\n07mjb9ZjjDthh5ualxgI+7p2ExN/C/2UCMgjhTQkC6qz/DpAAV08UJZ1Mx3f\nsPGHoWKW6yb0vZoANV35nWVIPzumDcYTunUZUjVNoUdjmItgawy/e+VEbDbL\nJ+7b\r\n=/yDB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7e20a4b86d7cb59be9ebe12cead11b1e8c7bb63c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a1e0f2af5.0","@material/rtl":"12.0.0-canary.a1e0f2af5.0","@material/base":"12.0.0-canary.a1e0f2af5.0","@material/shape":"12.0.0-canary.a1e0f2af5.0","@material/theme":"12.0.0-canary.a1e0f2af5.0","@material/animation":"12.0.0-canary.a1e0f2af5.0","@material/elevation":"12.0.0-canary.a1e0f2af5.0","@material/typography":"12.0.0-canary.a1e0f2af5.0","@material/feature-targeting":"12.0.0-canary.a1e0f2af5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.a1e0f2af5.0_1620250923958_0.8677642875476315","host":"s3://npm-registry-packages"}},"12.0.0-canary.06930c96b.0":{"name":"@material/tooltip","version":"12.0.0-canary.06930c96b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.06930c96b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"24a2e7ebd6e0624fdae5cccafde7455626ee3727","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.06930c96b.0.tgz","fileCount":38,"integrity":"sha512-Lu2xanXSFooYdOwEi1FaPRi6gIcUc0BvcTbv66qJy7+7yG1BeCC76p7nAQXuUcHyIvs0FwaSyJ+tDwfJ5cFjZg==","signatures":[{"sig":"MEUCIDPn/lhNKRQnO0xv07zL9wwdOOQTM7TGE6agPSPD01EfAiEA1DyhXqn8Xh74S2pnhWK3y8Dt7VEhQC48PZ8FrWvvHxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkyzbCRA9TVsSAnZWagAABqgQAINwrdO8O9J+0KG04nTS\n09r/Er9uSPlCj2SXZVzFGdpus7YZvIkx+MtthaFRsfyUZbPPn7s2H89Ld29I\n7bc7oywAgSstBo2+eXJVifNnpfEQZl5GTG8X8sZTHNnZwmHbTIT5F1b68O8d\n9bHSH+rFqYIRFIs4qTJDx9jqzDmWj+85Xudl7KkKNs156Q4V3UN0IRHRe4To\nj+3AiSxtaaSxcrxEM5g2JR0xGpw5kAjN2w9ZfSdWvoG6sH5BbYFylLMs11I0\nrBXJD/HVG4O71L1bvOHlVP/s1Sz3LsTaVRc+cgKzUySeipgV5RZEWyzUI/Kh\nCRzyPbaZHs0KoYfxgqonAu8WuK9mcE/6+IXG2Zj2ja1+BXAYSm1iWSo8gEzz\nu0+aDTvtfBsjveQLE/rDdSO6eA35VlVJuhTFeMQVG3dx13BKXxvRyWxbhHsI\nxu4Zl+L4fSTMqHMPtSl1WpGcxf4EtMIVHPQicyYU85PkzlmI+El+v329HIZh\nt8bj+9gVGsnaarXmcqtIFl/XIy2xbCaUuwbcU5MvIgRTLiWQBs0S4Ikji6pX\nTgrb6nY7Ui9Fyn9ukvfpd5LATLFohU/zIT+AIfm/3Bds0aJsEnuXarPdu4C8\nDPUn8oWLWFijZfjGoQW+BlB0HWPRA4phdXW+R7BRJ1ncdl+Ty6cRfPLs4t3a\n4PKF\r\n=YX8C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"aef50df6c5f49244a2b0e5a941794f4e3e4fd21c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.06930c96b.0","@material/rtl":"12.0.0-canary.06930c96b.0","@material/base":"12.0.0-canary.06930c96b.0","@material/shape":"12.0.0-canary.06930c96b.0","@material/theme":"12.0.0-canary.06930c96b.0","@material/animation":"12.0.0-canary.06930c96b.0","@material/elevation":"12.0.0-canary.06930c96b.0","@material/typography":"12.0.0-canary.06930c96b.0","@material/feature-targeting":"12.0.0-canary.06930c96b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.06930c96b.0_1620258010612_0.15225948723059002","host":"s3://npm-registry-packages"}},"12.0.0-canary.03f525f9f.0":{"name":"@material/tooltip","version":"12.0.0-canary.03f525f9f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.03f525f9f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c19a0e4f9d6de3b34e8f9bdc3c319295dbabe3d8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.03f525f9f.0.tgz","fileCount":38,"integrity":"sha512-AsO03fABi9IdPELeJjSOGR73ZGgkiSZMyqto32tU2Gl4UMYYLhiwq+u63vCpYMELvxK+w6U41jg77FknWhQL5g==","signatures":[{"sig":"MEUCICwHKhdvrY6w/yJCYdoM5+cakl/XMBG8XfqmRMZAo+E2AiEAk9ZjUuPhAh4fYAEXqAF8m3ps8ImnO25+vgkmsBbmRnc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkzjLCRA9TVsSAnZWagAA3rcP/1vJ8t+bvvpmeLsZ9tmH\nE4/dNh886YH163Ym9feTbm4w+T4wLp6MnL7C9bv7MddYxWBLOPhad8HvE3Uw\nD6BU2IXz7JZ+PdBhCkXFEm5AbpMT9h4yhIkr1+QVCBBRUuGHbbvbhNKlEBmU\nLyrE+JeiWRAAJ2xKlsYyV4EgpXPlThy+LNzm8p9GqpJPXT8Ti8cg/DvweU5B\nYnxd49FKUHEWO9xwVPqKuORaztxyt3Iu8bYfFgtk3WZhymaUzOvlHXesk/+D\nsAkq8LyK/awHWejj3OSU9IA+9tat91b2yWWaCQVjk9lh+tRCul8QmeOtiVBI\n0atBXTA0oQ1LdmRxwB+ABcpuwYokBTmslthuuCqQWxVh8rXqUGmDLWHjM0dV\npCeJhVqhTRh2eriS1x2TEmaX93L/ggnCOAiWUIQ30KrgRWzgZIzoluD+bOC0\n9ffwCgYACXHTNcuIUxsQsOLPnoxD6m5Amtf6rKxhddY2WRpe9acRjcde3cUA\nEsFX/gK1vRI3wMmxBTnTKHVGXqAQ8PRonCQEUum/BxoS4t58/QeyTAawMFvz\neJd368x0mqlSkPcMKS9nDlBgfWC2Yb7ze/uCMB7XDLjqmBYZ5o1qasF6cTT0\nbwzPdbMap8mSd2xm+W1UpXe4AIhyc3y/Ggcy3HRLh/MhLDJQ1GehWFs2ChZ7\npg8N\r\n=ePsz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f9df1400e21c75e46fe6641abb76d5840dede67e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.03f525f9f.0","@material/rtl":"12.0.0-canary.03f525f9f.0","@material/base":"12.0.0-canary.03f525f9f.0","@material/shape":"12.0.0-canary.03f525f9f.0","@material/theme":"12.0.0-canary.03f525f9f.0","@material/animation":"12.0.0-canary.03f525f9f.0","@material/elevation":"12.0.0-canary.03f525f9f.0","@material/typography":"12.0.0-canary.03f525f9f.0","@material/feature-targeting":"12.0.0-canary.03f525f9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.03f525f9f.0_1620261066727_0.11993139011187415","host":"s3://npm-registry-packages"}},"12.0.0-canary.e82ba2a26.0":{"name":"@material/tooltip","version":"12.0.0-canary.e82ba2a26.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.e82ba2a26.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3698ef79cb0521c3ac7f333e1f906a6deac93684","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.e82ba2a26.0.tgz","fileCount":38,"integrity":"sha512-lWJDvdk/DAWox0hH/UtL5b9vQXElry3Nchxi17fVnweEuPTegLxEav805l0EM8lXOAavrZYNsYlqCB7pG3lhPA==","signatures":[{"sig":"MEQCICgV7Mna30YE3+MuZbeFPVsTAVPfmV/3VzA7bW7XD9DBAiB9OVr4xUHo+Y1x0eKF9vyy6z9lRUXrMDnjVdzcVnq6sQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglBHuCRA9TVsSAnZWagAAfkQP+waQPSVQ87ULwswDJrRq\nX0Nu3+95DfI/0Jfzdm/S0oIX5jSGekxjcSnzTWP6bL3V44PmQN1oxDNJVF3D\nSR5DMOEovP9kV9CH78ZRj/7e2VxGkBcNYQ7QqezxzeneER6VHTCUrTp70hAx\n5DVKD5vliOvUCvhgAbO1d6RwFjjhE3gA8CYw6pCHj56IrDsAiMUAGjgmdDeW\ntaK10DjnBthVF9bztIDrYdegBaO2ixokMCo5BFbMVyP5AU1VJEXZR0lrbZx3\n/AYJRLE83PyrWf8SdUkvu1A3iUxfSts7n46SoEL0KGPGnBpSHRGz5uFPGmFN\nsndWlLdV6rSWLrUJ0hGOpqCfewK8mNa6rIDOIlYwj0AP0UMOAem9vrMcsdj6\nyOhA7XfVzradaTxkfLIhYfbkcn7XLWE9HV8dMOkFK5wRgc7bEAOGD3uL3hqY\nkqsjdjS4RTgZzCNXm5gNVFTUqIjXCPmDxiQFhWMM1hjVANP7oyyRRd7WYPzm\nOe2i1+gv93pTh0kZbb53zHpQ4h8MeIJ5HTM/wNkkVAqZSoaMkbMCbutQ8Uyl\nhaEvjFVNzR20e6Z1qL5dsifHcdKyGeRPPtzkifgbLcQ+PtREwe91jnAPUGaQ\nz+X63a2SgBqkt/NzY23rP1UWUGhbDp1/XHtt4Yl7JRL8MJHt+unVGaB2oYIR\nCCpz\r\n=SqGt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c3349c46dc5415cbb89b8260a8db012f44f09eec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e82ba2a26.0","@material/rtl":"12.0.0-canary.e82ba2a26.0","@material/base":"12.0.0-canary.e82ba2a26.0","@material/shape":"12.0.0-canary.e82ba2a26.0","@material/theme":"12.0.0-canary.e82ba2a26.0","@material/animation":"12.0.0-canary.e82ba2a26.0","@material/elevation":"12.0.0-canary.e82ba2a26.0","@material/typography":"12.0.0-canary.e82ba2a26.0","@material/feature-targeting":"12.0.0-canary.e82ba2a26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.e82ba2a26.0_1620316653954_0.4530142038031031","host":"s3://npm-registry-packages"}},"12.0.0-canary.fc7c4e5ce.0":{"name":"@material/tooltip","version":"12.0.0-canary.fc7c4e5ce.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.fc7c4e5ce.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c479ec542a4641b697f8766add1d1232a0430541","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.fc7c4e5ce.0.tgz","fileCount":38,"integrity":"sha512-l5UnFU+HRM64UzLAzxnEQm5WmoZBcKsHZJVUfHIDfe8naNWK8U3erhoG6bnJ2n565+k9fUMl/zF7P4TzD1nRkw==","signatures":[{"sig":"MEYCIQCJf2kZj86YnO22xhweVpCsXhGPOGiM33dYDSlVdn3b0AIhAKZbH/Vje98VIaJbdH4j3uiCQWbZtUfvSYDcSjf4ZMvq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglCezCRA9TVsSAnZWagAAilcP/iteTLQ3fGth4sT4FlF+\n2dTD8PFgnHhpZkKXtsXOjQ/JJbDO5oz89T7lmDnf5a6B7cxpVJKKu7xGDCcv\nrs/wNVxfQqCahjuVA0+9HJJ2PoeuqIc6VAVEafrrbd+rkRBUZVAZyVTjjRcT\nayHpUoYAStcoMNaV7SrFsPJQ7GnAYq7xH+i0xQhUglAAXrKq+Qx8K25vT+ji\njaGIAZys7JKDerNApx3RvC7gB3ftEWQR3tmE6UbDO39cknz3U8KI44Wa7hyh\ncgnh3+Rzh8lRA+zNApsiLmFWWTG+sr0HtZXPZcYjn31wluy+XuO8ecVxEr6u\nK1fEfkfN27uFmvOUA8X/JqGjCtgc1b0JwAUb9Ii1vZi8dShO/MuWESaUWGMW\nRNT+3HoiYkm5bAEbHXeDFrMe0q6037YFEeKZTaMxQ1NBlWumNItMKinmm1+6\njEPpLY8/x9B4wSM8JCRORSDtI+bygf4jWP/5COOijE9tglxbQKOCl5WhCMZE\nSDA7N8pbml/x3Cvaw1zpqJ9f1jkTLA2p0liNCtKIN1xBU7Dx+c6pAzVt95bz\ndKjt5mpMezqTMZJCFY4y22sP5smjfBtPIaXnl88V37LHcUVfdhbTbm8Xl6Y9\nNGklvhta84Rwu8Yh5NS2XapEwSZIzqsCqogElsf/iMJTFzl3llkXBBpy8aa8\nzXiM\r\n=+wr/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b549929c65e0a33cd9d427a600513c663c2dae28","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.fc7c4e5ce.0","@material/rtl":"12.0.0-canary.fc7c4e5ce.0","@material/base":"12.0.0-canary.fc7c4e5ce.0","@material/shape":"12.0.0-canary.fc7c4e5ce.0","@material/theme":"12.0.0-canary.fc7c4e5ce.0","@material/animation":"12.0.0-canary.fc7c4e5ce.0","@material/elevation":"12.0.0-canary.fc7c4e5ce.0","@material/typography":"12.0.0-canary.fc7c4e5ce.0","@material/feature-targeting":"12.0.0-canary.fc7c4e5ce.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.fc7c4e5ce.0_1620322226633_0.5427026753814814","host":"s3://npm-registry-packages"}},"12.0.0-canary.65c04514d.0":{"name":"@material/tooltip","version":"12.0.0-canary.65c04514d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.65c04514d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cc0b485a269dab8d7f58e52c7b13f32cb509de6e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.65c04514d.0.tgz","fileCount":38,"integrity":"sha512-TH0M7Rgw4EV2eCEZ9GXlEymtLQNGM6vSg2cnVJp8qtU/KJP7AKYT9QXf683UyDJnWTDb0mK1JOzHwnzVSIuhfg==","signatures":[{"sig":"MEQCIGoNS4uzhm25R7nCNITOJioKXue86f9q9CSdZ2QM4v3eAiBGr8Avik+D+WUqtULUgkltkjl0kJV7Lv8HSbaMsvaNVg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglDkaCRA9TVsSAnZWagAAjY4P/2luFUGy784CEGgdPLM7\n/xIba17dt3pawUd1XCbf+YipTlYcJAG2uTU5/gzeEZ8gXnLJz+VM/gLPo141\nZ2SE0fibhjSh0cHwti8tbzctYtX9ijuGdVJlZ9q8osQIBVvtGreML0QG/gck\n/fya/2wbBZd3l4iEGy44kbs0N8TZXbEpbAwWZbZD/LK89o6TTnVtRtFG6Jj7\n4oCanUaR4qXMa8jXzpXu5wudIEFfSGuIPMmYsV3s7rPbZggiwJP7fvmksAfm\nR9p1oaR8VN16fwhv0F32u6Cnc6vR4eShjAkbxxi3BWV6JAvmN7RCIA2Xk+kj\nKfiMdiwYYWiSfgj43d6eSpxY3anrG37le3tM3OtIMmNecQ3i3eZq07wQi2HA\nN/ebjJR+Yni04lf1434aUKIrkktQi+0xYNt67kgR7XOHWq9D9wW52my2rFnR\nbDjPDdn9plAft01kBQ38fP5w/Tpgmj/7j2dDwdcraMMv462MNbKHuzANgauu\nayLBb1at8EKJJKdiQ/MmzNrK6vUANYlFhYvXvptdZPjrVdgkg9LhHDJbNnco\nDbqv7OOUTEzk7naz5/PchlHu5CEW0tgOz7CnuC8H/OnoL1rOLuK0n4SWJ5Y5\n/4UxX1uYqUokX+ygWY0FBgx7OLAZ9KRBMMlpzXPiWrHnDEcrFXEGDE7JPhnj\nGD4v\r\n=Isgx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"01ca5daeb81d99750f9020fc62e04bc76085858c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.65c04514d.0","@material/rtl":"12.0.0-canary.65c04514d.0","@material/base":"12.0.0-canary.65c04514d.0","@material/shape":"12.0.0-canary.65c04514d.0","@material/theme":"12.0.0-canary.65c04514d.0","@material/animation":"12.0.0-canary.65c04514d.0","@material/elevation":"12.0.0-canary.65c04514d.0","@material/typography":"12.0.0-canary.65c04514d.0","@material/feature-targeting":"12.0.0-canary.65c04514d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.65c04514d.0_1620326681787_0.1935814569543095","host":"s3://npm-registry-packages"}},"12.0.0-canary.c97779ca6.0":{"name":"@material/tooltip","version":"12.0.0-canary.c97779ca6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.c97779ca6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2fdfc0bd73cd8ed5ccebf33f0eb842233442859","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.c97779ca6.0.tgz","fileCount":38,"integrity":"sha512-tdG2R7azaN4Wa9EAlL3+BzKhyld7+EWbe1BxSmVJjmAj0G3DGPWFh1p534qazKU980PqlLDBPA5wwoS3EqDj/g==","signatures":[{"sig":"MEYCIQCVYL+jB/cX6swpw9cX82HMph8k5mTC0DN/5//rXy7fbQIhAO6u6l1jaaLK958b/iav7R9sgp+VvbQGEKX5gDa07n1K","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglGMwCRA9TVsSAnZWagAARK8P/i4wfcjxtpZinC5X25Qx\nKiugNZeba+S6y93DhQnfPg5W5pRwC0uRO/sLO6FeZvu4ZwBn/JGgAP3bDOtR\nxCE6HlehYxXrZLaKFo5wFLH3H1TZ8uy5ska09CAYNmBnAavEXHy80UGz9mXu\nd5gqGpTAy2LcFXmMbRYyZqzVanHpzLhpvLqFUdqvtNenDV2VlT1aM9GqF0a+\nPc2E/vmXb7rYVu8PedXqmFgoZhfOuOSaaYVYQphtY+NJZC/32u7IupKU67O5\nuPGimrADas7dPRfM1gXNiZlb2LwOxFjlT/16MQ1qpAHyHJbugAfQu46g544q\nZBiBeU12itEyXc+y1lScGUhRvWiEkfhx85n1IrDe+KKoacuJq0tEYDpTMshd\n+Z69y/j4lecy3+2oKJz/A5jQjLuxyIbPOK421q2g1RvkpfHFOyJ+TLIYZzeU\ndTr87MkHa2bD6pBoX7osEmLxsKADQZZoiTjW6Ung80H6h/F3GKApyhJA3qlh\nR5PETa10c6Fqs5zX/LzIwat3rrq90cKRLuGs9Q5SAI2QLVPbjjw5y4tIqzD2\nnGSIdXYxlJjWJ26s8+ur8N5o2KcXZ8Ynu8DzateG/+JhIdS/YsEYWgN8OibD\nzqaSjqKAi5W2Bh4O4/tThDUaMe85/0qeYlsKZn+LF1S5lhxEtxwNSPvq3P/r\nnsaj\r\n=2/bk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"046f80118629481ec1af7c937a84ce6e0fd1f635","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c97779ca6.0","@material/rtl":"12.0.0-canary.c97779ca6.0","@material/base":"12.0.0-canary.c97779ca6.0","@material/shape":"12.0.0-canary.c97779ca6.0","@material/theme":"12.0.0-canary.c97779ca6.0","@material/animation":"12.0.0-canary.c97779ca6.0","@material/elevation":"12.0.0-canary.c97779ca6.0","@material/typography":"12.0.0-canary.c97779ca6.0","@material/feature-targeting":"12.0.0-canary.c97779ca6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.c97779ca6.0_1620337456023_0.4668862409647323","host":"s3://npm-registry-packages"}},"12.0.0-canary.869d890d4.0":{"name":"@material/tooltip","version":"12.0.0-canary.869d890d4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.869d890d4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ced18655f79fe5a95b9bbe9364af3779abd50db","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.869d890d4.0.tgz","fileCount":38,"integrity":"sha512-9ujM30SxEgm4mIySuR8DUxXAThbL0kkmhoL9oFVTp9M4vgOKC+A8T8pRF8NyxEjniato2AonquqF0m3sngvfBg==","signatures":[{"sig":"MEUCIEWCG+JDBMkWtCoMSvzqTX+PdPyL09fmGAXkQ3ENv4OcAiEAlIuLaWKGtml1utXTRTr31goh0rsCZTV5mHREQadILuI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglVqTCRA9TVsSAnZWagAAF4UP/2SMx2qaeG2/SpmM3rhr\nia+FJmEx2ykzL5MPpKx7TyhWcz9QC36AgjmDwstSg8gIg/vfBLfV3VcnyH1z\nXKPIGk//d56CehHEh8Jd77m71hcalR2jUceLVzPL6UGfUFbIb+b08pFetJUS\nL6UxWTCAy3o5NgmWyGVo8U2w6XsJsDZtqdg25jhV7fpak9dcjyKe8C2ZTr95\nmYfS1KUQ7WDyKHM9oPDrO0vYGFORuka5AZHVgq/cOcEn1pwRVGcQakbpz0Zq\niC/l5mTNj2KZLm1mJMrm/jfxB08/RlSvppKw4UaCtkaP5zoBaMHMPOcxlyBo\nQWKqp6pQ2TIlu4WHZP5XjvmwwVE1EPrgCyKHwSrE4rVj1B+QmfNcOBevNszV\nG5fdsOJ5Zd9LhIQEReAQ9e6nHD2cGYOJZhX2ha/83V6UdqD33jHHerDQGYKX\n8yvrnrobQNJ/tMPTMMC57NzECW8StXm1ddq0+uI3d/zzL5/Ch8zUMSpEtvKD\nN44tVrPG7gkQ3r+oSFvgYr+p0x7Euy8mubazoYtpAiEs0ToMepUwR5zGwq0r\n1XwmWvRNzYYzKG3xV/kpYAQbiJTaQTNvR2vRFfpFslzuHjR6U3jxk9q+yhqN\nw9EtxSlXm6H1MPgh9mDHuwTUO2BMEgzICuhwbIvvMeyB89QW9naWepERUL2A\n+Pll\r\n=Ag17\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"cd73688a61b81573744ba9a03cd2952798eb68f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.869d890d4.0","@material/rtl":"12.0.0-canary.869d890d4.0","@material/base":"12.0.0-canary.869d890d4.0","@material/shape":"12.0.0-canary.869d890d4.0","@material/theme":"12.0.0-canary.869d890d4.0","@material/animation":"12.0.0-canary.869d890d4.0","@material/elevation":"12.0.0-canary.869d890d4.0","@material/typography":"12.0.0-canary.869d890d4.0","@material/feature-targeting":"12.0.0-canary.869d890d4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.869d890d4.0_1620400786646_0.41867887016135463","host":"s3://npm-registry-packages"}},"12.0.0-canary.ec22e1da9.0":{"name":"@material/tooltip","version":"12.0.0-canary.ec22e1da9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.ec22e1da9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d338f1640c0e12361493fa9f5844df4c9b0c33ac","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.ec22e1da9.0.tgz","fileCount":38,"integrity":"sha512-6Yo1jjwaguM6pjMxu3hwYpI4CF9Y4zvyqn31Ohni0tncoDqmepkP9yW/fxlzGd+o4LEqCtdYNhW+hum5hrM5PA==","signatures":[{"sig":"MEUCIAzl/wSQCM8Y8dcibHjUVpoPXT7NWzmyVZ2d4G2Tc3owAiEA+YG4wVhUIkSyfq9Rw8TYTRmgsPcKVKDbgS+RhE/buYk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmXpeCRA9TVsSAnZWagAAPuoP/03Nf8D9MJnv+6obVFLM\nAmc1CowmwBABNMkKK7vF+0/dYYznqcadfwRKZja+Z3/q2xeJBM9sZSHrQOpi\n5Bz3AmEk05bTd5VdII5Sl/6d9IrCg3crkIetqU76UGVf/OctWI2KBdwWTxTU\njJUvqL8iiFre/Ra9qHMBxYfTlJ/a7nCZKRjPke+BlBVHLy1iD5A1K5blGhB5\nbHWD223ZoQ2UEFYOhJMhloY/nux0V+hYa8wjvhI9v1tvlMwRP9M0RNqzz8SY\nz1eTi9XmmtVwtgVDfBWSY52MkwQ4UBNBxQwtuMARFaCB2DgpIMlwVXqb1MYe\neLvi0JpnACrBxCIDsZbAAYEPKFZ/eGngD2rSnZwr4whNKj010k/CCBCW6LoW\nODSJhomRhxDRBQQlrFxkk5oiY/AyKaw8JLPjodCa4rZcON9JPL+tLP4Jq0Oa\n8YCLKdSmm8SNLVUSBZ6TW3XseLOL2qwLkb0K2ULjD5kIXqL0Fs8Xg5ULa5d6\nYTWXuctn9ToP1B3XlD9d7AXwZ+FESUwovEzGfR5DKQG+5WJIzkU0FnC13pHl\nSj44FA2YUDzcqqi1gHL445J2Bter/UjUylaWKz9udO95suXu9e6VQFu2INaU\nbyNrINLgAnWBb/RON42UannvbAn816dpkMFaFwMiiWF/fhMcOco+1sjqgkBC\njmCM\r\n=6RjT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"273a15f546b8d5df597771686f431c3726397778","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ec22e1da9.0","@material/rtl":"12.0.0-canary.ec22e1da9.0","@material/base":"12.0.0-canary.ec22e1da9.0","@material/shape":"12.0.0-canary.ec22e1da9.0","@material/theme":"12.0.0-canary.ec22e1da9.0","@material/animation":"12.0.0-canary.ec22e1da9.0","@material/elevation":"12.0.0-canary.ec22e1da9.0","@material/typography":"12.0.0-canary.ec22e1da9.0","@material/feature-targeting":"12.0.0-canary.ec22e1da9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.ec22e1da9.0_1620671069607_0.2087974528342924","host":"s3://npm-registry-packages"}},"12.0.0-nightly.7427449f0.0":{"name":"@material/tooltip","version":"12.0.0-nightly.7427449f0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-nightly.7427449f0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e431cca1615a6133ce6ace7148035751e007848f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-nightly.7427449f0.0.tgz","fileCount":38,"integrity":"sha512-Qpgm6cwdquFJ0se9EIJJdRWgOBaihoEiOpa/n5DD0BNpWM1TEFuc4pIifqBb1/EQ5IqrwTC1ssBwUbPGdtzc1w==","signatures":[{"sig":"MEUCIQCCiEoAqdN/4Sl5d5DpJVkTdx87DBJXWE33VoeBZep3RgIgF4vwJz9B8Fl1/H95JAyL83Dn/fQid0u2bapeoSuMjY8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmX85CRA9TVsSAnZWagAASOsP/2OQXYSN+5N+M/L72Hv+\nl2dGURqCSBjXjWA4mjDyTtKc3n6LFfUBvLnmcRIT2T3hPllPuFwgFBGX2Mc9\nsIL618lJ84jBDsTvb+CyZ4rI03Cd0OTy4Y8lw2go9CzSzQdydzX9tvsaHfHg\nS0ZuSCHRTmMszMz8ydhCTASb2Ka/kI/ryL1jEpkq0c+boXf+dqv+Bf+tQ1/p\ntYEma+Qzuu4SRu/unbtFIq1UL+08HLLYOGhgCRgwpT6vp58k+muCIQfTXPG2\nf/Un9hMzI6VgS+oQV62/K/QCJzZUQqsqDvKEQZM0LcD/wpMeYU9pTJjabOWi\n6coWLaq0btVYGbaNLjh2zv91kGC96s1caCg0iJwlf4keBlWB0t0GDwESjO99\nsZvwKQ/jVGcz3LB3Ri9cKj1dadLz4z+Z3E0epskiUwV+Snw6JjE8/N3WoaZp\nzmZ4hfnxM3WJCc5lrOH6cLXKObMNJDhBKNZCo/8/cpz6T2jnVPRTMJ/OKTV2\njssdxhwoKis7U7jp/c8zEBCsw+QRS4qsj+MO0V2j4w7+ld/L3vh8mQhNwl0G\nE+3IRS3P+MC8o1v4eWiBdR3A5X8CpWwiAwDm8smJkOB2SjOVcv8toIf6jnXt\npdXSnuBCCJp7Gc0TpQ0cweWui5yJFRA/j+zCdren6VdCXbXgENYigoNHxYGz\ng1aS\r\n=7yOc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7427449f09e9521a6deba6ba7da71038c2fc1f05","_npmUser":{"name":"asyncliz","email":"asyncliz@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.17.0+x64 (darwin)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-nightly.7427449f0.0","@material/rtl":"12.0.0-nightly.7427449f0.0","@material/base":"12.0.0-nightly.7427449f0.0","@material/shape":"12.0.0-nightly.7427449f0.0","@material/theme":"12.0.0-nightly.7427449f0.0","@material/animation":"12.0.0-nightly.7427449f0.0","@material/elevation":"12.0.0-nightly.7427449f0.0","@material/typography":"12.0.0-nightly.7427449f0.0","@material/feature-targeting":"12.0.0-nightly.7427449f0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-nightly.7427449f0.0_1620672312869_0.027388293783311424","host":"s3://npm-registry-packages"}},"12.0.0-canary.957cc3bf5.0":{"name":"@material/tooltip","version":"12.0.0-canary.957cc3bf5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.957cc3bf5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cebd74edc1e87b5d9c07eb9996b9da70220e634a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.957cc3bf5.0.tgz","fileCount":38,"integrity":"sha512-dGoQdcv5zbVu5ClNbeXZdCypte86kNJW6GDV3UzgOe+bmhJOKBrc6+tSqKsfYXDia/rsJgVgCeuhPl0/yUAGQw==","signatures":[{"sig":"MEUCIQDwoc34XJkLteCpS73mBkajtnmN37Mh00o/XGCRfNRyXwIgZlT3IDEYWiItjTaglaCVuoYLVzQcYezhBWm6BspqaWs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmaxeCRA9TVsSAnZWagAAY3cP+wYl3banSigj/IKj2+kI\nP/N8bDszowOh4917LVEvxHMoNWwLpArtbk/R70zbuRepVcsCiAgj7pROIsQ6\ntDD5YKMEpEIp4m1NwS8VLOQez1HcjeMvD1OdOyv8qwuNj24ReEBqtcY+qOd3\nsTsRwM7mMLsH5B1ZPdzChrKDl2pyAmh1V6Pjq3S0/VffYKC0pKfQhT7bC94W\ngP2b3wkC3GsOd/+tIfYjbHxt72CvCf9nrsXh7Sq9FEJ20R4i8e85CKU+7z6p\nbGD634tQ0fl/AGSbtDb2oROWLmfEwORyIiAE7ar5xK1c8ml1l7cjVtJAb4vJ\nIkgbSiB+s6mWYSMzA+5GQkabIOn6SRxDp8/8DxjFEEGq25ABxCA1vplqMaXN\nUR68dEtXD93wqjmq8kQxsnMI9xQPd6BZpEo5WoAuCXIYZrKqv4esnDr6dESf\nG+8z1iF1vy+XR4LBrED6CFEwkA/wLX7PMKqdJn8AhgfKB4vev6JvaDg1xpEr\nMU5oBuiaYx4ba67wI3hu6cm7vLiPt8gp7cCFAq2onMClP6RJhdtjc72GC/23\nXq77QFq1C535x+Tvx17w15COZxC4JmHcJqIo6jBJqLswD2OT80rjCo/anz3N\n2dPV8uYNa9nVLml1o7eWEKNkjBn3QWvVKM7V3OcGOlX6JpJRkrvmT3IWkl+k\n7lja\r\n=ILL7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3c29cfc65a597598e2a8e1841ef1af72450500dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.957cc3bf5.0","@material/rtl":"12.0.0-canary.957cc3bf5.0","@material/base":"12.0.0-canary.957cc3bf5.0","@material/shape":"12.0.0-canary.957cc3bf5.0","@material/theme":"12.0.0-canary.957cc3bf5.0","@material/animation":"12.0.0-canary.957cc3bf5.0","@material/elevation":"12.0.0-canary.957cc3bf5.0","@material/typography":"12.0.0-canary.957cc3bf5.0","@material/feature-targeting":"12.0.0-canary.957cc3bf5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.957cc3bf5.0_1620683870256_0.3381894403930106","host":"s3://npm-registry-packages"}},"12.0.0-canary.88a33cd70.0":{"name":"@material/tooltip","version":"12.0.0-canary.88a33cd70.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.88a33cd70.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f60bd4f7e4a21513ef1f74b85260b3b05110bc28","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.88a33cd70.0.tgz","fileCount":38,"integrity":"sha512-k+pOxrSCNd1A5B2q/PUR7mVrbn+ESvXHE3ayOCnK7KQ4tl/Ys32pl2JTK1h+s8m+uIOKjzoqrS8l+j6QA3f8aw==","signatures":[{"sig":"MEYCIQCc5HFURiQZr4eYX1QRoIRw2aSvEDtKQp1sIeifmmi8TAIhALuMd/ZR8wEWghNagDZ5m6k2z83bTqST5NsZlWtD4tzU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmctVCRA9TVsSAnZWagAAz+UP/1axPG6Dlkz056nvJRtZ\n9ee4qHzaFOuQbcquIRL/ToeYXpGzrJxUw5YvYpvaXMSKtJA7fb1LxHDuebuD\nYdmEo93bcbfzqxTqqwh+smdhaLjFaLMGCn6oo0qSU4HUmGBxmrw3jBZNPpZq\ntuTHrkc5wE0rLHBtdW6oMxB1qmltYAmvJ2RhkU1YRQ09H7KvNhzOgkRGrzTC\nbnIuG4uOZ68gHFLuJ9P0j+SJhgtYbJTeHAYL5bHc96vYWh/O0eLoUjm/GHtd\npiQwJJIdpfB+Wadun6d+NYnxD/ex4vVrvM2RCaJySAA/DheEryS9b0vz1hoN\nji8fFoSgApGh1uq8OUuZbu8QvwwhJVWhPK4S4ZaiRZV+sHkoe2GJOJF0VWcB\njfHaRHNdXy33klOyfGTNZvEHnpSXF0fKKEcWOQr5jU5Z4RpBbXYBOa9FZeRt\n1rFTReG8nIYo1ZV1vyUqyYDR5jf4cRvqIc7j/uB/mSBNOjDWUT+SBY89yy39\nUZMi3IMoU8am0LC2fgaG5vr3YrEYjuhM3eC39X3h3Yozgk0xHNrSnTrLzR4l\nSqvDvzKqu23E/o6I3x25wnZIpJuMcL0kV9BYhX7/drs4My82gfuK20zYbc/n\npppx/xs5isxUSWnIkx0Ot1pae9KMKDC58uZGuFlyE1/hycAZbhANMrOcxTdl\nNeSZ\r\n=pxKg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f1d341efc173e89bd2770326eaeb1fbc581c9648","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.88a33cd70.0","@material/rtl":"12.0.0-canary.88a33cd70.0","@material/base":"12.0.0-canary.88a33cd70.0","@material/shape":"12.0.0-canary.88a33cd70.0","@material/theme":"12.0.0-canary.88a33cd70.0","@material/animation":"12.0.0-canary.88a33cd70.0","@material/elevation":"12.0.0-canary.88a33cd70.0","@material/typography":"12.0.0-canary.88a33cd70.0","@material/feature-targeting":"12.0.0-canary.88a33cd70.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.88a33cd70.0_1620691796823_0.6380966501678373","host":"s3://npm-registry-packages"}},"12.0.0-canary.d20dc6dba.0":{"name":"@material/tooltip","version":"12.0.0-canary.d20dc6dba.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.d20dc6dba.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebe134570b19d0f94638830d71c3cfedf41e2bb3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.d20dc6dba.0.tgz","fileCount":38,"integrity":"sha512-MD1MlIgEaBVz9JukVmr9p/mR1AfGhaNLMHyLXoBoMCLPwhSLaFVJA157DC++wtnBk27Wigbftb5UO+kaiEX2rA==","signatures":[{"sig":"MEQCIBl/SqCLUNPWt3/uHWMa6Sl5T5/vmakuHaVOAjaH2F/3AiBGB9Aw6rsTCG1YuBPLlqIJUlPydI9l/54XiqEUX4QfIQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmc8GCRA9TVsSAnZWagAADJIP/iABjbSGsLuvx/73Te6Q\nF6cUFNXKYs6FHMLxcgK15upRGSLNcw87Bd7bvqVRQ6+O+ZllkynC7rofnErQ\nMv8LgRmwr5h96hbqmfTPdh+Fsqu1w5VvKLEamPb3d53jf7r/eA/QFuaqC7cq\nYcXME2jhc+VVKslP28METEG1cKdRe7sfQEdCfWZBTVTRtJrKBtoXI3dad/MP\nNuN/KueQh+xUcvJDkV2yiLz6MJf7CZejlZb1aP989Ve4G5wH6FhyUfOjd6JJ\nSIh2+TcuNfjGycazi9C4YpwlMrByNF4ox21RFm7zS84knqgaU5FBSVNRECx6\nz3onOjlzz2pIdAW91HVsXBSb3PjL6ZUo73xjhDwy5zdYFs5dLJeoDOLpZFfb\nmqpwVLZKAtsOkr9e6VoRhQkROfz9yOeV+/rSl6aWgQPNt8jB80gMt4GtrSi+\nYiwe9j8YSLD+T6qA79h0vW0P48oGb1kbHeqy+hVJlSg64fND0ohN30aO3rax\ncMmjROZjPzy0FFyw1Bjv2yRoUnQptSBIRypOduOgbwcaCEY7qm09s5eBEYFL\n/NsPc4dQ4R3ZQFBhuU+BaaFuTPSOkL1/8sHWre65lLRO/Ko7eXeRPO6cpi7P\nRV6NloUDDvjWNaRZNMCozzwxoHjYPXQF7/8mfS4SFhQJFxVao00qtZOED3Aj\nnnxU\r\n=r26a\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f2980d3f7fbbd8d2e3b824a765f7fb03096bf11a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d20dc6dba.0","@material/rtl":"12.0.0-canary.d20dc6dba.0","@material/base":"12.0.0-canary.d20dc6dba.0","@material/shape":"12.0.0-canary.d20dc6dba.0","@material/theme":"12.0.0-canary.d20dc6dba.0","@material/animation":"12.0.0-canary.d20dc6dba.0","@material/elevation":"12.0.0-canary.d20dc6dba.0","@material/typography":"12.0.0-canary.d20dc6dba.0","@material/feature-targeting":"12.0.0-canary.d20dc6dba.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.d20dc6dba.0_1620692742385_0.4718306232212617","host":"s3://npm-registry-packages"}},"12.0.0-canary.0ce2fdb02.0":{"name":"@material/tooltip","version":"12.0.0-canary.0ce2fdb02.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.0ce2fdb02.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4438d433aa97dafd295dc9f0de76643ce618f2a6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.0ce2fdb02.0.tgz","fileCount":38,"integrity":"sha512-DaIMonvLywnKMR3sIUG194RfqNy7lJAWbv33LMO5ZqXno/NX+HAVnDynbCpnC3qYXtPwE5HOw+bmeXlEPUbGbg==","signatures":[{"sig":"MEQCIDlsaJJxYSz1T4YOIfva1cc9Zo0qyN7QxZV3gr4Fp60jAiAZgYKVAVIYWmH+k8yE50+wkjZbGFUI7by1Vfp2qWs71Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmdb7CRA9TVsSAnZWagAAraUP/06AVXw2tHsfyYnxGdgx\nSJsBXU5tV5y/LoECNKJQOSNuiq4wplMf6O5W8EDNrYUaQq6j+QHQP6B8Xfmm\nwI9wU0O+yjSBxMdmdTZpXxJpcb/D+xJ8LABc/OG97oSBAElHBFtdku7I8hts\nZG9eSyvDIl13y7MOkzfR60DZ0mhSi7clXRXBCGMQoT/Ev/YaMkwuZg3vNRFc\nxaiC0xb4knxrDJgSk9Pzd5obChTvf7BJcthZKaUj3XiHRx0//UXQg7Q54vyD\ndjMY54u6Os4UEWrOeH7daWZ0jz8A7qNs/OPLh0nsLmGdJv1bz6s5ktdUOnt6\nSbK08GQNBxC7x23ZKjCPzPGq0WSKJN0guHi+X/IEIbDNF35lVqO4Wz7iTb7I\nUcertxVFkCY73uHyMsGrzmcO0erutDI1qsTYT/ZVjAjtCiAY7MCxE/MkdKkD\nrx8HsjCPZ7d8EzqU+vk4MvDQgvkYBPCbMXSQ7lHSWhXlVi8GxRkfEEBroWX+\n/KzXcgRiELfIO7iBt8P9fex7N0xS3H8Utc+xyVT1pyM0w0sn32Msg3aF8D1S\ng7/SV3R8kURVAdJREhw859B4Wqia/obeJdXk+/HlOwIpSfkbzQn/+Qj138NJ\nMqDSTej5qQD46MiEoK5pO9+rKMARNbBmajbehNulUf6Kpd0sP8u3hWJE+fWb\nLncS\r\n=qlJp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ee2139d87a1d755a50dc6bf0a6dd53a2f39548f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.0ce2fdb02.0","@material/rtl":"12.0.0-canary.0ce2fdb02.0","@material/base":"12.0.0-canary.0ce2fdb02.0","@material/shape":"12.0.0-canary.0ce2fdb02.0","@material/theme":"12.0.0-canary.0ce2fdb02.0","@material/animation":"12.0.0-canary.0ce2fdb02.0","@material/elevation":"12.0.0-canary.0ce2fdb02.0","@material/typography":"12.0.0-canary.0ce2fdb02.0","@material/feature-targeting":"12.0.0-canary.0ce2fdb02.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.0ce2fdb02.0_1620694778697_0.9008493839658105","host":"s3://npm-registry-packages"}},"12.0.0-canary.cb162da37.0":{"name":"@material/tooltip","version":"12.0.0-canary.cb162da37.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.cb162da37.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ab2d126dcbfc784ff6eb015f879bac509f908d4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.cb162da37.0.tgz","fileCount":38,"integrity":"sha512-ADT0U8g50t5AQC5RwSl+KbTc8dpFPz46/0b7REgvRQROtg/AyLlyXTKB18L3so3uez6Y39NUL5Tnp5wJzytGtg==","signatures":[{"sig":"MEQCIDZ03+Myz2jBB3/RxhIxfFuZQc3OXzjaIGh1gHIGIyAvAiAXnsBS4Q49XbZUNuprghT2x1rz/fc04lhMp/Q4VBLstw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmeUMCRA9TVsSAnZWagAATKoP/ikMkqhhqILItESAtlA0\ny/ItFVvCh4nzapIkh9WQDe+ah+3HVPJNKeLlK1M8MamLyBYhSX2RDmiBksoG\nRWSIbYqqTvon+f9tuWGDDW3eY1sH9YkP1GYKfnyPiVzr992riOrChfzJH8YD\nbev9WTn7wiwVzEIpO1KKvYgWM31g1wMN8c/NekKxgOMJaeELsUaU7MA4bejI\nLymFw6BbrNe6SiGiktnTFfvruofqUSqBux3W3TlXG1bEcRPU/8ZIJAmo+xIt\nfA4MjRkznvDkwDk25TWoEIkYqcs2nGdHQoHzJqc10ZhiTDjdEq6z9gqPc7K0\nWtzX7JMDYkIYtmNFDXFWpkmf52yG0IDqqC4W2LqtfyF/Z8H9iGHGE3z5sT70\nejEjFloYpocZd9rj7tmA1VVbHk2AQLzhYWZL0X3xTFGgYqOq+G1KkP6IWY0M\n2VdvUrUJDu0p/PECXmsQUKG7va6fcEX2ZC/CZA3h9ZAXu2AblGcDYgv6Isxb\nDjleFgyKLGhwUtke0p3DH5P1cZHdUgB7YFJEs6VdqCZlNVjpxuGqbMeEA+Q5\nnk01GkjX33DELzwPcG1sWC5nH6tF3SUFDiS9MSnXdxhLjtpBQ+VkO2fzaCke\npca9mh1GvGjkxVSLgDZ3YM/m8LsWquqtYYZh7Xg9znVr7sPM3Y4WsIFHoMMr\nZXny\r\n=CZsG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9858adcc9ed7b1111dde19951ba96847bad0beac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.cb162da37.0","@material/rtl":"12.0.0-canary.cb162da37.0","@material/base":"12.0.0-canary.cb162da37.0","@material/shape":"12.0.0-canary.cb162da37.0","@material/theme":"12.0.0-canary.cb162da37.0","@material/animation":"12.0.0-canary.cb162da37.0","@material/elevation":"12.0.0-canary.cb162da37.0","@material/typography":"12.0.0-canary.cb162da37.0","@material/feature-targeting":"12.0.0-canary.cb162da37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.cb162da37.0_1620698380031_0.0011620025488399133","host":"s3://npm-registry-packages"}},"12.0.0-canary.573dc7ffd.0":{"name":"@material/tooltip","version":"12.0.0-canary.573dc7ffd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.573dc7ffd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2f977dae4c53e9026dfe0bc9ded87eddeea75f30","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.573dc7ffd.0.tgz","fileCount":38,"integrity":"sha512-cUZjos6bR/hDgmx8vIAqSyVMAq8TQdaMjyvnGCDPKZGqzofVTyqV/kOz7PkzW+m5KlnYYMhGY5bLdIsJ8BgC5Q==","signatures":[{"sig":"MEUCIQD9r5T2FGN9FcSGMhj1ya6T8gzD5tSIdGbXoqiyBibToQIgCeADGNyv6N0UigMuHgHqQc5LN9hdBU9JT1PLp0l4Thc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmel3CRA9TVsSAnZWagAA09AQAKNOensyl3eBdp9EQq08\ns4inzYwg2WQ3mVrm76TtOfFXuBejuOUDdEqgT5U81cjNFJX8lzkQpaMX49aU\ngN+bwLIfzxEvT+Wp2ZQ4DEuuiL6j0/rxhh49li24ZfuliV+kNfKcXYQIfSLs\nThswdHVULoOSbfzOEBJjRoJ+aQMB9zWa+scul8r9qnrK40z9nX3YuLZPtAPT\noj81I3fkIPZteB6nZWLHgfuI7523W8v/cNOWLCkGbEMXBiOpXzD7Ppkv/1Ce\n2mAnd0Ll+DggyX7cpOAWhlz+Wm7VV2Fy9EQ9qd+Hpju5mMI4/E7yEJGCAT+Q\n7ITzkK0/bNX7FWBQoGHMwZjlLBWY21cK9Jbb1pcm+ul8alNCmNoUKX+vkOci\nxpuOY9D0qLMXMiqOUA4MMEOuqXfg5IpGUGrxb5ph+l282Hcfb/UZUpfAHYGX\nvOtnjXJvPnbuL2fd6IfqQV9jYNTZRfrF3rjlIMBanqJ+QjhqGmg9Vs2wDX0E\nt3qdCd8F99W0O7rKAjpDihS9XzxMf+GQgilZcLwZnuKi3O5fhJX6Oz257Ode\np9Y/wkQljLRvQU3u2C0oe2QV017ADt4wVPaVwFOlBkc29Gt+04tSGgZi8uW1\n8lJwaU0O/32hq+KFEqQ2j/WQS9Eglc+ij1Cx7Ch3pLFqL4maZM/RQ6419PmU\nD9or\r\n=HMBF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"67aa299a5066425730ea2e8558f89c111a5ab156","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.573dc7ffd.0","@material/rtl":"12.0.0-canary.573dc7ffd.0","@material/base":"12.0.0-canary.573dc7ffd.0","@material/shape":"12.0.0-canary.573dc7ffd.0","@material/theme":"12.0.0-canary.573dc7ffd.0","@material/animation":"12.0.0-canary.573dc7ffd.0","@material/elevation":"12.0.0-canary.573dc7ffd.0","@material/typography":"12.0.0-canary.573dc7ffd.0","@material/feature-targeting":"12.0.0-canary.573dc7ffd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.573dc7ffd.0_1620699510846_0.2329030707567612","host":"s3://npm-registry-packages"}},"12.0.0-canary.d5f6ad3fe.0":{"name":"@material/tooltip","version":"12.0.0-canary.d5f6ad3fe.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.d5f6ad3fe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b700ecb783fb3ed2dc95f215568f04eb9dcb1dbe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.d5f6ad3fe.0.tgz","fileCount":38,"integrity":"sha512-CPFURl8lC+sN7OYRa7AOZrZ7o+0DscJBQjQ2LGRA8aL5zhxxaXoVkXGwYHDHaaG32kaBB0YeuU/XGEChvdZWRQ==","signatures":[{"sig":"MEQCIEumolQ5fLhUvwcS4hfOmCkgBwWCdDmg6ui6V97VrwVjAiBF7xrshAegmUxOkX0jLs4jy9rqFTeOMoTS+tW5NUZLvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmxH0CRA9TVsSAnZWagAAnK8P/iCHa/HIUexzHkph99Zx\nb6k6OH5hm82KkQLdyQCIR+55ZJMR2WyjznOPopOKt4ONJCKaQZG4ti6v0dRJ\nGF06qxerXyxax3m4XK+STzMHbOzPynI5nWAAjN0ed2tcWHF2TqwGgk1KcZR4\nY/OEn/gmkQb3AmCqiGOCxC+0XsBpNlP2lXIhqjjMIH7ljDlRw813pBs3H3og\nvPHQy684tsW44+PZuROyjyZ686KpqfbyLXsbwDcMzAyBL/ZcAFBftYtb78bZ\nsfG09LPcKwVaEEy/Y2px4Cgub/vTYCCU+/rCldIVu2JkdfRZsAePZgTi8waS\n1XgugamZNEsvCiwEjQVOPxbh0gcOsy27MydKt9G7wP7jZLIYrcMjDcDL2Gq7\nmVGU64CWpAe8XIGF2XOka0HwmDpWPfL4385rm+8yyFdTNjtBgFvzd6wc/vbp\nNkjS9F7e/Ehu41fZ9s1dLiH9QuxGK/7qSKZgGtDHvoc2AiPPGU/Qspqz251N\n73GqCi3AfDk0pfgtgCM9+pBh7Yn1jv5yFG1VAMEBVsBDjUqpUnae+ieMvtFQ\nqPVAwSsu/cfJW9YGu0f5Frc7bLqyZxCGimRapWwLbKazW1HfB8jASp6I4jlA\nIkCQXikkpOcVZf4VFh1ok2LGG7/RUWeY7/ISHzsF8umKdpJazemO3hqhAV7a\nVZAA\r\n=QCCt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c0bf85201107dc8a95576c2392f5b1771bb2c969","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d5f6ad3fe.0","@material/rtl":"12.0.0-canary.d5f6ad3fe.0","@material/base":"12.0.0-canary.d5f6ad3fe.0","@material/shape":"12.0.0-canary.d5f6ad3fe.0","@material/theme":"12.0.0-canary.d5f6ad3fe.0","@material/animation":"12.0.0-canary.d5f6ad3fe.0","@material/elevation":"12.0.0-canary.d5f6ad3fe.0","@material/typography":"12.0.0-canary.d5f6ad3fe.0","@material/feature-targeting":"12.0.0-canary.d5f6ad3fe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.d5f6ad3fe.0_1620775412317_0.8284013007750626","host":"s3://npm-registry-packages"}},"12.0.0-canary.25751d2ed.0":{"name":"@material/tooltip","version":"12.0.0-canary.25751d2ed.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.25751d2ed.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a779c5481126b9bea9a615542e8ccbf7e92758eb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.25751d2ed.0.tgz","fileCount":38,"integrity":"sha512-K7rY1aG85dTbFMRVNScSbqy6wT1FPoNlCdZsTRfomTMziyTVmrQkGWCkOC1BlsEq7MRIDwJ8sceeefUoR5ZFqg==","signatures":[{"sig":"MEQCIA5CHG2KwgGAn4FwaMpqYOTlnlcXMHQne0hHreHRkxibAiAXTor9C/Ld3sGhHOJCcjhtgtQngj5qM8lX+Gzz6Q1pGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnABpCRA9TVsSAnZWagAAs38P/1qwMFtx07KcK4VTZosi\nmpCOtwJ2+ItMTDQd/7rfUqiYwLFpRTFVLzjxcUyiU7HnH6gBQN0+Ww5JVtLH\nedbwvZv0+bZZa20MnbmOnqFByrqEhaaYIZyIICYDateOkCRBvrJjCK751bZD\nIufq5k4gxWDk0I95s0CThL+KtGSyzPnH/q3Ks4avUr3FIF1yzCOLR9O/E1Pp\nzwKuHP/C76/mVDhNPf866lxjOzmu7dGwKKtdx7p48YtL7wOPQQhrIIb7tE/B\n9aAgGG60yKlIZtvBQ0c+xmRXNqikd8+SyYSQndvPdv3TrySHOt3BhH1s6YKe\n127t5sVWZJgwq7wHsDzIYXHmNkLHWVklKbWrkowAuaPy8auhlD9h2pc5YRP1\nSvpZ6YZtYkbdqQ1/+gkdkdGWgyQo8hTJrCZeIZRpSHsr8lidnvLVvcbvUrSX\ndItiY0u4adk7MNRAqzmm+V2SGAJ+ZEKiSu2TlJ+NcsBePGGGt+2s8YpOlVJ3\nSVWi5wwDC3ttNv/o4jeAar6mbabkuDL8SgvbtOfRnch72tJVJUj4tozqj5DS\nPCiYVmNizodnNXqDuIqun22IZom8Bj+fcrV2df43UKJ468nHMZnn4UdUSjlT\nBX/wPZ4iHO/rPB1dYathpR2gF6dIe61YQPIOIkbSkeR0Xs/XeYSC9Q63vbxK\n4YQR\r\n=oN/0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c38dadd226475a1dd91a992667019eefec273bbb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.25751d2ed.0","@material/rtl":"12.0.0-canary.25751d2ed.0","@material/base":"12.0.0-canary.25751d2ed.0","@material/shape":"12.0.0-canary.25751d2ed.0","@material/theme":"12.0.0-canary.25751d2ed.0","@material/animation":"12.0.0-canary.25751d2ed.0","@material/elevation":"12.0.0-canary.25751d2ed.0","@material/typography":"12.0.0-canary.25751d2ed.0","@material/feature-targeting":"12.0.0-canary.25751d2ed.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.25751d2ed.0_1620836457087_0.9062419609455594","host":"s3://npm-registry-packages"}},"12.0.0-canary.a23ecb682.0":{"name":"@material/tooltip","version":"12.0.0-canary.a23ecb682.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.a23ecb682.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5bc65e51e2a7a0f9972fbd6636248b09d3c580e5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.a23ecb682.0.tgz","fileCount":38,"integrity":"sha512-TC70KzRT0oq0kmRlXFMCcaWhI3FqsI3ka3+/n2xLr7w0Z9yyR40Gv5kq12teogYzDqJ4P2kUVhuHd3GKbbNHaQ==","signatures":[{"sig":"MEYCIQCNaq0PAXlyt3n4Lv7W3BO/lHWhe+EPpyvH63wBq0A6OAIhAIC246bSjZ7SNSO5Aze7M+TgFkRFHIelAfG1wFnnX7rP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnB1PCRA9TVsSAnZWagAAo2YP/0QkOaZ/JE6cYFjck6Qf\ns6GaoVr7sJjGnov55uyrAhd+ZgVBvkDq0VRBqAIoReD8qswh2HWLXQh0f8nk\nHsbzQcato+yZjc8h+ciwDmj6vci+IPkVh4p3+JbMbdLJ/b4pFVxlpTzuBDDg\niFPgp5WFnKvqFhHDU4xSulaaThz2Y9jzm05oyscZS9nEgvcBRIPbWabtVHmC\nS88EzKfUxjoFZk1E8fIQnUyjXD+b1rWy6YZyxyXN+vnN6Jwwbta/y08KxHsJ\npAaHnmZwwrikXfx292YalqnSxAkquuoZDaKwTtNkQLglcOOleDws47Wq0s93\nRjKarIVuy9xQhH4yYvCBuFiO6uvP+i8OHF+6ssAj8RItDHjtwdZfZBKPziiH\n4bXiqaWrmOoBxLPsSrTUytCoaoMC3LxS0wgRNyxLWkS1ONV2h44KN9qL9oR9\nq5A0j8T+5tolLjAjP0l5bLYg9u9pvmAtZgWFcsJAjcP4JMPrH3K1nksqSRL4\n6kzxfXutd9J/HM3oKXVBp7kd3RmHzhoSu/BPUiFdGF1PrpZvb/LLsU3YNxNV\n9MiaU9k82E1xDpw3dav/lx3z14Ml0zD+cckVacPvmWOe5g0XpBU9c4oo+kVG\nHA/vVcEeHrJZ9BJTJiY7VKJu6kqF8zeapWTR9yeEVZ+TMLYDibD1zd/9Huc+\nnVrt\r\n=HCke\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"da78c3f024a21d0e0df18a30c887082b202d7269","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a23ecb682.0","@material/rtl":"12.0.0-canary.a23ecb682.0","@material/base":"12.0.0-canary.a23ecb682.0","@material/shape":"12.0.0-canary.a23ecb682.0","@material/theme":"12.0.0-canary.a23ecb682.0","@material/animation":"12.0.0-canary.a23ecb682.0","@material/elevation":"12.0.0-canary.a23ecb682.0","@material/typography":"12.0.0-canary.a23ecb682.0","@material/feature-targeting":"12.0.0-canary.a23ecb682.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.a23ecb682.0_1620843854577_0.8086654604841474","host":"s3://npm-registry-packages"}},"12.0.0-canary.33a954852.0":{"name":"@material/tooltip","version":"12.0.0-canary.33a954852.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.33a954852.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dad34daffc5b1d1860bb6e9f23fdc081c49a5d49","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.33a954852.0.tgz","fileCount":38,"integrity":"sha512-D0pd84m3dJPcna+cX4YDJwIh4LMGXAf5+UwbwFFD2TB+KE/aXbWDB5elOLOXQntcEKedRxSAxAOwUcY3cvo7ww==","signatures":[{"sig":"MEUCIQCaRBrkuSVFQJMePF6DlPRRjD/Vvo3K7L+uI1KDka4BiQIgJVWdrEHSZBa3jUXjS89tCS4GdgomoAuxvMwXMSJHXt4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnUD/CRA9TVsSAnZWagAAJK4P/j5eZwgd7YeBDjUrxay7\neVJO6zZZ6CV03CbCI2ot91OJeybdBebAl33Quefw4SnbLigfznksG2RlfkZm\nyHg7nXabUeb0CAzTQjGBqj169Qqc7xrVRkumf7XeDQLHhIJYv9AxB6TqLDsO\nJbVJLl52evM1FeLYCtnVTGNm6M1P6jkRVw3Zlsot3ciImPB2ibjckflR8ZCu\nqg8O0T0gYOEc5SUEcC5m0keFTiOKTiW8A/QEP36qu1GlQaTQkxhrv4XF0uKM\nVrM9YUcJjkLZ5RBsPot330iEng0cV9kB1mkpgQ8YIxGIY1bJjWsusG7gZOze\nsO2jqejo7uGtsb7za9tFeR++MUmEf75TwH2OsGMxQ0nKoFrq3FHgr2OhIy0i\nsXIZdxaWDCvvD+hJYDZFfSK923/z6vuud0hsrFUSP8+B6kkQqR+O3YG3VpNT\nwINv8ZDlMTjDpoyJN+mDJX/B1EbOu3Tz+GwZvWuD+cGhLfwaGo5CpUCbc7n3\nz7xULg7GdFNGusbAzVSahZo78x16crK/pGtEy5+i/YXe6YwOgrVw2FBnrYDt\nAV5o0Uxia6n90B0+Q6GBmNRvI1qMGzjy4iP0lxy3AtgJ4ywlueHYi5PYBS6L\nriCPOiAoBfiRkJEDfIRBSgae+lTr6XQZfsyIhbJtCsYMxKwB9uN3iyNAKJHT\nfQf6\r\n=QMTS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"703dd5ba6a1225efec74655d3393690dca1922eb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33a954852.0","@material/rtl":"12.0.0-canary.33a954852.0","@material/base":"12.0.0-canary.33a954852.0","@material/shape":"12.0.0-canary.33a954852.0","@material/theme":"12.0.0-canary.33a954852.0","@material/animation":"12.0.0-canary.33a954852.0","@material/elevation":"12.0.0-canary.33a954852.0","@material/typography":"12.0.0-canary.33a954852.0","@material/feature-targeting":"12.0.0-canary.33a954852.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.33a954852.0_1620918526782_0.7957745911082565","host":"s3://npm-registry-packages"}},"12.0.0-canary.a4484849b.0":{"name":"@material/tooltip","version":"12.0.0-canary.a4484849b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.a4484849b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3b2dea1e33937644f9d3293d42efe87b3d3e1a6f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.a4484849b.0.tgz","fileCount":38,"integrity":"sha512-VjPNvkKj4CnvpdyNoVWcXS+CZj/SJe8Lz2cciAl9xqauz7WptA8PfhVZJnX85eGC6bheS/T0VR/mQIGwS+D1gg==","signatures":[{"sig":"MEQCIHxk9+E5/u+Nq03SmX14/+ODLM1K5tB3CI6/vC4x0pUpAiAmhY3uPdJxKODYHUNREU+g3l4P3gxDDwo1zg5s4NFr5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnUZ3CRA9TVsSAnZWagAAaf0P/1Lfar8GHrx9xtZZC+Jl\nptXiNh/5YYuvUKYcJOjoU64/yt/h5F905PlztYBCc2ZMmVlJK08h+GBrADj6\nCsePu9S35hJOor6mxXn2UTbCksfIxdifv9JoxhQJT264vYvDxrpBbZHmb4qi\ncDAtq2uF20EHRlkipFCHKbOK2UPKkMXKTYNDLH3eVpUWfPltd8q1Re+lbgws\nCbmXhRn/BOqpCSLVCnEOMvO/3aLjXPEGZcTC+hgW/Sd7shMpLSchvIEQ9JKs\n5YG1IOCglZCe0xOxSKVx+R+3b6w7BnbWi9zthztDtBU3Prr1hwiLANcrg0tL\nzjyfdPkx5mlvHa3MqrZnpSNXvN0zjudx9n6xuT8L1Frdzf132Rigg/FDSM/b\niBHHZavUC3q1e10P/4b1uwcdn4VMYhxhra5vqqDKBB/GLy0LXqXkT+CTok0s\nVOXUpWJ7xV3ls6P2q+XmIe/Jt7z3NgkhcQUgs19xl9ZeXctZfc4ZtDCmtxas\neI+tRRXDwmEYdz6GLC/eA/WOHTmly6YQJ34xVndFWHsixZ7nfVuvKSBa3Dd6\nimVBrN35hm94uhnhgQvXrFH8bWWPY9DT7f3aFmgxiZkP1/HKhkmMoUFALhdc\nD6mvm1ufegvoi8cCzzd5UFTNjxQZzmvTAgQOG+K/GHws1pQWKmIPlFvk1LP0\nes6v\r\n=HpLM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7908229b1205198ad87858e49ed29ee3836cebfc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a4484849b.0","@material/rtl":"12.0.0-canary.a4484849b.0","@material/base":"12.0.0-canary.a4484849b.0","@material/shape":"12.0.0-canary.a4484849b.0","@material/theme":"12.0.0-canary.a4484849b.0","@material/animation":"12.0.0-canary.a4484849b.0","@material/elevation":"12.0.0-canary.a4484849b.0","@material/typography":"12.0.0-canary.a4484849b.0","@material/feature-targeting":"12.0.0-canary.a4484849b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.a4484849b.0_1620919927397_0.2880331799876299","host":"s3://npm-registry-packages"}},"12.0.0-canary.b4c3f513e.0":{"name":"@material/tooltip","version":"12.0.0-canary.b4c3f513e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.b4c3f513e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e8813f116ecffb99bf45be1b9f10103114c429d8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.b4c3f513e.0.tgz","fileCount":38,"integrity":"sha512-3P0yYXJeye0L8r9UK3hnOFnlYzKvUId1SGxUgsTV515dyEZAnCucXQdIfTsPkBfelu+05WnedLXcJqHDdDkF6A==","signatures":[{"sig":"MEYCIQC/UoDuFkrmRLfuxb1JFw8QdnmmK2MYcPmCuMJ8F1/YOgIhAIFBlwZAOdYyCwRSsW+n/UDKA/UOjBsEU2GY+xSei87o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":785651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnU8ZCRA9TVsSAnZWagAAXxQQAIZv8od2g5dyhizZgFGh\nex1keBDYof2A1/x/Yx9xLaMdfBX8pV1ylHl03L/DFU7d11UTbEGsp0x4z9ZD\nvvEfRCWVi1ObXZmJOPC8f0cgqrtO/SWD8Q0HmhggjAvzbbT9mElfI/BF3gI9\n9boh4O7JCvSXAG7fm9+rF2f3VjTBYXltlZmdWhLoB/KmaV+pf6gb6cSYEETZ\nNfxDtOF6gowIRy3T7tTO+QCw9LkklFbl2LOItQwg0MxnFbXEF8ks3IjJisy2\nVnRbVJIzyYuVmLYb9/6x0cr3c2XFztEIC92ObOpS1sDqSGuuevnMGQk7kRf2\nhHie6vhqQHwlUlLohmAlZiIUt+FRDCSUaYXV0FSirxLPoRPn4tlAfr+paGuN\ntrU4LSnbQP+2TsowqXDQb+13Ac/WUGn28cWlteaw4uk1PBATh5Ly3ITxPUYu\nk/a9Y5cNfLeqbwh6ew2Gwx0HZMjAY2SYwKxuJtImeFtrHK3tMSODh1sJof6h\nIoXkeTGvc7UG7XmxHrsvg1QJxvHOrthIqjyaXhaJHNI/Kuxc2C6vkWBqxzh6\n+cR6dG3hoKQXfcuVKdLUu+rZeFniIek6Vb35kEWKWZuzuOnO7Lj4evLF1IzH\nnvwW/HsGhQWrE+5iYpHfKjb+T9tjnDcHZftzsoMiuEMhUIyN/bnLyppHRG2I\ndyNE\r\n=mIBH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c2183e7caf6f0437e64e41b632f75d33156547ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b4c3f513e.0","@material/rtl":"12.0.0-canary.b4c3f513e.0","@material/base":"12.0.0-canary.b4c3f513e.0","@material/shape":"12.0.0-canary.b4c3f513e.0","@material/theme":"12.0.0-canary.b4c3f513e.0","@material/animation":"12.0.0-canary.b4c3f513e.0","@material/elevation":"12.0.0-canary.b4c3f513e.0","@material/typography":"12.0.0-canary.b4c3f513e.0","@material/feature-targeting":"12.0.0-canary.b4c3f513e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.b4c3f513e.0_1620922137112_0.8967511570439175","host":"s3://npm-registry-packages"}},"12.0.0-canary.1a8d06483.0":{"name":"@material/tooltip","version":"12.0.0-canary.1a8d06483.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.1a8d06483.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"494bd3b2419de3a6c7f58502eb8ceb9c3cedd6c4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.1a8d06483.0.tgz","fileCount":38,"integrity":"sha512-/Hl+cjPyEnAPqX4L1fi9wwHYqNu5M2JwkdvTkBhRKyH4YfOL4NYIvoOBaeqjuB0SeqZwf4T2aoRJFcVPxGoSrQ==","signatures":[{"sig":"MEQCIA02NvmYd0114zANtuhNXnc8zWznax1s9c/tVZRo+d7TAiB4++78sxVwvRl3yqotSGRco/5hH9E9PNXS/dFTdyDi1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnVB4CRA9TVsSAnZWagAAnKQQAIktvVD+t0bYgIZacvb8\n/aDi5BHn4Lr9SlCA4VTH4vrgLq/CgFQQEEiVfKirHkjGMSmX91uKq6MKQuQ/\niWmLipg/Nu97YKU/8AZnlKH1MeHQDbk+rkp7H35distWffgwnwBaV2ZWKh0o\nHcnX0nO4dWDRVgqIIcoq4AtOrz9MW2XlVQbGf2FdzRmaXOddlChGoc3k0jSW\n5QUa+0AcOTF1+iHjDTogpYi71bXc6cXSiL42xPooWnwDgNFyGDHvmkWJ2Sz4\nAxqA2uEdXSyky8WqDHtjjiAopMaPWQok1DtFNJNxDAGFiEUtT6hWvkz8dkAm\nIcipqoYLqZYtUFLA6TxY3Yp3sNZJBZ12M+v5Is48vEeB98e2A/hBsZTLzHVP\n7NsW4SzodQmBID/bqfaS3fwh/CkD7yDP5vX4UHuW2YPmgcJNmicDsY1TybSp\nIAeV2WpQMsgY0zoDQav3rBOS+Y55G3TxySEkurt6AtGpBshf5xKy5jIFAbXr\nyty6LRrF0QB2yfCbl8nZkYPbiDqDvUnCwT/cw7/c3fIQLZujP8obKOs8110z\nL+TcBIfA2D7SpkISuTmJ4J68aJGE0rbbZM+fj+Ohosf7518dH+qoC/kGVMGr\nkPtdBZmac6zzryBCoQxyTcmQawMA5LqTKKpfCFqiHmvJYO7SSblb1rto1MOP\nZtrO\r\n=+4ii\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4fd7ff5259e7910dd76488a7faab45af839a13b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.1a8d06483.0","@material/rtl":"12.0.0-canary.1a8d06483.0","@material/base":"12.0.0-canary.1a8d06483.0","@material/shape":"12.0.0-canary.1a8d06483.0","@material/theme":"12.0.0-canary.1a8d06483.0","@material/animation":"12.0.0-canary.1a8d06483.0","@material/elevation":"12.0.0-canary.1a8d06483.0","@material/typography":"12.0.0-canary.1a8d06483.0","@material/feature-targeting":"12.0.0-canary.1a8d06483.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.1a8d06483.0_1620922487770_0.05939261172732757","host":"s3://npm-registry-packages"}},"12.0.0-canary.8e6081836.0":{"name":"@material/tooltip","version":"12.0.0-canary.8e6081836.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.8e6081836.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"74b503f0b6893729673e9ee4839b9476662f9907","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.8e6081836.0.tgz","fileCount":38,"integrity":"sha512-O5pHMHFzwdcEUBilx7uojG+GebGlD0r9HlaUC2E0olSOYetPXxkYBg2nMBaXHSKpPH/BmeRhfxl1gX+1LeePhg==","signatures":[{"sig":"MEQCIAMukaasB1iu9j9hEj9cAAtZ4N0eiKI5Mbgw2KL7VsE6AiBF7neGDTyqZgGvyrDyFDn1A23nMw63O/iuBGDESoUSxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnu6TCRA9TVsSAnZWagAAessP/i+WPaj90EhyLbUAcITb\nYeUky/MxVKmKahFucUPCuGCNEKBIF04V1WQrjPE4DpdOb+l55P6jwi5aaoWL\nZ8TvLs8siqW0N8KNvnfyOt5C3Bh/l9UZ8xCiFzxm/KcheRfDe6Kk4WtP5Ai8\nRoS02oVgpzZiAISbd/Q2ArJ/FqWOTEDAjzVzroUFxkZluGW5pMnEy9mGFeGY\nvkQT52FxaH8WJmN2ma7TGD+CWAh3V7UnajO4N8x9vuKhJnOGGF3hxA5eHYei\nBpXFAtWA2ZbU8cRtUi8xtug9zMC+7Fw0J7y/ED2SGLmEtc1BD6nCiTjRXyNc\ncY7RiTALP/E/sewS63CHUgmIo+TPjkblux98g6I+P/pNAzZPcghH1aphvWI9\nFYud7KmlBvFCaQHjpRS7hSxYibhqsEybjPDR0B3AwH3bP0TyB4Q8+EELKRjY\ncusLF7SgBF5ls9LkRHIzBYRseNwouOIYGn9XOW3Q4nfEcL8q8O0ZuGEZ+61v\n/Tf6g7K4HYjk044jS4fW07xJowPh4cDV/iuEGcolfGWQ+iKwIvJeLsOiu+7c\nxCeomsVmViDo4xblGbEcZLDv73G16nhxtSTl5BLseFC51Y6c5ygO3YAPIs2N\nDz39TmyTpPjfQKFnknTy8jrf3ArHQ7dNEcLk8VYOjHmrLLSJzTyBFFpwMJ20\nO7B4\r\n=UYZr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e648805eb34c990054d503fd3f70ed25e40d6d9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8e6081836.0","@material/rtl":"12.0.0-canary.8e6081836.0","@material/base":"12.0.0-canary.8e6081836.0","@material/shape":"12.0.0-canary.8e6081836.0","@material/theme":"12.0.0-canary.8e6081836.0","@material/animation":"12.0.0-canary.8e6081836.0","@material/elevation":"12.0.0-canary.8e6081836.0","@material/typography":"12.0.0-canary.8e6081836.0","@material/feature-targeting":"12.0.0-canary.8e6081836.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.8e6081836.0_1621028499250_0.7970576975864867","host":"s3://npm-registry-packages"}},"12.0.0-canary.a2b0f4cee.0":{"name":"@material/tooltip","version":"12.0.0-canary.a2b0f4cee.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.a2b0f4cee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"59dd3472e6d5d5436a2809f5786bcc41941f53fe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.a2b0f4cee.0.tgz","fileCount":38,"integrity":"sha512-idZNd71SAuy0xJqNWcsmI0QNNnoaZYK373D3Q/ZFoNv404eYNFA6qIuO78BL5xeHSBgkXvN+5b8ODiAOO2CY1Q==","signatures":[{"sig":"MEUCIQCgzoBUBY0qN6uJrOlEovHG6EXiiUg1UbIgfqmljrvhzQIgIZr1wVheGGM9G1ViLLpCGqY7fsRGkI1TUABBG42GiHY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnvGyCRA9TVsSAnZWagAACDgP/AkhEGtjla8sIY1M5uE3\n6npTtOGzDwqfwYPhT51s6EPBUxAwy7fEYWFz88gBbdWk154+7fq7Lm2a8QX1\njLHiEkJ1NrGqhuKodTQyvvejPPpRDXKBCqoyeeAe2C1yaj8flE06ApWfFcT2\npUq+I75Al3W6zZI87iyfs0WMNyEErcLUp24knudHHHw9fx7eraX2duXzlIFs\ngdydTq08JW8Lq3REIwBfZUiO9YI7F2au+jeLDdstKEL/HEcQV/LYfzhM3LCE\n9NADFno69x6tSADXsviKm8MtoUEir201utSyYj4/z5djx9CkOKS31S/Xr3jH\ny0tQ/aANHlW0DOgJjZxF/568CNLtAECufHVnntGcNO2S8kuiThtxRpqePZTm\n7wP2I9nP/ISeDKaSVTM5jJ5jrIgl4ZhMQyTLVOedNPiobsCYkeW0gSN2cDaC\nhl7TooCh7AHnVQcbSQDpj+/M6z7MaRFxdphG6N19MNn8Rptq6oax3MOEMBMx\nHAvN5ao2YFTmBHx12aeLcrDZEOu0vE6EN/Qa6E/7sHJMLXkuzGPgK+YSbhxO\njcw8xhLdi3H1hR64pmtB/fvNa9Bg349RHKLoFg3f1rAr4mioEmjhcOrkjTgI\nivww/5QIWENCTEnzCFUNZLa393GmwJt57ritnQEngodVlCGweyXlU6S4KGAr\nkAdy\r\n=pRoE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persist=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"67c2d3cef073a380a13ddb6bbbfc90886c7af364","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a2b0f4cee.0","@material/rtl":"12.0.0-canary.a2b0f4cee.0","@material/base":"12.0.0-canary.a2b0f4cee.0","@material/shape":"12.0.0-canary.a2b0f4cee.0","@material/theme":"12.0.0-canary.a2b0f4cee.0","@material/animation":"12.0.0-canary.a2b0f4cee.0","@material/elevation":"12.0.0-canary.a2b0f4cee.0","@material/typography":"12.0.0-canary.a2b0f4cee.0","@material/feature-targeting":"12.0.0-canary.a2b0f4cee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.a2b0f4cee.0_1621029298147_0.11123555203468771","host":"s3://npm-registry-packages"}},"12.0.0-canary.e8e39ad19.0":{"name":"@material/tooltip","version":"12.0.0-canary.e8e39ad19.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.e8e39ad19.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f32b8a6338dd98c3b042529a374f139ab8929a8c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.e8e39ad19.0.tgz","fileCount":38,"integrity":"sha512-DB0W3/ojtQ9lhMf9VK4xCQpR6ad3Cj8dvVR7V/W+GvInDHB60WPr3RUjUHhho5Lna1s8pYcYfNwZByO0GaiqNw==","signatures":[{"sig":"MEUCIA9dVNx40VZiMylfPPmg90zg369HXIm0dWXZrFkQt3GeAiEA7naiuiC6TxbDU2MSCbyyYepYTrGIlEmhxg4Q2fvXTDg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpCARCRA9TVsSAnZWagAAe7cQAKP1Zx2cGaJyAWJ/rU5U\nqERPZUMmPvcwt7SUVY5+QSl4hz5Or6+tnHwKVwsGSYOD0PNvinoZLTHRA+Jh\ncY14IrAdQ34RFNBg0fiPuDPKEthONw9yExVhJotEj7vAO5oM+zRtEPed0SpK\nfg6o12Q52JRkMRcsQFCxs0JDVF8oBbo7SGGbKQe3C790O66fbJXJgdP8S3vx\nMr75/p03TeYJ3NrUBfrWPUlwq6xsaaFdUXzog83K56WmSEGR4aciQEF2no+a\nmXpsT/gSlwNgUoGpk6iSyOsWV+BEsz96QBQ2FkvsY9xgXm24LqT6pj8gOHbj\nxHiAfvWxMo+jhCSmMMS+nc9/xbXLbW5SZ0IDKCoCaGDXS35ojrq0TTAdm+qB\nMM6R46d1Yii+ero8MLjALnT22J067KDqMULs2ecmihOEu4S69MtmygRF2rXl\nC00bDb+rZOvowYlHB5tgC0FmOdYEV9UkN0Buml3TREG5Mtc596TcvC4Mg7cD\nBtj2EgwLYbtjJmCGVBDPp5Pry/e0+EAKTWltf4g2of1CfyAl3YHBE7286lRx\nEchEcou/JiBEOV8rnX3gLgpUUv+u+IjkobCBLAB7ve4vkXV5ed5/oXpuKl3h\nJ+oM8xTfae583DzXEC7Pc6yBb+qOjxtW6FyI+hvMzyiM6pu2PyTWcZ0bZ1/H\nAiwK\r\n=kz8Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2bde63cf3be6363eb1508c4d7e1747acfc51a761","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e8e39ad19.0","@material/rtl":"12.0.0-canary.e8e39ad19.0","@material/base":"12.0.0-canary.e8e39ad19.0","@material/shape":"12.0.0-canary.e8e39ad19.0","@material/theme":"12.0.0-canary.e8e39ad19.0","@material/animation":"12.0.0-canary.e8e39ad19.0","@material/elevation":"12.0.0-canary.e8e39ad19.0","@material/typography":"12.0.0-canary.e8e39ad19.0","@material/feature-targeting":"12.0.0-canary.e8e39ad19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.e8e39ad19.0_1621368848783_0.028695816277853003","host":"s3://npm-registry-packages"}},"12.0.0-canary.4bb5eea2b.0":{"name":"@material/tooltip","version":"12.0.0-canary.4bb5eea2b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.4bb5eea2b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1768a4291b604287f42ff97979eef0173df563e5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.4bb5eea2b.0.tgz","fileCount":38,"integrity":"sha512-L5ZLqjQ2RM3cXNHABigdUBcclkPcV6nKn0VCrSM7IG1K+byujTx61A6BDOaUvbqWH/4bj3IWVmzr/AFKk47SRQ==","signatures":[{"sig":"MEQCIEtWd+Raz4wg11secpAFGZWce1moSKz4w2667nsZ5qFDAiADPsMZL9C/hhosqj3DHrOjCX8iIATdYL//a5qVdiX56w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpS7SCRA9TVsSAnZWagAA1k8P/0XCUsCwWJRIc2ur48qX\ntpKuqe9Mm0qYpC+UToqZ1Q0LG4oPxaKKO2Ics70b4Bw5XTyiIOB2NJPdXZDR\nA9oSA8bFqiscdF4ckBIMrxNeIV5DfwAh/l93pJOhJw627bjw9biC1i11u3TO\ncgRUTET9JeT/dQ5YiqyDM+Up5nocltCUwRb7ZUuLWh+PIog4N8NAz7plBggh\nZNGoAP11jAgK7bI6c+YTXsTHpsFUiEX7z4GCCR8zDHQ+DPfvO7zcfy5NNRTa\n4rnQwYwNHazEsE/WMXYNzRPSWsUYAyojOFNq5QXT/Vl6oZMfRis00y2YNryY\ne4Acit6W6sbviWSEwRMuL6NWC1d3KxkFCdp/pQluNtAaZmk2bUAoaOI4MNwz\n2QuLx8eOfCvxX17H/ijJV2paOy0XmiDs7nIxeQFruXHTDOXfWW/DOmsXVkHY\nGIJ3bmlHYAcFefqCxT1Mou7Pb+ozpisdKKfWEdeADs9l/goSSm8uBzu4NAag\n4V4o2TOnsDKxhVxSJFXr2RY990ZjmC77FTyKGTaiMZG14AKDTaIjML4FHZl+\nYSzPWQErkZL5P816C61pr7kFMSxHDHiS/SkPbSIt7ot7cEHj1ZOKu0SSsL1a\nNTjni1LCoTnM6xj9iWywjrAHa10VopLG7rsiTJyiRpWTwhM7xD6WGLqnRW4M\nYJeX\r\n=SAI9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9abe3ad555ba3e9ca70f37ff3419acc2edb56676","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4bb5eea2b.0","@material/rtl":"12.0.0-canary.4bb5eea2b.0","@material/base":"12.0.0-canary.4bb5eea2b.0","@material/shape":"12.0.0-canary.4bb5eea2b.0","@material/theme":"12.0.0-canary.4bb5eea2b.0","@material/animation":"12.0.0-canary.4bb5eea2b.0","@material/elevation":"12.0.0-canary.4bb5eea2b.0","@material/typography":"12.0.0-canary.4bb5eea2b.0","@material/feature-targeting":"12.0.0-canary.4bb5eea2b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.4bb5eea2b.0_1621438162012_0.5642219331378833","host":"s3://npm-registry-packages"}},"12.0.0-canary.ccce99cd6.0":{"name":"@material/tooltip","version":"12.0.0-canary.ccce99cd6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.ccce99cd6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b0fa4bad58749e5ba75eae4cc5d11aabd8aa56c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.ccce99cd6.0.tgz","fileCount":38,"integrity":"sha512-Yl8kfBWHwj7IWBVIvIfc9vjSNTU7J9ZCY/9FOHyqoJch4rrBcCTtFwq1xn3RAPjSh/9cvxGYHMjm/EuOnVp7aw==","signatures":[{"sig":"MEUCICw/afNlNGMSNUkRVE/p9VHCESCy+JkvSLaFCH+RhnXYAiEA+1UpgzBiHh2m3C8KJ3ZUuYv9reRtwwy4sSPilm8vt9o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpbQNCRA9TVsSAnZWagAA7X0P/ikGRrj0nkGpqEAeFWBm\ncllH+5LLWl/LqUgEURVsGbg20vZPblz0xrosoWas4Q6SMOr7jziU59ACcvKC\nr4dIol8PCd7Ie/kO5hGrioFWsyW7tLXCCj9eO6FayvXuw+MY292ZlFbrqB5d\nAYZNKp3PMyT9/iuB3HUTLwxf09O5X4GOU2JMmRlJdsmMByERjXR1qH2s7c/N\nUYDVlqURrEmt72RRIGVta3KdNf76MDwrwVc8IvVmi39t4BIb/G8XrLu+4jSZ\nKFPRTjKxZcmNrTGCk3RwiYy/zjB6PX+luPDpwL3yeRZb7Uo+cjf4e/KG7qa0\nnXzeG5j9e3kxmBNmouyJEel6SB5ytPM8nIXfLVOK3E1Gy3fYlx/3W5ua8pdk\nGslW2R9PQxyuhzhODSQhqDfDBYZb21Yim6qhu+T0sQyQVblRcGF741GF54vc\nULOoiO64ZTMazA8dbzuV7SZD0LJM9GtzQcRwXZOJ+bFJl2JT/LmdXL9vWCzS\n6/cKVcb11AKebkok+rZ9aZMv+mhjrhHqjJ6B6442xGxT3GPRa3FlQTCHPxj4\nxnaRF80IuFNlIcGHu2D03houskfj+ZBKxH8GgDvasDnXYW74C3d430P0iKJ5\nyqzlIaR6da6TFggcWXvzU5l51R1RIHIbLIgl25ZF0CYJUYBBIsluCjagnc8V\n8qQ8\r\n=/Lq0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"5d475a1522350d9dadb5fe3597683fa7f4851b83","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ccce99cd6.0","@material/rtl":"12.0.0-canary.ccce99cd6.0","@material/base":"12.0.0-canary.ccce99cd6.0","@material/shape":"12.0.0-canary.ccce99cd6.0","@material/theme":"12.0.0-canary.ccce99cd6.0","@material/animation":"12.0.0-canary.ccce99cd6.0","@material/elevation":"12.0.0-canary.ccce99cd6.0","@material/typography":"12.0.0-canary.ccce99cd6.0","@material/feature-targeting":"12.0.0-canary.ccce99cd6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.ccce99cd6.0_1621472268566_0.21051207688437357","host":"s3://npm-registry-packages"}},"12.0.0-canary.14767a8db.0":{"name":"@material/tooltip","version":"12.0.0-canary.14767a8db.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.14767a8db.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cc71e31faa5d141256f4bc5bdedae88c635ed8ba","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.14767a8db.0.tgz","fileCount":38,"integrity":"sha512-w3MK1s4vwvfrlydSFISbh9k4kSMfs5CcMoKQYo5+5P2rcfU5suuwxQRvVsCaNn1NIdkOXhNkFrBtWoKVQET4Lg==","signatures":[{"sig":"MEUCIQCKOAVIuAS3xG8H5pO5l3PC4bLVPlY4EBR2vBw75+yVmQIgZWIv6cTped84XiIIEpE2WPqI0C+l/cjCMmj4dMyI32c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpsvuCRA9TVsSAnZWagAAiTsP/AsCqj2nnpvMexKuVR5m\ns5WAWqufnbE5RDpR8w3CsCVOnI9mO2YRkjDfCwz9x2JbiFiGTVqayg1goTZx\nHmDo9Q4HgXIHv1mGIVFo8U4u0BgPEMbHvwk/qY55KDv1dSGgFUDDYTObUMHv\nHUwRekafFC2jQmWCb74gry/lE+3OhP/kKtep+sKTWKm9tz7pq1rxY2fMdpph\nD4EwDrbCXMO/2k4PHR1utyIyMZRxtK71Phwl+C9G4asnfpD7DZt7jK56AxHr\nWXXIry4+l7ttC/AqrIYFXTBcXMQ6O83O0Am3sbgXOF2s9FqDS/4Ku4PXbduM\naHmpCvNQb675XyKkYz9tR2ATggClQ1lSBv95x5WuMBKZt9VsTbuID5/fQIIA\n/8HXM9c2ejH3qJkZ5SK4X13cZg2V81VELtW8fgK3uyD4iqQ3PGJojgzAhLJn\nNDgrzm6UOeO9zygjpaYnZ2iWKGS9Nvq4CcfRnau3GOGYxJH+AOOrETNmSuwK\nT+5WemzRPeODgNHvQ7q/WTyZSh6G2M/Yb7SCieq8GpK3t4yIV/TiKErPem2j\nDHX8JA38FybaqN2+JeJ4E/lT1EYSSYXrK4Gc4mrH97sDHs4AeJ1OszNdnRKh\nYc6ghkM4Zn4PRtRUpK8mBIQ4qYxXBiaOkw7XG5SINNTgDYtK5yiNAapMbQTd\nVIvn\r\n=ZDNQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a324b91ce28769039998a00879c6f441cb1159b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.14767a8db.0","@material/rtl":"12.0.0-canary.14767a8db.0","@material/base":"12.0.0-canary.14767a8db.0","@material/shape":"12.0.0-canary.14767a8db.0","@material/theme":"12.0.0-canary.14767a8db.0","@material/animation":"12.0.0-canary.14767a8db.0","@material/elevation":"12.0.0-canary.14767a8db.0","@material/typography":"12.0.0-canary.14767a8db.0","@material/feature-targeting":"12.0.0-canary.14767a8db.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.14767a8db.0_1621543917551_0.5961990160266939","host":"s3://npm-registry-packages"}},"12.0.0-canary.22c6dcff9.0":{"name":"@material/tooltip","version":"12.0.0-canary.22c6dcff9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.22c6dcff9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8457e3e7afcde275a240d6b04f0bd175697934df","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.22c6dcff9.0.tgz","fileCount":38,"integrity":"sha512-0F8dbTHx4RVYO2/fJuLhqSvfrcyhkFbYykX3VkvuY87fBvtlJFR1dTdnRKtUq084MCjJoVIUaTjFvreCtjlm3Q==","signatures":[{"sig":"MEYCIQCdzPpBDKR0h1xMnQ3Qhi73I5ZlvacrRoO263TsYcRzPAIhAPGO79XL4Z7MX6SURph7MYNLJqC8HE3UBog3Vt4SVp/a","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq8QKCRA9TVsSAnZWagAAFLIP/RTPo4VJP0Cu6hus0qXy\nsIiZWllHNNoSb/a6H9NdD/OaT9bze9NQyAL1AAU/wsYmTX/qVhrlgVN2eEZU\nYQTYsnxgXFdNCb8vLExSvA0fJg9VawyUcSKCbIm7jS9bw5/HamEA6/VlgQnl\nrSYr6rDbqYvVwendReepkrzy1wh3PqJshXZdh3IVcVuSMkVipLW9LJfADpHN\nQaMj7DgIrglA/uSOb7hRSdI1cZKW3oAsHlnIXaGmGt5jFt6RmeUdNK+oHTeP\nQNV8AaP4Z6BeouCZ03vttrJjGc3JdgTjHU2S/GYlv0x4Tu8dFGPM1OY2fGuQ\nuqb87J1MWrm8ZJImoKQ4KJtStE+Kd4PMHWi4egbzRx6DIg5M0t/NDVdFSlhc\n1ZfrJ5N+4RXzZXKwGY5hOY4HEwyVlzPL+YQVFOmc54qDcDByHivBEfzPqfHi\nnfGMEA2Y+QPV8IpcFclqDrA8fg1YZ4a6Qef87/j8GWN+mVXWi/WwlwZqZUeS\nLboqzbxlc1sgDGW+W6BNTIy2jWbKZmrXq+GcKhMDFhiul6y4gS64EUsx+peH\nHKhrMEhS+63szwFsJFcoBrtqlr5Purbmyxsrzpf2IiSzV/PEWz/7/PZLKlnF\nkHSW+83sn8zV1tpgVMNiw9IEe02I19arn/ccwZr6AMp6/6MQ8lOl1Da1HXod\nxgpy\r\n=E6AP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"74541e300384d800b9cdf492ff70ba20ffc583dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.22c6dcff9.0","@material/rtl":"12.0.0-canary.22c6dcff9.0","@material/base":"12.0.0-canary.22c6dcff9.0","@material/shape":"12.0.0-canary.22c6dcff9.0","@material/theme":"12.0.0-canary.22c6dcff9.0","@material/animation":"12.0.0-canary.22c6dcff9.0","@material/elevation":"12.0.0-canary.22c6dcff9.0","@material/typography":"12.0.0-canary.22c6dcff9.0","@material/feature-targeting":"12.0.0-canary.22c6dcff9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.22c6dcff9.0_1621869578150_0.2805934085554149","host":"s3://npm-registry-packages"}},"12.0.0-canary.fadab3372.0":{"name":"@material/tooltip","version":"12.0.0-canary.fadab3372.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.fadab3372.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db2ebb475f6750dc1d2fdf94c7ec5d093de52e1c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.fadab3372.0.tgz","fileCount":38,"integrity":"sha512-7tpWJLuBlP9S/v/lXDvp0F5dSKlcL8aGn0OoBahXMtm0ZbrolOtWrjJfj2svliS3/MHHj0eu9Xy1A01fjWIHaA==","signatures":[{"sig":"MEYCIQCyyU6Wkata+3P+u3moRight5JzTyLcLL0oFWEBguqOsQIhAIbm1qCH27Hyf/tZmoczoFplI0xtadkX2YY+18mlBKv7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq88eCRA9TVsSAnZWagAAQN0QAI47t96Xd7LAA/CmtZxd\nCDTOKxHEp531DjzsFLF+Hzixl9X3onC5+FDCk8/SqsDZoMpF7n3bVpfcfy1M\nwDhTWkG5JsgAMIooWMeFgouS9BzN3WCQQPUr6HeVgf6P33QHx00gn3qKbc7X\nyNH4eieZt5jfOOQncWsAupKlWbv5khR3x2DXbh1nJNxRZBciA61Met38Bs3r\nD37SkUHJpGTfflGI5K/NuO4zuqOXOMzlfR/GLdWc5hiDMIS5bicK09bIqAiJ\nv9R1hm30D1Hh2d3T71/p8TYnlw4MmyGsfO/Lyjss87lowZWmbSVuLcxErIag\nLGME2lu8c72Rj+A3gLisvxZNK7K24LLQzwWgHEv2mVV3OKPvRqw5v5K5AiJA\nJCSUM/8fwVmadFvZStytajeqZdeItzDFlbeG/hYYyGuVU1AeO2CJPaqVdgXt\nNGMtGJwmpfUljZqHMz9YjlyBY4wrZoop/aO/CYZw2J8V0cPPQdZPnYkwO1Rf\n8cgNrAl/b1Qg9IM1dcvpvNmwj8QV8yx8gc9Vpyqr5K/74hMy0AWAEykzVIbv\nkUg7857lv7/BRrVIotYVY+B1ilWr//OHms4WaHBfpwqcR3vM0OcTWtHtzKEy\nyLrQVJDGtc6xBCS2PXdo/p4eAi1XbzlFUYJw/rG6G9emXgtYY8/gz3Ip9OR2\nHtuP\r\n=JWMq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d76e611194693a7270b5e10fd87906ada48c7af7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.fadab3372.0","@material/rtl":"12.0.0-canary.fadab3372.0","@material/base":"12.0.0-canary.fadab3372.0","@material/shape":"12.0.0-canary.fadab3372.0","@material/theme":"12.0.0-canary.fadab3372.0","@material/animation":"12.0.0-canary.fadab3372.0","@material/elevation":"12.0.0-canary.fadab3372.0","@material/typography":"12.0.0-canary.fadab3372.0","@material/feature-targeting":"12.0.0-canary.fadab3372.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.fadab3372.0_1621872414056_0.8024757935778328","host":"s3://npm-registry-packages"}},"12.0.0-canary.caa73aeee.0":{"name":"@material/tooltip","version":"12.0.0-canary.caa73aeee.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.caa73aeee.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1778e03717279393bed51d6cfa351fa51d26f680","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.caa73aeee.0.tgz","fileCount":38,"integrity":"sha512-px9VoPcXGF6kGYR45BZdQNLCikOhICnAAI9jaqbZGGy/3yxcW4YtsoCrpp+1PiZbvr30xZOQ4YI3FFJJE8jmIg==","signatures":[{"sig":"MEYCIQDYOhr8Sv950AUKm5dbuHxQrL0MrOpfU0gx/OeB7s/0mQIhAJwW529iGHVZ+yR4lT0NevYaNqXlmiP+SsPEgGoigIu9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrQZ/CRA9TVsSAnZWagAAx0AP/iQSG2/dMl186aCS8d39\nNWxFTwbGW9O6K88taR9VCYkSviXUuQLS3RSOKSGSdiWSAFozw4RIL04gX91m\nvU02mJOdUp8PHE/eKzcgk1VeejPFV7bT/EmcbFm1FQqsnJ5TD4UM/fXieU3+\ntIT4xs7ecZkz2HPfNWT00982xgu/+WvJvpyuy7z1taViqYKpPNiYuKScC9z8\nzPa0C37ZOFOQdNIfJdUA0GsEZjvVpaJEbL3DRa8MEM1hitRipBy6mn0/+s2N\nUQoYR72qtyW9GRbbbTHUW27KIGy4wR/pS6/Lc/1D/Jio4Z0zF+Ts90FUpv3s\nJdeRz4EDOpx9ZNly8n4B6v3gFdOXJAgtueHQKaOm7NxWFvP6XX+WRE6n4iMj\nsTEaeCrTcHkc6coYaZ5vIbwL5IFYU1hXpg9FOsXIY3UGYRxj6AWWhRJeyiNB\ntolf4vJneVpe9urGcA6fl3ksbmQVB3J1v4VixMLRsu7kgErsNKO37aQ+D+ow\nXjvp17Zt8jGlrmON+oNjzMW14wk1gLNQ9Gh3LHOoIDlqthS02NIPxN3y63Gm\n3AbyL+gMo7LL3TFzGElpk+yhiUWCsvqzHGFpDp3i38S8GheG/MGIqj9j4vWb\ngJbTk3u1rFtYxBA2M8678tk2CYLCScY8tPWB/bm6GX0seK87fXe2bmfR69kf\nz0bR\r\n=WfOW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"dca5692fda23e55426458f6b0c56c2b6dc9e2dd8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.caa73aeee.0","@material/rtl":"12.0.0-canary.caa73aeee.0","@material/base":"12.0.0-canary.caa73aeee.0","@material/shape":"12.0.0-canary.caa73aeee.0","@material/theme":"12.0.0-canary.caa73aeee.0","@material/animation":"12.0.0-canary.caa73aeee.0","@material/elevation":"12.0.0-canary.caa73aeee.0","@material/typography":"12.0.0-canary.caa73aeee.0","@material/feature-targeting":"12.0.0-canary.caa73aeee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.caa73aeee.0_1621952127026_0.8015417761353776","host":"s3://npm-registry-packages"}},"12.0.0-canary.ec31ae1ed.0":{"name":"@material/tooltip","version":"12.0.0-canary.ec31ae1ed.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.ec31ae1ed.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b7b6009582a32774ee5b2b58cca140af3a665f85","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.ec31ae1ed.0.tgz","fileCount":38,"integrity":"sha512-eJwBTzb2bfJIuuH+05A12H+4AD5Oh2ojJvgXrf6x3jJRjuhKJTl+f7X8Z0J9+2jt/8LWQ+/uC7qk5YL8j3TRJg==","signatures":[{"sig":"MEYCIQCldxQjEhWjAL56HIaD+jXRVxq0N66aAsnspYbpQg6RdgIhANSKLNNsDUG0knukrqp2O6GIgTl4577KunpzZa7ax/or","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrV/NCRA9TVsSAnZWagAAPOcP/i/ck05IH87mGVzKAMxl\nRk0bYjf9s9F9TlS6JrsxD+dvklFhlXzuA8mGshk1NWHfxBOsETt9y3onKLh+\nE6KMzoloB6ceKOCMYFPFy5z5WADfpQRClYkOwqFwrqSABU7ZwBcz8c7k7wu4\n9kEu/xJ7TTMH7x5vN4JqJdSStCXHgZnRlG/3aZF6C+4dOJwbB9/qB488qbLV\nenevciWjAAdB9TaA5aa34NF6g3OHVCEEUE/nACty1MufFq1JrcT/F4pZ0HH1\n/G9JmI7Jt0Bo2OHGCx4UV0Fq/WEGPPEmMEOG8glSFqca77Dpgrx/HBRxzjVS\nxhVjGr+jn8Gdv0c3N6zyOVepy1yVpFgkx04AFhCjF3l+RYnfNNdDZPcRpFun\nNbMPjdRbbVI9PaTRKyfm0NQJMeqzbeaz7WG3KLp7d1qR9de1w68C/tD2Xvj9\nCx0dt8Tsj+rMpW3WXJEkOyTd24aucZ3ioYDxtw3VytcOgJOIg9zvw+0QLCBU\nEKs5VmaLF0r7XmxQshcqIXH3HfxVPn3PViwxKZqCz3BOJbqHShbT102COKAD\n4vk/uV0WyALpv7Za7jF0CDoQcM1HammwvpnP5EcKG2eNiwo8QXlprouBxtJt\nsMCgO8+dzQevA982fbdCkWpeZ4Qic2zpvVzByNeby+TFPCwUAtvZxlDY/kOO\niY/f\r\n=aqhD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f9db084a3aed73c844554c3b223d5185727b6d07","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ec31ae1ed.0","@material/rtl":"12.0.0-canary.ec31ae1ed.0","@material/base":"12.0.0-canary.ec31ae1ed.0","@material/shape":"12.0.0-canary.ec31ae1ed.0","@material/theme":"12.0.0-canary.ec31ae1ed.0","@material/animation":"12.0.0-canary.ec31ae1ed.0","@material/elevation":"12.0.0-canary.ec31ae1ed.0","@material/typography":"12.0.0-canary.ec31ae1ed.0","@material/feature-targeting":"12.0.0-canary.ec31ae1ed.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.ec31ae1ed.0_1621974988579_0.5266655747877607","host":"s3://npm-registry-packages"}},"12.0.0-canary.8530d3514.0":{"name":"@material/tooltip","version":"12.0.0-canary.8530d3514.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.8530d3514.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7380ddb1a4e69a1f037a66a68f356b9c5273f25e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.8530d3514.0.tgz","fileCount":38,"integrity":"sha512-Oh0NgZw0B2leEmH7yfSEFqXBERz0MezT/D57YqE+H5jlQe4xEZ3FQk8K2w3lm7O38QczfzGQ/hFSZ3Wb/FgujQ==","signatures":[{"sig":"MEQCID+1uTprIUddomSWwTpID+kVFWmkoxusCD1uR2WGxb5YAiBgiqC35zZKzZhbXwV2Ud7veIh28KuW3CcCpLby1Dcctg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr8NlCRA9TVsSAnZWagAAoNYQAJi+SC9g16MFFKInypkB\nF+uCGF1FxittPH9rXRT9n9ZKuLI0DByYy6lsuq8IJPbLWoKEyL3oMUbXL2oP\nGI3hUGbe9ZS0I8jQ83jCHvsuYqLKFxAfVeg4Me3XwLCqjOHOPmebJ6tjH1rV\nLf1W2ozUTsR3fgZu5T4860Buu8ihQEX/Mez1/kdjcrMj6H4GJWfjG2SroAbd\nBX9cfgrORi89NylU/mS/dvEnMvnfs64a/RXM8P4bHA3rdvTGfgaan2grOU/d\nAfcuE7WbL1DUQeznu6QVf+Peqhtlxcmqmyv8mPBEnX1MuhHQy5aMSBD52XhB\ntbzXXV2uy+3ddCuZIF0mtfTDghOcG3WHGkg4i/EwDWtrssAeEckSk0lbZyHz\nfsnTrnBV9SwuC6EMamowyBJYvhcErV3Of6lbKJzmLofhBUBnsSqcs9BoobZV\n7fasHNfNPB9b/5M0PiKcfMv7Ldh9NlMe70i02ISVBwjdUJREmC3TC6LCMgEG\nfuXwQfsXM4Q/hf+ZgKq6Bgxwueu5cPsVvLMFNddzyqswintLlyMxITDb8NgR\nK0k8qvuRxM1frdzShghBdujGQwIIktPJApviD+/lZmKFQIBXLK4aQ1nHDAz2\nZKDwndg8QNWORJI279e1cXKC7+uFbffG9Ej78cGbJI7tsdA0mbtvvb7Qsc11\nLf1z\r\n=A/Ym\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e32508a69db8bd9ce4383a14f2c576d35950566c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8530d3514.0","@material/rtl":"12.0.0-canary.8530d3514.0","@material/base":"12.0.0-canary.8530d3514.0","@material/shape":"12.0.0-canary.8530d3514.0","@material/theme":"12.0.0-canary.8530d3514.0","@material/animation":"12.0.0-canary.8530d3514.0","@material/elevation":"12.0.0-canary.8530d3514.0","@material/typography":"12.0.0-canary.8530d3514.0","@material/feature-targeting":"12.0.0-canary.8530d3514.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.8530d3514.0_1622131556846_0.5066397472725819","host":"s3://npm-registry-packages"}},"12.0.0-canary.00b5899dc.0":{"name":"@material/tooltip","version":"12.0.0-canary.00b5899dc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.00b5899dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"175d3cbaa126c2b918f89bf2e31b03d0b2e4c507","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.00b5899dc.0.tgz","fileCount":38,"integrity":"sha512-vH57XxabUo3ce+FcPojcIflyPnAyMJagVsGXjcED8jmyDPN37BRwTp83GZq4of2/Vq2PcEgunNRiGyA2PzJXSQ==","signatures":[{"sig":"MEQCIFUaAJE+DtJ7RbLmJ/lZY+bq9umRdQRZSgAyN2Uk++2iAiAq5lvunczeDNEJQBMIguNxVHEXLkZVlFAZd1XSMM4cvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtrjLCRA9TVsSAnZWagAArWMP/0/FEVTN9CbdBu098HFX\nCIWtllrsd7Jzm73In3pR13940UVMg9RP+GO8K+OseYWbADkSOZ2Op24Dz76c\ncMvGQG1j+DLVVJHYG68imLoU5qD0O9nVgINaH5pQMgb8Ane67SYEEaSfOaMq\ncIirWEV5vgbQsMAo4nhgLoozC2wioQ6w+yy/gREyhoQerP6GYCbKHBt4We5U\nCjJmy8gpLpxyxOs+rUec7IkGE86TR7IEfp+08dkDclxrlcOXZD7zCJ7tqF4V\nU4EwkoSU3WV9toDzjVPltAnqYeclxJFrNiXJbzkS45Znws9TqxSN6MYhit3W\nnhkInxB6D0SBt6we2PEBb9wZqCwEMSXkrKdbKVSK4ZV1b/w1CzCI8Y99dLPU\nJIn3gG/9jHbJIFqcJaRUbzSNvF76G0kOlfrEv+/TuKTqgd8akyJ73ZW0xJM/\nx8nL9igvBNEhB+tqR/eS9/lYs0n3hOAihDfHkOoaC2laWW0ciZJ11KekK96m\nD9rUd0qyY21G6r4m2yvodsG9bQPYcUT+Bzc7kBe7yZRDxKvbEMgDK8YNRRvE\nIif/A+nmUFf7y482roDclvLbHzGwy38odv44tS5SF98vLT39miOItawuMUQT\n/rdWCrbeAQCso7dwOBcgcyitrCofdSxJ9hmQS8O//o6EtCUM4TXSF6oYRsr5\nnzyA\r\n=VN9S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"19ffd4cf15764c62ec7b1dfd76483a2919f6501d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.00b5899dc.0","@material/rtl":"12.0.0-canary.00b5899dc.0","@material/base":"12.0.0-canary.00b5899dc.0","@material/shape":"12.0.0-canary.00b5899dc.0","@material/theme":"12.0.0-canary.00b5899dc.0","@material/animation":"12.0.0-canary.00b5899dc.0","@material/elevation":"12.0.0-canary.00b5899dc.0","@material/typography":"12.0.0-canary.00b5899dc.0","@material/feature-targeting":"12.0.0-canary.00b5899dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.00b5899dc.0_1622587595371_0.86457935185111","host":"s3://npm-registry-packages"}},"12.0.0-canary.f1525ea3e.0":{"name":"@material/tooltip","version":"12.0.0-canary.f1525ea3e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.f1525ea3e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"efefd4ac1a40e60c7188d400b684a3ab800d2c22","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.f1525ea3e.0.tgz","fileCount":38,"integrity":"sha512-esNp0k4NMJV9UnYdWvMM+JEGu0C7pkzgaEp66BttiESCC/OcXJ3L5IakI2IvfhhGCRQurQIPx7nTr9+/+hk2zQ==","signatures":[{"sig":"MEUCIBP35wAHNC/ttD23X2Rub522dqGwJrxKd4cD6jMYIfMoAiEAubyWdCKXfglhElpd7iPSgPXBbREls/QzDLmnxORStLA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguN9OCRA9TVsSAnZWagAARLIP/iNpOazWdijJlFfwTHLZ\nrG61BD77HOMj4H8JzzSE7RnOC1QUDtS5SY1FC7HF+zAqepGzE6ahL3Ngb6Rr\nXQRUiW9YHclDTFsgWTW72kHB5o4NQJwsbnczzcTxcgNG+00u3JR5yziZWhnv\nJJhwXCBagP7dq6RM4AtOW1dFDBrTQirqqYiUGoboe/Onmt8vbr/K0BXpi2q2\nHCPlvrf5obw0LatkFtxM9cNuHGam/Vv02mVCn3VRptBTcwqBzz2b3KA4CxhC\nZ5eihsCPr8koQtptuJxLuba1EW3bzA2ojsAZ2V2gkxa0C3TJDBC+LjLMSlPc\n1p3Ixge318zp3hFg63bAgbcQFH5OxeHIDyHTCZrHY7nj3o5ZEvsE9F+D/Ht9\nJhl5lVBjX7dUbfgFZy0ZHTrjYz8TJN8IsZ0+DFuz2u9Cu9ZD9tG4AuGUvxeK\n0u6wzUMGs2bREaQtdOqoI9jIyKNwbEQI1hzU98hBSVw2msBESlyXImRdhEd4\nzSnyTnZJ1lmqhicsqOP4fBA7HTaoyrl7HcqHKNhK2sv+hiJcdx9icsZsKTCt\n3PtQRuDaZkQMAIG+0lDU6RjCFeTZJ7vWObOMhGqN0UTc/ZpWvYxhpE0syI1J\nOpxqNiis/bIKMVCYoO7bBmzXaQ/OT92iICdNi0s4oWKMMvvEOLcmD8EZtcs/\nQhmD\r\n=9h4J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"97ff3c2e33330849b0ca447ac6983126a385d845","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f1525ea3e.0","@material/rtl":"12.0.0-canary.f1525ea3e.0","@material/base":"12.0.0-canary.f1525ea3e.0","@material/shape":"12.0.0-canary.f1525ea3e.0","@material/theme":"12.0.0-canary.f1525ea3e.0","@material/animation":"12.0.0-canary.f1525ea3e.0","@material/elevation":"12.0.0-canary.f1525ea3e.0","@material/typography":"12.0.0-canary.f1525ea3e.0","@material/feature-targeting":"12.0.0-canary.f1525ea3e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.f1525ea3e.0_1622728526597_0.2649503853199522","host":"s3://npm-registry-packages"}},"12.0.0-canary.464a00286.0":{"name":"@material/tooltip","version":"12.0.0-canary.464a00286.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.464a00286.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"548cd4b432a446dd64f8e669da09182a0e0b0ce3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.464a00286.0.tgz","fileCount":38,"integrity":"sha512-hWIcEGmFE9ebibgCXdJcBp4SLV6Q2/zxfoXQJonSRiQUYMAidm6eEdLieRfvGC7nVJSts48WHg0w8n2+ESrWnA==","signatures":[{"sig":"MEUCIQCce+S80zcvuNk1Os7OKKAbJnYLt6BE6k6CtjiI9HHoqwIgT5OLeFGtHJA3ZJ0ZWlB7uRwuhur3I8vXrkqZ6WjfUCQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguOtxCRA9TVsSAnZWagAAYmUQAJPqR69CFw0NCUtC9l5z\nq1RBCP5lYBY8kdhjd1RAiQcU1kJeREZ3y4YwOtTYWstcC5GxRnWM4IfoqhnL\nWqoS8YyhaSkSHY5m1lsQ2SLD39Yi7c42Un6H3CUYW4lW3T+B5+4kt+0aNiXs\nu7lLsw+LA0+qE6X0EnRU+r7lEHpdNSp3l5UEkfFRi6m3JE5LSc66q+aFNcne\nzcnWvigNMOAHCxQTHEvQtRrpjMKrcKHyMifFb2ElMHDhhv1RT1kSZxE5sO4w\nLrtdkebHjiFe916NtXSB4FX66pojmi4bO3Ss2ozLitX+LI38wpdubdlPuyf+\nP7HGumGfu8S52AC0pLMg3yN4ekJPCY9iqoLMzKo9k+5FcHTRf3GtfBjrH9Yh\n8E5dN8xZm6SJb3zOdKZHS0jrkan0TguQxoMOX6BtPNOvn0wshQo5osctqXuf\ndbAq3D/2pKrs8Sx1tQRUYpXCneeQreVFmP5rewcjGUMPGIxiu+HUB0kVfyhr\nu3LeyqReXKI0o7vNwpOKEPSqUcyOL0d76fZziypaV9GSenF5auEUTm9aLC5q\nMLXr2onmWnkkPR7kRVfgeTt8Cn6AK1CxsQfc8MqexHLvF9VkLngTH0kGtCLz\ntDM/9hZ0V42wvCKk73CenwWvFKla8qnIJoaTM/HNIUGUgAKmwK5lA11EEhkB\n4GbM\r\n=K85Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ceb43f7f74f7db77edbe7a13d3b92e853d599d6b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.464a00286.0","@material/rtl":"12.0.0-canary.464a00286.0","@material/base":"12.0.0-canary.464a00286.0","@material/shape":"12.0.0-canary.464a00286.0","@material/theme":"12.0.0-canary.464a00286.0","@material/animation":"12.0.0-canary.464a00286.0","@material/elevation":"12.0.0-canary.464a00286.0","@material/typography":"12.0.0-canary.464a00286.0","@material/feature-targeting":"12.0.0-canary.464a00286.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.464a00286.0_1622731632827_0.711797481345718","host":"s3://npm-registry-packages"}},"12.0.0-canary.474de7878.0":{"name":"@material/tooltip","version":"12.0.0-canary.474de7878.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.474de7878.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"97483456d05ba39a71cddde8de51af9f74ab1faa","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.474de7878.0.tgz","fileCount":38,"integrity":"sha512-PkmymRNXt+fCN1b3/s01spIZZxXrOcDfQx/7Ss6jAIdmeRe1lbfs7XjvMMBPOfrNKi1iHQpOYmWFR/JVRG1L2A==","signatures":[{"sig":"MEYCIQCmRhZgNa93m/pVUFCKubLYDnmf4cowZ/WrJMFW8sgUBAIhANVVm3aAHHm+zKcbzWhiDWF7/9QFodui8lPAZ4LSGh0A","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguPIBCRA9TVsSAnZWagAAfREP/AuB4n7cgKYUojknfFyF\nhtW8mETOc9Xr1QVMDLv/J8JgKoGzbWCMfBJS3Upaw/ri/1oeqBBaICOR7erS\nho6Z7C0kGKlSNhYB1sRMF9AHtubrNRDYEiGtJh0YxJXElf0ZMUV/x8N7mXu/\nALyV8s824u0Px6MItXeBnX8ZA58sHhrQ6TS7WKCQk1VcPf74gAJYNqy88MW1\n66MQcOMC9Nz3ikemu3SMO9O3JlmIPLWLXW9On6edP9gkBStpUN6jUpgS8RCm\nOOpFL5iInFWxeUyoLfMKZmcvOA/8KtGGKWV1bXc+9Bc812XGhuGAVUsIPvmW\ngX3urMbZSSQ+eFxlKnXAENqvuB/L5M6E8i5GXh0smQUI4al4VklDCXmRizbm\nTc0LYB08jTmgj8PvNHwi3RKNMH0WTgCCZtb9OQ9XomgDdAF8N4iu6/FQ0wgI\nwt2IqEoa6c9HxUXUnT5w6HjTip6KV7DD+n9lv5cMTudXnjDIF0EuHdOo0Wlt\nkE37OHBcEAJaGDwSORHJXHOqnkmM2XhNNKa6PfyB4OVXC7d8hw+x+LpZ8Jr+\n1D7gET4bzPWtZlfkC6kLOH93jvAcHEI1I3p4YNBfMnyjGgvd8pacLw17sAtZ\nPFhLMEbO/dLn1DPWdQ7xhXfaD9evaK0PfUS6lcx0hizFzhXwdGm78c4jkX0+\n3jxo\r\n=IaI8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"67d604ec9cbaa0dc385eb36be35e0adfe641b244","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.474de7878.0","@material/rtl":"12.0.0-canary.474de7878.0","@material/base":"12.0.0-canary.474de7878.0","@material/shape":"12.0.0-canary.474de7878.0","@material/theme":"12.0.0-canary.474de7878.0","@material/animation":"12.0.0-canary.474de7878.0","@material/elevation":"12.0.0-canary.474de7878.0","@material/typography":"12.0.0-canary.474de7878.0","@material/feature-targeting":"12.0.0-canary.474de7878.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.474de7878.0_1622733313067_0.5933325421668532","host":"s3://npm-registry-packages"}},"12.0.0-canary.b87ebf74d.0":{"name":"@material/tooltip","version":"12.0.0-canary.b87ebf74d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.b87ebf74d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"77db64d63bea74dfa4581968a7223f18e0e5c667","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.b87ebf74d.0.tgz","fileCount":38,"integrity":"sha512-CtKh4pJQ3MOw/9kZyOKv5FNmPlVEM5ACLKmvGs40/E6KYUFuIH3AtRceUSGTdZK9WlYbM7g2q0uvSUexr0/Hvg==","signatures":[{"sig":"MEUCIFvzjjNgj038CYWmyjd//hxcrNI4gwaLJ3VhKeV5Ike8AiEAp0cvsvvD/vnXXDqFhDqeZ780dCHdOZ3iEMu3N9B6/cQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguRWlCRA9TVsSAnZWagAAeUcQAJLsi0jnqxnc8ghx/nCf\na8q3xrWFZlYr+O4/O+IHY4P2qH/llaUVAYMQMmzH2PenBzWl8Kx/K8qhknqK\n0A5MPHkRMtWdu28IyAto8mWyTUohVn1++Qd72UEBxqb2ej79K95wwRdf5ZjD\nPccr0wrfr2fv7zLDmk2irMYxPmj8KteT/00i3WOBqhNmbEqKfeCP6p1tZSeX\ngr2jcp9Cyu7+7w8hsAaz4/c3CYVMNDpbruKuziUtjE8HtrkrsZ+MDfhStK5e\nVnBcvS+kqPkSTPiBOfWbofdiGfSEmw+ZM9JLRP++0dWJwgIB0OJ4PZzJ6fs2\nGgrJsIEZwXNPMIpM19NRwY16YBRq+II9CkjoFBLSZ7hD0+XRghcIn14hPN7J\n0XEuz0YZtcF0zHHn/jXUF13FJcB9rFAOQiRrMMcY+w7kdPg+r4ikZUUfb5RJ\nFmyP+5u673XQMjRcU7Of82N0dtZUwSd74+Bj6ndBrwQsAG8LL52RR5R/ibPy\nZusXzeaFgKRZXR5aDh4VoQPTMmqXZA1nS6UbV4Lkf2XUzEFCEpnBf/hBp/Z7\nHBD/g8Nv8dhUP6Try+TuMfO1CTQxBwqi50+qCQxEFs/P+puE0uM4wcYkOyDo\nMoVsWmD7kiRN0VzoitzPjZlKO0lo3BldC5gBcwYC1WkJtsYoJgiIpm7hmn4E\nVZye\r\n=SXqc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d3567c6dfa0fd347d2141fb92460c63fac28b46a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.b87ebf74d.0","@material/rtl":"12.0.0-canary.b87ebf74d.0","@material/base":"12.0.0-canary.b87ebf74d.0","@material/shape":"12.0.0-canary.b87ebf74d.0","@material/theme":"12.0.0-canary.b87ebf74d.0","@material/animation":"12.0.0-canary.b87ebf74d.0","@material/elevation":"12.0.0-canary.b87ebf74d.0","@material/typography":"12.0.0-canary.b87ebf74d.0","@material/feature-targeting":"12.0.0-canary.b87ebf74d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.b87ebf74d.0_1622742437060_0.6092114296272721","host":"s3://npm-registry-packages"}},"12.0.0-canary.2daa49b35.0":{"name":"@material/tooltip","version":"12.0.0-canary.2daa49b35.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.2daa49b35.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f46311d6593c294043c81575917e4d5f1318fd16","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.2daa49b35.0.tgz","fileCount":38,"integrity":"sha512-vHjFaOQ+nS//Ftuir2pt0cHxtsJ6hNDqxgfiDDTVDnmD/a/kw+7OKKWrQsTB9zVJjosRAAqWETij6Z65tmvLLQ==","signatures":[{"sig":"MEQCIFAxyDYLmpxoO6+8l7KhtpJP47IoUTwQhJ2F7BsbJmGeAiAnaU8nuGwLrrr3bAk12Z9R8ibgfaXd6ldwUYQgaizvvA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgulGNCRA9TVsSAnZWagAAmbMP/3+TRCTn8dq+ag1JsMFn\nVrlQ79aoDVa1N57ZEZmBE8pRnfM3r6bKpAqZsF7UH5l2dI+/8DiG3b2o9IIb\nn0BUU+n83wQ0N6wol9i8M+HZEykY1DtG8W+3KmRfrD6JJ/H6Pjnv2Xuw1/DH\neWO0d7eomOQCCM5NqhnW/3vq0cdDIIiGm4BQoe6sH7nV36JjkQXaFPyBiPDE\nlaVP7zxGWBpD7w648qdpTOj6fSjYqX7uR5Uy4rq2KCqcHzZWgTWVCSqqZskp\nB1zw/9QGmW5IGjLkdY+YxgbIM8r7yQyVAFR4pvw/yoMtcak3LC76RFepPuHN\nWGCytedq8I5l1xFal98dX3n1urXK9m78y+umUX1NJVAB8X6GtTfdJSoVc/66\nSSFWGsXUkR/LG+KfSn+d8Ll4Kl0I50bkkG3jgcir3i5Tbzu125TknVjlRpAx\nU1xf/WbhPKGjfeET4Ti0MVqtazurkAvSB/sFWx4u6ujKqSeZDezqAOdsukoc\nvgVplgF7X2EGAHMC8foVMTMCs2bvAImmftKol66qqfpUL/Oyzhv0SJ3CgZUg\nYyw0EgSVmy0qIcu9Ma+KqQMyGxctqyXEAzHtbrb3+AVxWx9PZevLrFuMtg3/\nOK30V+zzRGQEwDLqbFTAVJ7n/WufC8gPoUBItElM3g2hZA1MvR8HeIjg8Vsd\ngRVC\r\n=RrUa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3e759afe4116e5fb3941df918249b1b1348fe684","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.2daa49b35.0","@material/rtl":"12.0.0-canary.2daa49b35.0","@material/base":"12.0.0-canary.2daa49b35.0","@material/shape":"12.0.0-canary.2daa49b35.0","@material/theme":"12.0.0-canary.2daa49b35.0","@material/animation":"12.0.0-canary.2daa49b35.0","@material/elevation":"12.0.0-canary.2daa49b35.0","@material/typography":"12.0.0-canary.2daa49b35.0","@material/feature-targeting":"12.0.0-canary.2daa49b35.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.2daa49b35.0_1622823309158_0.09711884773367618","host":"s3://npm-registry-packages"}},"12.0.0-canary.08db3d737.0":{"name":"@material/tooltip","version":"12.0.0-canary.08db3d737.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.08db3d737.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f90e046379c4c501db844ee05f6bd83cbfda3550","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.08db3d737.0.tgz","fileCount":38,"integrity":"sha512-8fART6edfLqblnaBD71FJboEMgMpk3LjSMTPlDN8gTSTjMo+R8QdPpa3ljN7ACHw1PekB1tQg94huwIW+wNoVg==","signatures":[{"sig":"MEQCIAxWrewGbqtMpkFS/FGF4IhYuRRu3gqUdvRdPhwJC5n5AiARM0bugTDkxWwwy6rnpPea6ig+nv5fInThMCUxLiX2rg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":797832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguoIqCRA9TVsSAnZWagAAeVMQAI/fmRAlE+TxgpOMC6f3\noWAtLrp3wGT+ksjb2XRBra3M1DBd/Z0T0NvB7cxoJMZKIj/C/nRd3/UOUCHK\nn+Eu+90I4yr9GJMNm4sRXsMuI/hWR2EBKoA2hLjq3X+L3dmPuTF/lmB3pS4a\niowcSCKZX1sDzwhzKL86KGXRFBzQ1w+LQeIJUmWs8qbAi/01MWMk7XEWHTKT\ndxD+PQ1gosGMLcAZ2PhAe2zx6ZqMzJxjNOWAs51lqSSPg/FKBTDkjn01Y+xr\nZwj/43cit0JUDLihTiTIosi8V+qvhoqUGEkFZESeFu7+vmWZO5IxzUFJbXfH\n7vWtz8pzARDuBopH5KdgfJJwjFFsH+b4NdHpwxnTnyrJsSv4SVJHFQwX/lAe\nkH4j8TtSc/7O/6FzfIMTX2sob/FX+6+KDKj1IuBSg1I0CnCo6UxgruCXOzt8\n5gRtXgZTuh3WIDUjZ8616vgYFLaCv3vz77DIU+bWUmDXZc+Hau4KTt0WvZqb\n/pv8pm9TcsbHe9B9fc5JnbOHvjbOg+5w0aWblQa4QcXjM8eABMe2g32YDPUC\nstE8vq3hYNOm02AnThvXImtghpPnOTaOG4cMlzw3SLs7mqOo0A0tlKdW6B16\ne4EOwqNlm3nhZooOvfoWDDsiaRtUc+pr4QyhG87NcpL3u5s+MOsxBOarsDdQ\nvfK7\r\n=MeRS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0175b9a3635a8e6c8c6690948618b55f39ca1ffb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.08db3d737.0","@material/rtl":"12.0.0-canary.08db3d737.0","@material/base":"12.0.0-canary.08db3d737.0","@material/shape":"12.0.0-canary.08db3d737.0","@material/theme":"12.0.0-canary.08db3d737.0","@material/animation":"12.0.0-canary.08db3d737.0","@material/elevation":"12.0.0-canary.08db3d737.0","@material/typography":"12.0.0-canary.08db3d737.0","@material/feature-targeting":"12.0.0-canary.08db3d737.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.08db3d737.0_1622835754505_0.8050241509157066","host":"s3://npm-registry-packages"}},"12.0.0-canary.5823407a7.0":{"name":"@material/tooltip","version":"12.0.0-canary.5823407a7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.5823407a7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f02b09156191f4993f8eeb179d90ecc6bb96e28","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.5823407a7.0.tgz","fileCount":38,"integrity":"sha512-tuUDCPe3ZIq9lCcY/6XwNCzppGu54a7MBgYZfUHae7f0BwWlWQaSZ6x2HPJK6OYKB3gZ6jUeZfeocM8tCI+u2g==","signatures":[{"sig":"MEQCIAF4RUNIEa+S31y659hZjxhXwO3FK2+5TZ7p7d0HJr0fAiBLThMlG4ZiuWma0dnxb3dPbd9HlIb4i9ZKvqDe0JBr6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvr6XCRA9TVsSAnZWagAAMJMQAIcWESRE7cDOUvhf22gi\nrFYweE2sWu3iloD9qtUNyodUnm3VtW2JfF/hQ2JvqCXJSRsCnYQJRFflsKDa\nYagtsNm5tbXhyk5XhU3jZUjnT1qjPLR4RV+UiLoG5Udt/JiftG68QD1MghwR\n0gub28EfnasSUaNUMFejWAij96t7GQcQV656mK1dV2dk4ZPJIh3lOMakBB+d\nnycCW1yyvwUZ8zKjIFVXYY227B8BZCI+pZg8Ct4O1noe505ckb+ARxlMhOjs\n0AOQD/JT7q+UwM4z/AYVnZ917NJFJ2BEOQJL0rkxrXAnr1/o6HwCZc7itaEM\naAwVom9L9CCXaa2+TKizsBhlrLefPi43EjvRSKXeNC1lZ6OpTydeNFW3sCMM\nShxXgKm7hlOhedq7ukUOjNJSQiIeht2mcyIRhv1GyS+Byywu3Mz6siQj/vB+\nanVEyTO26Q+homnOLxpIQIqVZlfXRI9mKJIA8HmMXBRcthrIyI/g0xmxmcre\nb00H/R7LlbqBcSvuV3/I2/RHTDU5CmHtxhRBVCihrbyJ3QGHIc1mcDWWBJaq\nMbQTMF9h88Vc9xw/6KJbND3eLmK3nbuhM6qtPqayClE5JoHxtgE+aIJFsGSQ\nGis/ujzn6EH5gLduPswCPvzu1lu8SQ5NUrfS02nkeFKEx7JirDsaGshT9YVt\neYVP\r\n=O89+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"dd3ce4590e0d881d04e885d116e10e680b6c01f9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5823407a7.0","@material/rtl":"12.0.0-canary.5823407a7.0","@material/base":"12.0.0-canary.5823407a7.0","@material/shape":"12.0.0-canary.5823407a7.0","@material/theme":"12.0.0-canary.5823407a7.0","@material/animation":"12.0.0-canary.5823407a7.0","@material/elevation":"12.0.0-canary.5823407a7.0","@material/typography":"12.0.0-canary.5823407a7.0","@material/feature-targeting":"12.0.0-canary.5823407a7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.5823407a7.0_1623113366894_0.3118098375143865","host":"s3://npm-registry-packages"}},"12.0.0-canary.23b0c5e22.0":{"name":"@material/tooltip","version":"12.0.0-canary.23b0c5e22.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.23b0c5e22.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"51573ff6cf139003353e31db7ff4fe00f3d3993d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.23b0c5e22.0.tgz","fileCount":38,"integrity":"sha512-P/OYbCVT5OqsNQRs46vRhOE8McdALCTcAtUy2swq+Iv79ipBE66HrWUX8J/d2tUhnUDahuA17ab7jgkVrwOjsQ==","signatures":[{"sig":"MEUCIDef5Qs+mjNx1ncgogVWA/h2m+T2I7yU98K5Ddc/oS2yAiEAhfbkpGJrp7XgpLU7XJTQaDOVBkPWmPX5I8hBLXQkNR4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv5lxCRA9TVsSAnZWagAA4kAP/RPVjymtxdT2+Ug3+Gcm\npr44g72pQN+Xhjihu/NvsxIdQlZnpv9whpy6VRT/3myusal2fQ4Ty6a/irTR\nnC5qLCLJByfXGQycoB0rpt8Tq6JnnfyWnBFDP1WjyJXH13R8JpdN3ChbRF65\nxK0obQ4Pep8fUo2hp5qJt30+ekgTwp0ZRiM7g4RSpL8dvU+JS/Sikq59ziO/\nQTru2dqIG9yloYs1Rpj4c/SZyGqoE4xJXP+pN4sLxBRtciE9tyFV3tgJ0LX9\nCse24vxbx43oCgv5fbi/jVwshaCDPc1PJtN/wW6xgGJU9xUU9VNWaRFDsq3C\nOzFeAK6cB/cYjCMntcdcO2GvxlNw3CMKLeQp+ggtyzjX0vzivQ+o99nF207u\n8t40YhA5WKhO6M/ZXiGxwWYXeeSkyb1YgjRQ3VSBmLLfn1Pl+bHEQqAMsX4K\nsAGFLhwUxb0Gm0RyfklLjpIhIKtwX14HKVDPsMTn4t4kx16jmaEAemLjsOr0\nvlrze7N22Qm7znM3FYdO8sfl3/xgri2hkrnQPrn7Kzoy6ZGtsI/LhwukrKz+\nqohY48xx5ha3Dt/4tQLR8h5XGEFFOTnqospt0mStUBMhaqOKKxrT1H0JMJIa\nLhPFlhWT5Wu1xvfLpnKWQbGga4l+ARn8Y9BofEgPGFIwi1WK9+SlCld2dcf0\nQyvI\r\n=oNHQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fc55a497a3b0d48a691942de987d781555ef9d82","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.23b0c5e22.0","@material/rtl":"12.0.0-canary.23b0c5e22.0","@material/base":"12.0.0-canary.23b0c5e22.0","@material/shape":"12.0.0-canary.23b0c5e22.0","@material/theme":"12.0.0-canary.23b0c5e22.0","@material/animation":"12.0.0-canary.23b0c5e22.0","@material/elevation":"12.0.0-canary.23b0c5e22.0","@material/typography":"12.0.0-canary.23b0c5e22.0","@material/feature-targeting":"12.0.0-canary.23b0c5e22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.23b0c5e22.0_1623169393558_0.9494985034431029","host":"s3://npm-registry-packages"}},"12.0.0-canary.2952c6a76.0":{"name":"@material/tooltip","version":"12.0.0-canary.2952c6a76.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.2952c6a76.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aaccc186d91c6551238044f981bfc81990b87af2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.2952c6a76.0.tgz","fileCount":38,"integrity":"sha512-ORoHnpf0v82rVeKSKgv++0KIGxbwsWI1AE3bMnCadKuFRxDifQ8jq0FdLMkaZpaKKnY67iCvmDNwRZWd/4YWEg==","signatures":[{"sig":"MEQCIBzFJeUihPcueDK3oPv12kra2qt7PsBgiJ/ftSGc4OrbAiATS8a2hzsf6oLQDn9FAl00u66NTu1mYjNTXi/4AkjoMw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv6vfCRA9TVsSAnZWagAA46MP/3Ey6zPhj8nOT9ntDbe9\nC91FipkP8mXBg73mkCh6QzKyebTb1RL5lh9yP0/7y4yw/r8JHxU4qJ1+lHMk\nmBP8W/gUWhIbKEEsbBNsxTUcAGTypds92d5U5lOhtt8suyOb8atphmDRBO4Q\nJDAkeoyc3y23LErFz23Eua7aKTxbBlEusmJfriNpyKGIjFxYklldg1cWpQ5P\ndX7C370AKxqpWFqruTpgEDSGtEbn4lyY/h6Qtpp9zDlQaoPq/0E72E4mrWZo\nF0VHYgqOBbs+KkPZgvEq6cFgh7Ql19GKe+JZ7fAEZtu+gh5sDgAEMguQHMdf\nh+IiFUO0gpTSlkI8hhdmOH41dJXxwAj8Kb0W5yR0PExViC8XcHte1vNwLRMl\njHvjtYRBCLZ4Bm1B+pzk56EldzFEXWxOUWzCYirA9AtsdI35PouWB4igJytb\nRem192/KRtvM+bZ7EktGL3XqUtRX2axHYEqCNNXeed/fZ0xRXPZ9zjCz8PNo\n5+B0LdzEEsDodFR2fx6tmPJ0YR6Mr1dZSlAfe5QGHfttOVKzQVK5JSdSuavV\nRnu1O9uKmSUYZ5YOgwyDohkiv3A4FYq8i6NayrVa98CPoY39z6QjwK6okOUC\n9OHGcKLHnmQ/YmnTRmHYv22kXAMFlDESPpCjoKCir6qgoThYXpOcWqXyqfzT\n1zVJ\r\n=f5kn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c1b0afec5d55ef54d74fa1cea1899368fe5c7180","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.2952c6a76.0","@material/rtl":"12.0.0-canary.2952c6a76.0","@material/base":"12.0.0-canary.2952c6a76.0","@material/shape":"12.0.0-canary.2952c6a76.0","@material/theme":"12.0.0-canary.2952c6a76.0","@material/animation":"12.0.0-canary.2952c6a76.0","@material/elevation":"12.0.0-canary.2952c6a76.0","@material/typography":"12.0.0-canary.2952c6a76.0","@material/feature-targeting":"12.0.0-canary.2952c6a76.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.2952c6a76.0_1623174111260_0.14296406035419684","host":"s3://npm-registry-packages"}},"12.0.0-canary.f12425f88.0":{"name":"@material/tooltip","version":"12.0.0-canary.f12425f88.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.f12425f88.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"69a8e522d9a3faf37a37e71d9514c0e1b93cf8bb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.f12425f88.0.tgz","fileCount":38,"integrity":"sha512-X5pR0PHhJculRhfnMa/9IuJskPyEC6ySOg3psNICIs694onrl+L7VGtmCDORy+KRUTIt4l84uH8ZMUhHsK+dlQ==","signatures":[{"sig":"MEQCIDD942VY8PAy2Jnfjtn09tSDAOtbp8MnRXksKKfHlCSLAiBK7XMspHJbBZbvt8Ii0YV3/NBfuzfRcumyqRvUdeZ9oA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwWXGCRA9TVsSAnZWagAABm4QAIOmYjV7c0x/VNS2TaUj\nKm0mVTLGdUjW6VVprSCeUuhyZ9MZnhkwWmCiLmwWFITw4oF4Bd7Xyq7ea7M2\nk+osYSIgiflw9iPyHmtE2BNSYmN3ObiBdQlt1ZBk72j0fkCP4cBKKg8jaVGs\nwOWFJdVji5Zu7yuERh0oX/LV9pHDYV4BJ2iAeJcoYaf2ft9zU0nKtn4qTldL\n4Fuk7eah0EBf0NwISZMjYw8QRCZgU5JCKaOsDZNb1q5WwwgWQCmtaDdzh+aK\n/JPNpf8GAYostjAQ+Opa3hkmOdcD4DM/fLbeozutZrfkB/I26G0puJntNuoU\nBklvkz9MYLkK/rjHujJa1/omBwvo5g/0DvEg2vcbCjXNFyVJGdNIJtDjBlvu\n8uWiBLE2rAk7ghY/R6bDJtzUlONkIKnYh9j6TrroWMSnOhTR3XpigJdqZtY3\n6j8M7x0IgQS7Cfdae22YgEeAfn22V8IU49ZPw8U8N+UfW7t9FoJDvNZ3w15p\nTcHD0XPJz866guHNwSRcp5OpNb8LAJAaIy5mIa2lr2mB/BUe4XVUcCcpBL5c\na6w3ExyadOL7REfF5AtHRj4Cy4EHgKLOtK3bxOTP1tLyqdiTjiKw0Q0zsv8o\nUyiS7PpE1IfTJjMees7UWdagl5pn8pKzmWn8Y0Vj56AGbqqu++R2krFJBzST\n7YZ5\r\n=5QsH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"c8fa3a7d372e06e42b474eed4ef3e4105dc43301","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f12425f88.0","@material/rtl":"12.0.0-canary.f12425f88.0","@material/base":"12.0.0-canary.f12425f88.0","@material/shape":"12.0.0-canary.f12425f88.0","@material/theme":"12.0.0-canary.f12425f88.0","@material/animation":"12.0.0-canary.f12425f88.0","@material/elevation":"12.0.0-canary.f12425f88.0","@material/typography":"12.0.0-canary.f12425f88.0","@material/feature-targeting":"12.0.0-canary.f12425f88.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.f12425f88.0_1623287238265_0.9770600715721252","host":"s3://npm-registry-packages"}},"12.0.0-canary.e543628c3.0":{"name":"@material/tooltip","version":"12.0.0-canary.e543628c3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.e543628c3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"66476ac8f8185281ba36b7f1e4f42e1aa7efb662","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.e543628c3.0.tgz","fileCount":38,"integrity":"sha512-YribcZRvEQOvlDgGFlIGOZWxQXB1PP48xbMumfoNopiIK/b84VONRQu8Jqldmu05py4F/ueZHxkKMgC7m4bVPA==","signatures":[{"sig":"MEMCIC7Em7QHT5JVjLgrFyZZgSHFQkkHgE0VWxlEsvJ63NF8Ah99Exv2IHmKpqijH9INaPdnABFTEi7Ju7MBJ/xQmSb6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwWYECRA9TVsSAnZWagAAX+IP/1dby3Qiv1E5PKgmmdsC\nCj+Q3gn2r6Sr/nfltk6kIZhMZ+og1GGfGCo2vh/IBjADkBS8Rpxobn1GMRI5\n03Vq3zGtkhMYpZF/MabPD2dWraltpTXBm8+t5IE38WtxNdbCbKz0VtyG/zXt\nHC4otcxnx1aHDy1Kv6gO6jRtaj+VLvYWTpwmA3XOgTZ3N29C+gG2dzB8uw2U\nk/MG6BG8M6v9HrHnxaMghlyrMTc6jfSjma+5QRnsPjJVHFaI7kmC5XqEfHMW\nEzic7xDh6lG7qrvWOw61sk+ApUUN4YOVVh2FPfoJUkD3gum/ENMDuoWZtqLn\nC72wQoiwn3bImw7Cnk8mBY68slfW8PaW9fkIFcdTPRB5UXanpc6oigWdJJb6\n9mvaXDFPG+M7WcUK6W+z/9TBu/qyLwl/plPnS5TsiZ8UDhGMWTwM7YUtVh96\ngUb1yUEDpisEgXgeCQsE9NASkI6DXe0R+cHnWyB35mH9P4w7N09dNh5y9R59\nm3RFhpfzcDOB9Eztj7VpjioMUUE7snxzrjSy/8x/QzFmRXBvXocmPPlXt7bE\nmgbsx0Z6yfXmAwlk/ZB2a8lMRJez2+I8O9/HqC+penL4fSJmaiFCRlYEZjQ0\nvAbZJWFlSU2HicFVUr3euMS3Ra0kqSzQMN74b4gkhgcaRJcbjaJsEmgHRIVA\nqonn\r\n=X7ND\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6e28195a46e3b2108c76ee1a6a9ea9416276ce52","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e543628c3.0","@material/rtl":"12.0.0-canary.e543628c3.0","@material/base":"12.0.0-canary.e543628c3.0","@material/shape":"12.0.0-canary.e543628c3.0","@material/theme":"12.0.0-canary.e543628c3.0","@material/animation":"12.0.0-canary.e543628c3.0","@material/elevation":"12.0.0-canary.e543628c3.0","@material/typography":"12.0.0-canary.e543628c3.0","@material/feature-targeting":"12.0.0-canary.e543628c3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.e543628c3.0_1623287300562_0.8408464077706439","host":"s3://npm-registry-packages"}},"12.0.0-canary.e0c346286.0":{"name":"@material/tooltip","version":"12.0.0-canary.e0c346286.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.e0c346286.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2ab2e1e86f3e5d83f9bbb89bd9bedfe1c7f66e5f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.e0c346286.0.tgz","fileCount":38,"integrity":"sha512-uY54KFdobI0cQUrx2rDCZLWOSDU+Z4RQWJQo3DZ8UKsX1MuoYfrmTHXOu6o2/t3pGd+3w1BYIBRJMT3JbsMLZQ==","signatures":[{"sig":"MEUCIFe2l2a+SAV3v2T58LsOK0bMQIg2uJmdnX/fbmbGf6rHAiEAonI+ZMelpy/HTWNEJPGfaHM/ZlQ7ET5mKvep7ur0zS8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwj+eCRA9TVsSAnZWagAALz4QAIltBrgLNHiyZhnmhLj3\nQCeS3Ue0fhbckMR9LJ3b2UtgEAxK3pmhBEzZyxNd2UR2Jiw9SIchob28Qvev\no8JKY3nq3jpHrpafq+OVPfxu+ljZGXsdRXFUBlT211ZOwMgA8B7P8CP/uZQ/\nL3E45Rj2bEkaJKOM0Lw6A+tvw+cvk1OoG5/hb+i3K6yOct+zj0TrpofITnlH\n0JrZiU5dlL2Ss4RTU4sv4cQYo4kdX0wNFknFVjP4weSUT2/RVbLS8fB40P45\nL1ZnkAwV3EsLZYF7opc3HD1ic5r56s2Eph0pM/8Z0AQiQ81xH9J61mYxQ3v7\nELhNv8sIwKL0yP/oK5L8RC8IDJaX+zwPB/dPLUfykE/KuXidF6zbexVkI04V\nWWEC+CVOjwoGe9r6hLr04+eDbWtzxi/KGuDeHO4ZhAKcoKh8hjB0YKOQwdj/\nhzURnwgDRlKf3mNwnTkVXyC/qLQI3jrF0nMYEb1txmDfkAHyLh5uTGL4URqz\nLDK7YfSpfhRit41EuzKt2hqaCaB659ZcTbKT6J8pFIOoS4fk3Tw/+EQKW1Y0\nMHK+/iCz3RXoJM0WSwLGJl1WGZXbyV62iI2zci8NUgi3o+xz8uUWW/x7QbTo\nGw5Xm9J55IyFvjsoD1AO2ihrdox3E8oLoHGmAfmvkbF+FKk1/N82gZREPvFM\nUK5L\r\n=ijkh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"405607237a611d804caa0b022897b683aed90ccc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e0c346286.0","@material/rtl":"12.0.0-canary.e0c346286.0","@material/base":"12.0.0-canary.e0c346286.0","@material/shape":"12.0.0-canary.e0c346286.0","@material/theme":"12.0.0-canary.e0c346286.0","@material/animation":"12.0.0-canary.e0c346286.0","@material/elevation":"12.0.0-canary.e0c346286.0","@material/typography":"12.0.0-canary.e0c346286.0","@material/feature-targeting":"12.0.0-canary.e0c346286.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.e0c346286.0_1623343005804_0.09099983934325473","host":"s3://npm-registry-packages"}},"12.0.0-canary.f43af5633.0":{"name":"@material/tooltip","version":"12.0.0-canary.f43af5633.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.f43af5633.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9bf93997f0ffa5a75264023569ed0d1cc6fff319","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.f43af5633.0.tgz","fileCount":38,"integrity":"sha512-6GN5z/+3ag9E0FD4jZJ7XgBVtoGrmn327vc/HZBOm0UejIrCDUbwLFXsCjtx5V/GRZsZ6c42oEXMNhrxCMXEpg==","signatures":[{"sig":"MEUCIG9LO7eg4PJ49Gepwip8lRzVFWSy+7Zr0D4grHgfmrvEAiEAwK29lNNdH5dYzjfIh3AV9cgc5c2heiwfwvH6hQeqWME=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwnfbCRA9TVsSAnZWagAApiYQAIgmOwypzSA0W086Bzr/\nqDTcTiRUCWtfUNRVWPJkn/QkA+f/4d5pv9CBp63tgnQ12IgRForQ1bx+txfZ\nAL4lmjRMCwfQe8UpS6l9fIWu3vGnvBjLfHrolkC2uMBb9yKEDgTBEYZbxK0b\nSHecBuxUdWuK1/BkubB1LBKOO1iNY7b4H7DtaBPsCGHEum3MB6PiJw9beJ1r\nT+pI45F+JT3GTOTcf+u5PV/fHhgBadhWcaKDh4X/295t6RwbeMvGKd/iUdnh\nykti838wDu9I90ha3+bmtm0rkxsogF4oNng+cTavxLtkse2svQtrT9+vNNUf\nbXhMuUPjW9e+yBbrKRsdOJsnTlMaKFyJrSRJdh40acBwM+aZxT159nVn1/YX\n1f6/i+fwNgE4/KpFAud0v9oJLKeEmbE3Ymtfe2AF4x7MzvFsPbPZvZuR3aHn\nN0pOWa7f/72aIVDS/BACI+niLs6xqubvYPcg1kmcUuiKapPOKkeSOd+vVeAd\n8YOo689WP5hTE0is9a9Wjp85+lssazOSUxGfWTdI9lafs0HLM0GVUqfF1icj\nbh1VhAMiNJTg2DiFt4yK2saqQsJ86xaagZxf51u0pQ+oytn3fcHVQ80WPMYm\nIDNlhIBINO6uJMczMf3/K8/yr1/Ojs6tIZqPhKn1sOqiGcr/d95jt6+3dtF7\nnpdN\r\n=FzZn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"6889f0098642c4b4f3987ba353e17a9a22de856b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f43af5633.0","@material/rtl":"12.0.0-canary.f43af5633.0","@material/base":"12.0.0-canary.f43af5633.0","@material/shape":"12.0.0-canary.f43af5633.0","@material/theme":"12.0.0-canary.f43af5633.0","@material/animation":"12.0.0-canary.f43af5633.0","@material/elevation":"12.0.0-canary.f43af5633.0","@material/typography":"12.0.0-canary.f43af5633.0","@material/feature-targeting":"12.0.0-canary.f43af5633.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.f43af5633.0_1623357402871_0.6780176880315611","host":"s3://npm-registry-packages"}},"12.0.0-canary.8415ae585.0":{"name":"@material/tooltip","version":"12.0.0-canary.8415ae585.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.8415ae585.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9805e56dc32c16016e78d04517003ddf616100c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.8415ae585.0.tgz","fileCount":38,"integrity":"sha512-L6uWrTe4knzyBaOAjTqy17ZfMMej4SgEcZxTj3Qf1yGz7sVg7fCg4MMt+OO26UMkmzp5IXpUXwXoIfo2sZ95kw==","signatures":[{"sig":"MEUCIQDTE/qyWML8oV0Tf7N6MHEIZ2tkq7iYBHjB33zVQE19dQIgT4Hey5FoWFvlJPgGhBH8Yhu5nP6Gleuj8AL3zrrnEXA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgw4obCRA9TVsSAnZWagAAV10QAJTNmvHKLR/wPVYrTB69\nJJR4q9jchMPOx2g13NuIiffp+3/nXNk3TKUzmB5QCax+VX/dptt3w5EXr+pk\ns3vEZQQyaFirTZj253s4tZu7vVu1mC0BPQLAW1lfwOMIaoWybdg3u6D6S/zv\n3jv7Lvz5fTAcoHDr4FStiCVccVLl9QXnB8VeXEFehbl7cFdHjzKE+sJGToyJ\nYxTz691c4Ggu3PtEhr9mH6CP+A4XdQew1lT40wO4SPZ0j9r7wcnFCe7opJiy\nb/VLUuF3LfLDR32PuMGYHeyqnBFAM4bub4G2FCfoqkjPGz6U1utGCPDyKSGH\nFUEZZ8zjWrq1qVOxY8iAPDFzDn7kjq3xrG8XBQRltCPXcRvJrM3uONcRR0G8\nDlPJOZQ4eD91koiioQEGK47+unq3/0/u6c2U+wSwc586a/Qf4u4aTM4ViGhW\nlO4Vz6y2jZpUnwo2qDDS8LLs1sp+3/5LuQ5zd9CplRMz/s9P8YWOIoj8r7vD\n/jsLsZYoX3PrM3ZgdT4dAuqd1BXjx/BWBjtlf0JuU+q1eUkbOmUOZIEaMcPk\nURZaDUsPma/jEg0UJIReVqsnDYV9q82+UvPePKzTPJL8pkRPTPkA/YE7yjmy\nlER2kiNEJaIxqJqWpYNe18q3xS+i5WlN4gt+F352Nmtjdqz4+tp16eyDWxoz\nyohX\r\n=3yZC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d00f19e41330e3956e7355a23ea132e5ff37403e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8415ae585.0","@material/rtl":"12.0.0-canary.8415ae585.0","@material/base":"12.0.0-canary.8415ae585.0","@material/shape":"12.0.0-canary.8415ae585.0","@material/theme":"12.0.0-canary.8415ae585.0","@material/animation":"12.0.0-canary.8415ae585.0","@material/elevation":"12.0.0-canary.8415ae585.0","@material/typography":"12.0.0-canary.8415ae585.0","@material/feature-targeting":"12.0.0-canary.8415ae585.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.8415ae585.0_1623427611569_0.6747219585174065","host":"s3://npm-registry-packages"}},"12.0.0-canary.598fcccc8.0":{"name":"@material/tooltip","version":"12.0.0-canary.598fcccc8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.598fcccc8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dc7faae47a1dde9a14710f19e89b74c8203c8c0b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.598fcccc8.0.tgz","fileCount":38,"integrity":"sha512-tR/xPMBDCndP8wYyVMrNxt5Iq4wZnIBvYxruYPsc/gJMsRrLL+D77SOcllrNLgkJgq8DOT1iz0IQszFdIPNvkw==","signatures":[{"sig":"MEUCIQCclnpXPB6GQKGPmK8VgESRSx1EPtzk+zIp20Ii/xiX1QIgWukg4nfjBiRCCXvi36q1giXhoPbzyUPcy4/hCYmLPX0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgw9nlCRA9TVsSAnZWagAAjNAP/3R1buZ/lMo0K1jaxtgo\nyxb4wI2f4FHN6IukGYZXaMOng/SnS79J/MHalSIGs+YJdY9tfa2ftxyYMF0R\n/O7w+SuAlTojT+sY1zI5PVLZqCBiURIEg01DfZMvEXxQmXO4FbodYln0Sjko\nIKBmHped6DENpdVuSuS+aOy+hlNxE0vDSaMU8YjBhVSKaeNCY0lfmXNtkb+j\nQOlyCRZahoseT7OohVkfqbXxvEVrpLCuQLeKMJtslIt2xsSJ3DHFkD1CTjfA\n5Nr+niNT9X17Krl2bZx3BZfqE8oSXBBeDBpg3brjBpjmk0Pdl0s8lyQU64Kv\nPlJ7pgWvZQ0QTDDeRmeB6KMOUZPng8xCB2CXmGiE2ot91P4WjKC8NiwZR7/S\ng160oKCjBUDqMcqUsgttXWsjEux2TM7M8NS9phUEekDdOsrhGEhvhv0BRFX/\n7RabNoghTgGvlsGvixa4iiywVmNDjn/3wmV8d+hQ1b9D1pVnCenaYh0Ok+CE\n9PcLsAQnOfG9TDXzhCGZfg5fsIZDgMDUB1IDHF5nkab0oZh1GYUyh4wcq6Z6\nBhbH31RU+OU/x25F8Ab1Dy77/1HYjcguChgyN3r3CwqlKHk2Y3KFmPrAg5Gy\nw4JQFeDYQLlbmIIc1nNhGCLOzmVr9xMTBmNWvOKugWEGuK+L3euGqxssgYUD\nfRtU\r\n=vJLj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ccbc9ce9b0bfd89a7b5d57d3e0d6bc2ae297f66c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.598fcccc8.0","@material/rtl":"12.0.0-canary.598fcccc8.0","@material/base":"12.0.0-canary.598fcccc8.0","@material/shape":"12.0.0-canary.598fcccc8.0","@material/theme":"12.0.0-canary.598fcccc8.0","@material/animation":"12.0.0-canary.598fcccc8.0","@material/elevation":"12.0.0-canary.598fcccc8.0","@material/typography":"12.0.0-canary.598fcccc8.0","@material/feature-targeting":"12.0.0-canary.598fcccc8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.598fcccc8.0_1623448036762_0.1797729988605543","host":"s3://npm-registry-packages"}},"12.0.0-canary.5d0605188.0":{"name":"@material/tooltip","version":"12.0.0-canary.5d0605188.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.5d0605188.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a50804a6ba74f2f1e7a38d8658bc64477200b859","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.5d0605188.0.tgz","fileCount":38,"integrity":"sha512-eozK5cSn9ZcvwQyUrYA9yspYBJCbv7F0t9aF/SSlJ4jDsSN/wLkGK1Y7kv0cKQaoQpxRSVevoiRTBFJahiZY/Q==","signatures":[{"sig":"MEYCIQDvIPYwvgVWwsg2Iwy3l4U/IiR//V5HwXCeWpmyCVzWdQIhAPoib1vZZKkpQf1EslnmvuTV4PfMNB64DRjZCMXVxyZZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx5SACRA9TVsSAnZWagAAmEwP/R/3c0r6GtfjoGd6fAH+\nQ6jcXCAA42J8qoOh1SsiDOKYw9opcr0mLP4dt/zVZHssR5E/rgc3xweUwWUt\nn+tfhHJd8T6byyS4b2R08EAoVNuDHLnSZDXi5iJ1EWuIfpzPZNVI7iBGru12\nASgJNbIx+6XODLAh3QZpj4dqR7c+1Io2ZelsMxuZop90nRPyGQxOkUZMTbhR\n94YHMrbOl7EbAnVzY0tNT+75ZlzCF+QY/aMNH/6q8JyhIbDOWCsLOfXsVNvN\nD4zrCp+kUV096IejaLx7pfhLp26VwEfZyvnYM2syKh/hrldKuZ8/y7fj1TZo\nfOoRFOu6FHBsi2CG35z9fpVqUNopEII5dwHmeYVgqXq3HGiLve9OAN9kyAhy\njaUVLEfZPhhysBBZMGwDVcuNT5efgmRJc65Kpx+dUDecpVpX7cn57fdzVCa+\nPS0Sd4BJCjPFN3x9QddDp/ff5zWIs6tX1v3OXhHgZgmLkNaxxkP8ssk5y1Vv\nTLEEgqzVkrlVzSOc76TAEyqgKaIZi4fPXvUZ7yA/JUKIvLnDE9VTLyV9L8tn\n1r6iTHUuDCDIOIxc/L2M6jJ1zw1Sq81dtt9YjnJRddzQZOAJSu5j2qOjuXvv\naHMd7uczOC15fX7/UxpaUzbGJKuPTuOcSQMkQ+CB8Z4XkzYddo9WatfAWHFN\naWaF\r\n=YK2T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0ecd220c6043621c1d471242f32f317475b671f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5d0605188.0","@material/rtl":"12.0.0-canary.5d0605188.0","@material/base":"12.0.0-canary.5d0605188.0","@material/shape":"12.0.0-canary.5d0605188.0","@material/theme":"12.0.0-canary.5d0605188.0","@material/animation":"12.0.0-canary.5d0605188.0","@material/elevation":"12.0.0-canary.5d0605188.0","@material/typography":"12.0.0-canary.5d0605188.0","@material/feature-targeting":"12.0.0-canary.5d0605188.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.5d0605188.0_1623692416471_0.44889624618836965","host":"s3://npm-registry-packages"}},"12.0.0-canary.f147a2271.0":{"name":"@material/tooltip","version":"12.0.0-canary.f147a2271.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.f147a2271.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eb395beacf9e6fbe027d4746baab9e734b2a2029","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.f147a2271.0.tgz","fileCount":38,"integrity":"sha512-NWx6QAV2dZJzRLvdpcszL/m5ynsnesZJ/hF2j1EH/LTqnu/WWfPIgvpv4X2UTt/LuyI1onQZAunYpBeVSREVUQ==","signatures":[{"sig":"MEQCICggjGRj2cJpxSMChxUfQ7WN7C6kBEeMzQW9dmUOaWOcAiAul6wxHM31jhkc9s/OkIo9+Z/9IgPiDvS/S0vqCth+Cg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx6utCRA9TVsSAnZWagAANgYP/icsbY71nGQiIzn+K2E7\nc3mPDdoVhkHoVliKcY2YTPPm00fejIgO3Okd8wXDI1iDEbwKVKKSjqvcwlDP\nHbIVv0f15pZl/JmvFBLC79kXwWvxGw1opi3FdFVohjTmHcD3udkpPWvHmZC+\nTLGKxjJRZXuYUyWZPwoKJ7SCvBFpmYCmXIJEQOL+aJnRbS38hHztI/hMxY+D\nomY3NoGfgUkpWk5DtSL/E5YZRuiCdgvnbTDqAAwZ7oTiX9VaBpwWiZ0eyAv5\nITiFR+NU27A0ntxKr2yVHXeAOPqtgiPPwPZG/yJa55rFtcW9DeBW2YOlyRna\nNHs26SUskDOeUyWcfc4SvVCPHgZoL/Ou2chr7fHoBbKKIkh4z+Nz8WbIDE/S\nuf6+8yOMpRQHyxbQwSPB/O0usl/McFB25juJnFEtd02GJJI9JRw2ZIGlZAyn\nGKMNu9I6OeiLKcv15/jmZBKcXdc5zn+fjsdqwVlmNbAa+qnEHk/Qj/aJUMXr\nM2PSXv+nlAUdxca8vY62mK8MIaiLAAbsgeb86GmwDVBbz/NLWe8ZH3l3/+ap\nAhetHQ94185M1BOgNZlJCOaNuGN6GWsudb4fWSYa7zzf/dMyQmiyin8HibHO\nS1evkacguWzoWAoI/xpETij3uPD+WJm2zDeTFFJlP5YD3hk0BRNUqy8X7JGH\n6GC9\r\n=5q8/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"70b871f06c34302277b9eb3064110dd70afb181b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f147a2271.0","@material/rtl":"12.0.0-canary.f147a2271.0","@material/base":"12.0.0-canary.f147a2271.0","@material/shape":"12.0.0-canary.f147a2271.0","@material/theme":"12.0.0-canary.f147a2271.0","@material/animation":"12.0.0-canary.f147a2271.0","@material/elevation":"12.0.0-canary.f147a2271.0","@material/typography":"12.0.0-canary.f147a2271.0","@material/feature-targeting":"12.0.0-canary.f147a2271.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.f147a2271.0_1623698348795_0.872929412182831","host":"s3://npm-registry-packages"}},"12.0.0-canary.33579e00b.0":{"name":"@material/tooltip","version":"12.0.0-canary.33579e00b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.33579e00b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fad6647a6133d3ff5d6208c91f0cee487da82f16","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.33579e00b.0.tgz","fileCount":38,"integrity":"sha512-B7Uu8wtEDL2rEtzuNx1jffEQnl6Sc9hs29gKTbLc8Nb4TnviQ/d3GsX02dhhtlSXv+uoST9emkdS0W2rdXDFWw==","signatures":[{"sig":"MEUCIQCZLOMLzxoVGUw0h06xhy5djkbmp+xeYU6b41J+a4gFTwIgZ4nNDk/fTvx577XcIfrvXzCHZrPfN8B4bXg1VeowRi0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx/LjCRA9TVsSAnZWagAASFoP/3gjxmnH8hN+ydRRH/+R\nJKWjCh+1utxfBgIlxeNNXJAyDieRqvAI23eG9vmO9yTFDbKo9o8voKWOM117\nGNEhPtsmCa7KhcaLaA14z+anQto1/RwmzoGum/PwbCutmZygCvyt1H0H26Cg\n044SCu6PgCjdM/132yFa1DObnjf4pKCNN/peWvnr9HDwsN+k8poMhqnmcs8W\nGihg/sSMc4ZFwlF6E4cK4YFErcyCD3Q2yOSHq6nz9+ExNpPOWPv68mrRqyc5\nwYHn5wkZizAcNAqNlMsLTn/MA6UAwqx+7WbJ0Oh1hZKDH8jGIspbmgURf+OI\naW+ddWSE8Bwl1Orf2yT2WxA/rBoG9m0JEMmzRunRgmnUTG1EJ1ZLiGyZgMfw\nEOZy28n0Wb8Oj/jFbTKfv3ac6XbG6su5qOmPGERM77EuB7s0+UaOnA0KWuux\niMPxpncm/+/tCrWnk06s3JtGJQOloJTcR6fWHF6GQvdkphny6JfY2ornzXRb\nP4hfvEIIxB0yEwLyYXdUZ8Zia8MICMYONma/zMAh0ji1qVVAGCYwUWKjA6K8\ncsQxWV0wV0U8jnvNKvzH/8EOh2RnDJ4UQmGrrt9ewDRQHxOj6uOA3qtv+qjI\n20q2J9BRjLi5JkZlCtuQa62KfrzKsPAncSQ34qN3h3c/9lIev7Fs6Hn1x6D1\n8gSo\r\n=R/77\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"13a815cd8b945d23ba7ba2ebd6730088fa195237","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33579e00b.0","@material/rtl":"12.0.0-canary.33579e00b.0","@material/base":"12.0.0-canary.33579e00b.0","@material/shape":"12.0.0-canary.33579e00b.0","@material/theme":"12.0.0-canary.33579e00b.0","@material/animation":"12.0.0-canary.33579e00b.0","@material/elevation":"12.0.0-canary.33579e00b.0","@material/typography":"12.0.0-canary.33579e00b.0","@material/feature-targeting":"12.0.0-canary.33579e00b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.33579e00b.0_1623716579293_0.8279142386926679","host":"s3://npm-registry-packages"}},"12.0.0-canary.a6909c0e6.0":{"name":"@material/tooltip","version":"12.0.0-canary.a6909c0e6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.a6909c0e6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"53ec28644479a15cd32174179ccad0717bd935de","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.a6909c0e6.0.tgz","fileCount":38,"integrity":"sha512-nRAAR6k+DRLEvJ6tbw6BfBL/tiD9z4yUGJFYgMYWgKiqNzo+m0u803EWMF6VW2pnFuyaWN9XBJMLPXBhPiTMJw==","signatures":[{"sig":"MEYCIQCbqPGB6s7WTrly3dyvicXGqyKIHUVOTjvN/2N9XvkxwwIhAIERYJWAq1HOBqWV1LIf67u+xI2a2WCER8P+PRf5ksjX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":798764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyPHjCRA9TVsSAnZWagAAANwP/RU+K0maqpoR34vRZwh7\nfeFDwMCnd/x0wdooCiTLS5GS1nJdbEFm/mDTKTosm0PcyFFCGJeP2lVcpMjm\nGpPutMtwxJ+4PJXhWsJOrSXJXFhy/beyEzN+kn5zHnA4mjOBiKBlSxp/fQeT\naDId1QZH3c9gAmkBTCeDRcJ1PCtAToLZd8hhsABGpMMhFztf4U+D/nVZEcKV\nYLAAWekzLrXXqbZDqt4LBAqi4JW+7JxDS0ohHK2bQJrwX1HJqzXhr/jDa9Ka\nQ86WgVqBIiuGSDbJG4BWiHypgDzfQWAQmfPAdxggJvmoYCrgXr3qNHiPTpPS\nqt9DlygBZ9IsnJ6WUKi76V8Zcdkb/gSf/mHXqHBJuxDeNsl2x+C4iiMm2eQM\nNBxP6Ka0939xpdXE8iUPRTAFdCarofBIyV/JDzKFHwjrdAS3qiSZy853x1SX\nHaJ3Eo6EuxB3FH4gb3oA1xDWHhz/1mNA4N+frJE6Eu9s+AIGcrKwupZnrVD4\nyu9iS/7/hm9xcrGsTPjZ6rIWFzraqVviaKXkN69iS9I7ipGFHoUQx0BShrFR\n3ZdCrX3oNI7hBd9i0DCCSmQ0NUvvOnQ37j2rG6UE1+wSoeFVCDa13oBhz2m9\ni8GW5V11a/PLCVoRBpqjX6EONvyzZYSlM6X+IiRq4Krk8ErrPP9TyFHdMSkM\nyLg7\r\n=iXSc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f4852598d008bc1750e5e9d2a0e828aa8804f87f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a6909c0e6.0","@material/rtl":"12.0.0-canary.a6909c0e6.0","@material/base":"12.0.0-canary.a6909c0e6.0","@material/shape":"12.0.0-canary.a6909c0e6.0","@material/theme":"12.0.0-canary.a6909c0e6.0","@material/animation":"12.0.0-canary.a6909c0e6.0","@material/elevation":"12.0.0-canary.a6909c0e6.0","@material/typography":"12.0.0-canary.a6909c0e6.0","@material/feature-targeting":"12.0.0-canary.a6909c0e6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.a6909c0e6.0_1623781859539_0.8124328012241526","host":"s3://npm-registry-packages"}},"12.0.0-canary.c18b5925b.0":{"name":"@material/tooltip","version":"12.0.0-canary.c18b5925b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.c18b5925b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5deeba4d02597120da84720fcc4ae73ed4c6fde5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.c18b5925b.0.tgz","fileCount":38,"integrity":"sha512-K5Ec569QTFdcRBrxT0C6PkktMz6ITWsWo7zBZQnav8l+PglrufTIjuCytz45/IVi9GtPW7UlshLHl9admsYq9w==","signatures":[{"sig":"MEQCIEf9vbYukxECZiTWMJ526OB926YldBkrxo079gURbpNPAiAwOpQnAQtsERpDQ57dwW8cGCtbvHxvw36R9nuLpIr58Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804177,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyRXjCRA9TVsSAnZWagAAC+gP/2NU26WUGSyMNEYmahbC\nKQwbzZl3K5vzCk8oc7d9nkFJc1x+AhOjCzDYj08fmzd+tAV9oAKHVz73OUpW\nuj9QF2ok/0YaKNp/smfoYnYrMp28SOpCuQZqiiO2gs6a7rTyri/qZFcHEsCe\nxDtFprkGJiJzOUBMhTAO9W8gKaQ6ccjnARijYGHvVYjn7ibXubY5SsjkleeB\nqLiW7tFVR/P9nIUiIi14j/c6vuS/wLN8UNKqyE5UFZNIdwbxe8sU/pbBwnk9\nLcBpP/ufJY6/4sTxH3MqHggsqDcFBPLL29MxpL54QKYliynQAzjffMNLpwTH\nef2yace5T0LRa9JocG4WfrJwBMr5FPrVS9V9DhipgPgtcjfkrVhaW1P3/awb\n1iCFeWVCCo5wIDgkbrysuZ+JOGBBDnBEhgDnyvyE38HvOgaBJg/zwwf98xKN\n2ElnATpzWwNqCS6JU6/Zg8pQwIBlBEvaa/siMDVdLwcDVXYsvXbiulGc0sKc\ne+0hs/6Y1U4GkgZLg22MTkV/IYMzObALErqCk9yETbSz8GlJ1w/ae4NLRtyg\nuu6pPmCy74EIqGPugu4DwHYSAJnxtwB1h+3bOhh9478rIeb0/2VWnkbE7chy\n9k6vZ1BIDBVxMfXUdUzjOSGQqWZI04mKpY8kfbkK2QQWkOqdKY6pxS4zf4ax\nYjdc\r\n=0BK/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bc767c077b93ce415f2505e54f329042c80b0d3c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c18b5925b.0","@material/rtl":"12.0.0-canary.c18b5925b.0","@material/base":"12.0.0-canary.c18b5925b.0","@material/shape":"12.0.0-canary.c18b5925b.0","@material/theme":"12.0.0-canary.c18b5925b.0","@material/animation":"12.0.0-canary.c18b5925b.0","@material/elevation":"12.0.0-canary.c18b5925b.0","@material/typography":"12.0.0-canary.c18b5925b.0","@material/feature-targeting":"12.0.0-canary.c18b5925b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.c18b5925b.0_1623791075811_0.40280781820213574","host":"s3://npm-registry-packages"}},"12.0.0-canary.271fff902.0":{"name":"@material/tooltip","version":"12.0.0-canary.271fff902.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.271fff902.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2d40042f748044acf48be41bb409b536f711b095","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.271fff902.0.tgz","fileCount":38,"integrity":"sha512-TX0G57ervCmd6Rb0Myn6rKF2rRKyrqqwY1fBEyIwGtB23Ygurk1EOa0Qy9sExwOZtR3VZIPYg5BBaqbzuGAEeg==","signatures":[{"sig":"MEQCIAlDYCccR0HMjAGByC+nKHAKEBhH1kfzRK1/NzJ3t5fmAiBuPnuwg/D2FhVhpvIw6ZqTtLKha03wxQ1NJaEqUp2mhg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyS8SCRA9TVsSAnZWagAAkVMP+wZRDp1sZI5SLBFDMtFo\nWxz5mqWWY7dgrQpaW+hxmGpz2iLqLut5fRdW/2phNNxirnq6+YwC2P+U4blp\n82t3HMgFPeTVQB4G5Rr/NBKgZUcK3z/2/FAVL/b4q8IZC1NSArfEsQmCOFSI\nkxXN38fpa69eXJTEQr8OkWhWzIOGW8f6J78bBl6yV+Iip2THreJO+ReUQ4ge\nBZg6w2rv0sOLF7SOBsSJo7Osd3HJfkMfqg+/nbE6cWLde9NaVkaO5tzz97MI\nQJhFp93tyCoXi3rnRxiF4zuUqR84ko2DpbPuvCgmg6t3QvM2ecrqoZ8cEpbO\nWjiIvIKZ1F6gltO0rTg8+VhArIn1FxDsXqQrNKLAzQHoiyKyFvu2GT6inQ9u\na2xB+lt9K3QS4/cCKAOve5QKATvU9aKWrY88rnb1OWxu275O+ZCu2lzv9jdD\nHBoI1n/HQKhNlNbSUwAJAhd/EK0gHakd+GE6crpL2idPpttJaT7uAXsYBbTh\nqiNslrutq3d3zx+daIIG0ubqoulRYeq2FIrKY03t3T1ApNJVt1nJVwPYh5FR\nnhu+rTCq1NUbFfpzyOV14Hp5uziWQEGfSk0W77Hq57BrjKcVr/USQCOWP52G\nKWWHFS6lmUnrOt8oD7nlLbVbUD7KEQ20FqC1j45kXWJ8DNHg4F39EYt20OaW\n01BF\r\n=R2EA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4306227bc7e5f014c5e961178b436b394f0dee6b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.271fff902.0","@material/rtl":"12.0.0-canary.271fff902.0","@material/base":"12.0.0-canary.271fff902.0","@material/shape":"12.0.0-canary.271fff902.0","@material/theme":"12.0.0-canary.271fff902.0","@material/animation":"12.0.0-canary.271fff902.0","@material/elevation":"12.0.0-canary.271fff902.0","@material/typography":"12.0.0-canary.271fff902.0","@material/feature-targeting":"12.0.0-canary.271fff902.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.271fff902.0_1623797521829_0.2584031294514466","host":"s3://npm-registry-packages"}},"12.0.0-canary.7ea2e830d.0":{"name":"@material/tooltip","version":"12.0.0-canary.7ea2e830d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.7ea2e830d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"91afc83aca4285aa5abc696e6ace9f02ed18fe87","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.7ea2e830d.0.tgz","fileCount":38,"integrity":"sha512-r1151jHP6wYmJgpkNI4ZoGsSx4fcm1N6QlCzrSmmZQu5ts6CozIcBjJDZys/NR9TF9/nGlgKvg4PYXWzRKyl9Q==","signatures":[{"sig":"MEYCIQDxgDp50wcTMbG0ViKEu0RudZDbQ/pEnA55XT/7wAEv3AIhAOu/a+1h1Io+z5UgI4uMEfea0kF1/h2Dr0bdT2BdDPEU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyS9SCRA9TVsSAnZWagAA3ngQAKOVmFrKkEmHIglkBvSh\nKIgCw7sromWzxE+BbUPlP4b5iGYNQUr75Nx0Ln4Amy3CUJE7CzzRUARoAT4r\nAGC5Af0phnWnrVBBM2eUXATUe6e3m+VeLFDV1xCshJi1XPmk+tk+9nzpeHk7\nGPoWs2/Sbu9LJCY+zFOCSJTuZwl2hDq66UAw1q5xvKpEV4jn/N4ZgtajZD+X\n7/UCU5FeIhwft62RbATK0slEDe/J3qWi8Kt1ec8Wv4JjykBF6OVsav2RXPL1\nC2yWgBAmFmh3fYzZNrnOSRd+8ewHCEFMuYDkA8p6LCQI6Ljs7eGPwlOkuTL0\nWiSA2e6+3D4zFg6gLMoGP4gTEagPqdXov72ISF6/ZKqFN7Q3EtWPCmGCVjMz\nwwvTAUw4h1FgkkE8cgNKIru80OFOEwKvOWRjOwvLst7O+7lxryWLSxSSSPon\ntQSmlgqV14QQe0BexuGMw1u9Zps7dYkWSARZSiQcgIId0V52vlhv1fkhdzj7\naqMclElyiAPJ+HKRFqfQJbh3s/zZ7geQEiv4oSt5M+cW0SkDiKPjdxCD7HX/\n5cacHBNel8onOtcqzL6EbKjrNQpBBXHATHHmxTEvdVwSIPpmsTL1y40lkFbp\nKD5+hQyci703g6qsU4nwg0m7L/vCdGzq0luwm2TFXU07iwfgEkWNqobg/GLv\nLIsS\r\n=ILQZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"e1f3cd5692e7f4572664681a049ec1ea1548eb15","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.7ea2e830d.0","@material/rtl":"12.0.0-canary.7ea2e830d.0","@material/base":"12.0.0-canary.7ea2e830d.0","@material/shape":"12.0.0-canary.7ea2e830d.0","@material/theme":"12.0.0-canary.7ea2e830d.0","@material/animation":"12.0.0-canary.7ea2e830d.0","@material/elevation":"12.0.0-canary.7ea2e830d.0","@material/typography":"12.0.0-canary.7ea2e830d.0","@material/feature-targeting":"12.0.0-canary.7ea2e830d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.7ea2e830d.0_1623797586719_0.14548310779972762","host":"s3://npm-registry-packages"}},"12.0.0-canary.d96f0a1e0.0":{"name":"@material/tooltip","version":"12.0.0-canary.d96f0a1e0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.d96f0a1e0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e424b4b783608d9c17f59bc9f89e9659fbfbc4d6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.d96f0a1e0.0.tgz","fileCount":38,"integrity":"sha512-zU8TxprTDbvSmBiUad37RwZJ3U/nm+aFx96gNQzQ3bsiCGbsdvT91d1/NHrAcK332UXEvJPVXsMzak3i4Va7ng==","signatures":[{"sig":"MEUCIQC7YlDG0tfAB9/jdwDdoW/EvU1jfE7JX5VfznE5be/ACwIgIzUtAbjma6uLQgdkENaxaoFfJ+MVM4lxkJZ2AjglQ0w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgymgKCRA9TVsSAnZWagAAwtkP/1kYxU07aN1OGWmaRvuv\n01Wtk3sfoJeVgUxKFdmSbE+0JKbZvFlzxwnZkLnBuDE7XnEm+NPwdYejXDMz\nJnT+7uGIDcnW1JEX9/QoLLr/KxaXVAt4tX7Cc388q+WMdlJ68AmoH1WZOthf\n/h6SmzMBHMR7lwIxwD58HaEQcw1SICyPk33Ps66605NKitAwVGKD9lzjWb10\ny7fVpaVbLLQ/qdUQlXYRFbhUXXEtl9alr8kfzllsYrDkz4fr5x/j8Ekk8aQc\njBM/S7ZTSPQSo7UN1PmhQAXsELPqTFlyJXInjm+j9iDYJGtH1lGzcM7h4J1c\nK7zceADYKUSCoWorJot3TaFsmAc/Qu5Un889F/OQ4ZEusKTaFVTRCKv514ri\nfXQUxz6c57eMAXJaR7k3HY0ZV6E/5K/40k27R7eTVoyuctzqzSdaPhfEhp8A\nQjYlSP7i8jRf1z+lNZ1+zN/v7rwEsRlgrNWQwUGqFmM29otDFpysasbKSEnE\n/uLGmscGi0oWvIIRb6cHCOpTRC+r3S6FfKi6nUmqL88oOvhbs2cFsYLxMNqu\nqJiqcnf2oy/ADj3yuCcxF3PlP83OafhmmVnj+r0o1L0I/iCl6izbvJ37taoG\nieXOymM2RAJ1gYG0GKymf3IFwltulicNuVeZs1eF4FzsUUU+p26wyR1bT5Ne\nKtEh\r\n=T4wp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"32470ff9121448fb2599b2985e276f51563ed4f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d96f0a1e0.0","@material/rtl":"12.0.0-canary.d96f0a1e0.0","@material/base":"12.0.0-canary.d96f0a1e0.0","@material/shape":"12.0.0-canary.d96f0a1e0.0","@material/theme":"12.0.0-canary.d96f0a1e0.0","@material/animation":"12.0.0-canary.d96f0a1e0.0","@material/elevation":"12.0.0-canary.d96f0a1e0.0","@material/typography":"12.0.0-canary.d96f0a1e0.0","@material/feature-targeting":"12.0.0-canary.d96f0a1e0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.d96f0a1e0.0_1623877642093_0.8634441816238307","host":"s3://npm-registry-packages"}},"12.0.0-canary.a6183801a.0":{"name":"@material/tooltip","version":"12.0.0-canary.a6183801a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.a6183801a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8b398aa12541b06c6b09d46ebc1597d165a59cf8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.a6183801a.0.tgz","fileCount":38,"integrity":"sha512-M2YAOAcDkC7Bq3oc3a0frJ7LBFo5BWsMVDa92TgeOSRmcGYrlTI6qyjgJue4A0lZi643RCU++7j777XwsYjEAQ==","signatures":[{"sig":"MEYCIQCGhC9Al6AM/9rey7fKv/GzIzsaAAEjMorQ+t56C6hkwAIhAN1Dj53VTBoKKVf88BFnhRY1vGfbML2ErxoJ2m9RSg2a","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgynXkCRA9TVsSAnZWagAAtUIP/Az/NoF3c/yBLXwqZFVT\nQw11/5B2huS7xKaQXn6Ou+LCzX5pBNLxYTbXmp/RGwQSNJH3Ye/0Q0/eR3pA\nKuMC6UwnKMxOdDtDUEnE3q/5ADlbig8prKg3LLZN0tEw7HwJNRWtLN9O6k37\nd8PEQkYMlbLHvqY36oFNtupZnjempVsVLxh9u3DLbOnHKuJUkfE9hW0zRA0T\nZ2FuYYmzhXc+0wZFoE9nh2rx8DvhI9wpNfp1y1u6ufJqEXnRGNDyVO7rPPYo\neMXkuqAC1JXKtiTUS7ZCJKHM2zlpW/MZ3TEgPJo/bk6RTjLcXzIOAlqO1I3/\nOoacRulPCTehRX0w3IDuqmmv2v4/GC9nPVK5/rqNlNX2XuRR+GAgpHt5sQBx\n4tBJi2IkWpAthFEPFffEe68QcoGHXhHfv+7vqKtL15XY1txlpGFQHfH+J9id\nHFaPBNzbfC3f5GuyyrDnSq168tUvQ6/63dHU1ax2aIL1zE0Lh+T+NlTmI/cj\nuBNQ+7Shhf4MCmQsxtX3S5epy00OH3QVyVyMGuf11D5YePT7tMSWob92tpvI\nWy9pTxVK0iEx2xYD3DxUJoQIu4x4T1EajiJKM2JaWM57xk2xQAFtO5DFx9yO\nzBBwO5Oww/CEmpn9U/gZh+Nn8oQqzZ8htk1kR9K73aftsKivnUMpfKfm01DI\nPBXX\r\n=U1xV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b5eb42f66e2a670e1f9573b4feb1a600a95b49b7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.a6183801a.0","@material/rtl":"12.0.0-canary.a6183801a.0","@material/base":"12.0.0-canary.a6183801a.0","@material/shape":"12.0.0-canary.a6183801a.0","@material/theme":"12.0.0-canary.a6183801a.0","@material/animation":"12.0.0-canary.a6183801a.0","@material/elevation":"12.0.0-canary.a6183801a.0","@material/typography":"12.0.0-canary.a6183801a.0","@material/feature-targeting":"12.0.0-canary.a6183801a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.a6183801a.0_1623881188531_0.9597919709939442","host":"s3://npm-registry-packages"}},"12.0.0-canary.940550232.0":{"name":"@material/tooltip","version":"12.0.0-canary.940550232.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.940550232.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2a63379fc50ed9e412fdf40bb6d7ea5fb1b9ada3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.940550232.0.tgz","fileCount":38,"integrity":"sha512-vvkh4HOwHfF0G6p3IwwVR0JXosGmTjkLceDeYzQf8d/oLyhi7mxGmT6mdfIGo+F478hFoegtAmoYtVDqJxiJfQ==","signatures":[{"sig":"MEYCIQD0gicePoQDbnwbzj3PNYBalOawHKRAFQ1NpRrfmXxfSwIhALlraVEJehOXZF2M531kcU7u986ADwJRlxHMX4pGqpcv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgy6VbCRA9TVsSAnZWagAA5QAP/i7Lkcj80P3ZzXmyeH//\nUxHptZgREapDZX5mzTECIyBxDJtwpq22AWxSVewmW8ME4m5gjBgyA0zEjxJi\nRe+QzQF8MwdNF9/eR/+c96o+vFfsOgtrxBTlzqbX3gOGFvNRVhx1LLZ9IrB1\neYXjoqY+YgLoOE5E6+zPQ+RoKHbadwORFFj+fev7kOpMEkwgcXGI3RrSUn06\nsTtkhwPreHNyHXZA85pvyGypyOoZoeawatj5WRLLjbT6Zno2iwJlf+ALnQuS\nrpfGpLOCvwHd3yjlYY6ANk0RsPwQTsBg32zYldfSxpa5cVynDZ6DSfdI33if\nBekhauMKjKc5gn5T7AVMJakho06FFzHiChG4vxbizp0/wFJn9gK4fVsmX+9W\nWsL6h2cHa279O96V76g33jSGG3jMkM/j6YPyIrD8ZyVKZVapF52n1EQMR+dN\nE7MrLPHF8FR15GEIAoo/t7SfQPaACiNEVOoJ5dnPXIV7TKB9ef5CSPawcP0E\nQP2iYXe1vcuQR9hzlrXfRHPlQ5TL1jhVj+fCb52wRGLtn4jRQ8YsGj4Nv99H\nMks5kNpY1/x08jmN1iMlpqyxftBjVVPePB0UWUhEHoZMq7NtbXeIJ+JofGHV\n65rHapgGAb6nbiQDsIg045hATy1cM9BC0SmA+JSEOEHvudKQZCeNTg0DbLLx\n2Mcy\r\n=5bM+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1d6560428828a2c7ac90d050a744265e63c8563e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.940550232.0","@material/rtl":"12.0.0-canary.940550232.0","@material/base":"12.0.0-canary.940550232.0","@material/shape":"12.0.0-canary.940550232.0","@material/theme":"12.0.0-canary.940550232.0","@material/animation":"12.0.0-canary.940550232.0","@material/elevation":"12.0.0-canary.940550232.0","@material/typography":"12.0.0-canary.940550232.0","@material/feature-targeting":"12.0.0-canary.940550232.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.940550232.0_1623958874617_0.8473357931262244","host":"s3://npm-registry-packages"}},"12.0.0-canary.f705e8048.0":{"name":"@material/tooltip","version":"12.0.0-canary.f705e8048.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.f705e8048.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5cd888610d4c6a45522e8cbab634edc3e33b44e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.f705e8048.0.tgz","fileCount":38,"integrity":"sha512-Pt8VjKev32hpBc6IjH8K2YIHna+ityMheZ99lcXSb44FYQ95hBkazoQiV6d1z9LeZCtDlGTqF0xpuH97Vr58bQ==","signatures":[{"sig":"MEUCIHGQpOkAgoB9szQtafNj86Egal6uT7caraf0h7ADJEiPAiEA/JTVlO8LcO4v1Girqb9SPPzVV8oBJOjLjaz6CV3YwlM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzLrrCRA9TVsSAnZWagAApCMQAIYL9Qt1P9ga3SxKoCvZ\nxFDIJrXyOTZ9IMxaXaNyFw+RWxrN/U8Un/420SrzLrysL1boc3j6ZdLNnyb4\nVZYSwbsCNrd47iXyvotbg9W07zIWT5DlYhRz4YpyEJ5JAnqbPRX1ABH54y9L\nPPIc2iGZX804YdtCeTtueAEA1YbGy1q8iYYxk2OXzXtrwhLAx/jQ6D8Q796h\ntsp2Hu3MwVn9xydv5Bu2AyQWNAj8oRLEVYjSsdgWqLeQh2KcEBWjWoSe9S+z\nlE2XN90i2+qnK3H512knNdNXwLtHhlxQUkNwfIbm4wpsqfjmlAgLn3rZb16Y\n7xleLtBKPH3P29BV4nvWaFZhadlm8sELnB/TWznzF+Mir9ZNmrV3qt1HFjUH\nOyTpi2mZ/f+uKsxrwrNaLAtdWeII5q44SKoD8aaOG/jpJCPVV7qVrQP68XcE\nSqpxIWBSOw3DHSmtrB5U3EbprIl+xjlduSxs/2NfXW057S9oz4Wf1syPmwZD\n1UjHP+2AT14YnxyfceirYCHcQTRwaZpXTcq+WtBcq/1G3C+qqAPXsd2B7Wiz\natjLBfEk13U0Gk0W7zCYOqZKjWVqs1LP38w/wyZbbddx/69r19e2FIHExJ8L\nU8WD3lvHELrPA2xT+GQOVpWhEHiRwN7Rd9DPOrG/at8Sv0X2HV231YdJPTCe\nDp7h\r\n=L0A+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"65fc1ee152f3abef35713b70962e3d5b848a5e78","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.f705e8048.0","@material/rtl":"12.0.0-canary.f705e8048.0","@material/base":"12.0.0-canary.f705e8048.0","@material/shape":"12.0.0-canary.f705e8048.0","@material/theme":"12.0.0-canary.f705e8048.0","@material/animation":"12.0.0-canary.f705e8048.0","@material/elevation":"12.0.0-canary.f705e8048.0","@material/typography":"12.0.0-canary.f705e8048.0","@material/feature-targeting":"12.0.0-canary.f705e8048.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.f705e8048.0_1624029931144_0.8068938691156087","host":"s3://npm-registry-packages"}},"12.0.0-canary.08d791f37.0":{"name":"@material/tooltip","version":"12.0.0-canary.08d791f37.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.08d791f37.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ddef80d7795bf121da41afdcc5f6f8e6e95d632f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.08d791f37.0.tgz","fileCount":38,"integrity":"sha512-Ph08l8oEEvPJyY0/gCsVuFIKKP8w3TMgDTwFyrCr84o98KC5P7qag+zr07sgV++73THlxi1znyz7/3Fxti/ivg==","signatures":[{"sig":"MEUCIQC9QGKvvNAxwTSkebZlSf/pTtHTDNd2t4U1mQWV5+PSbAIgHbtuohon5qN+CiKz2JN2sso0sjDLcVQIw/vDYeFtvKU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzQxKCRA9TVsSAnZWagAANPQP/i96Y57xz38wXcLQ/YFq\nxHN9H9w6tmwHVDqYr1uN5K1/DoezhsiLW5L3CiAEmRw7sOu0GusWw9sjuPww\nJ0JsGe3cJhfRh02tPxjY5/vYZi+4jLPcR3Ktmjkv8gcTzi5ySZj4SBr8qa9R\n8ay8O+qM9oRxL0zmM1z9X8wvBBd61RwUqP7uP4kSERuxVaEUuKLexGAbqRtv\nwIO5wrmEw+Escwl4IQLVwsWpDI3vh3Cblxq/m25+Yz5VJ03hmgmxOK9UtOZt\nz1ytNtWQzY/x52IHMr6Tl2Or4ALeqagysQ7UBkwJe8nam6QcrMFg90oxYEHZ\nLeWQkO+7F1Kvmasw/A7D42ePZYCah1+T+NKHvNmMRvmrkJtLfpo3iplNiI5l\nGj9UjlgrahESQOm1H0Vpo34B4Q31QEkY4KkfYzKS0zNhDZ3mjiSwlScwGiQW\nEP3e7qdi1imkoaL+AMr9BalPb1Gpiy4lN1l7qobd2Lja3AZradK+m1k0z7Kk\n3ALgqThCQ6wVBe58nzfC3qSWzk3P8tJ3hZdr6TxFmRZCUzpD6nTEyFEHXOrF\ncKGR828v+839J6oPdZF8zzKPxyfwA22cW0JcjTJ6mzFMFHMCX3pH4USJPf4B\nMjnVMNju+wjeahU78LWj9pHZDme3uiFwyTi7NqGnsjR95nG1xI2Ff06CP3aA\n9DPX\r\n=icO3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"854f301ec7183c3cbd2e62f9ab541f21aa6a459f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.08d791f37.0","@material/rtl":"12.0.0-canary.08d791f37.0","@material/base":"12.0.0-canary.08d791f37.0","@material/shape":"12.0.0-canary.08d791f37.0","@material/theme":"12.0.0-canary.08d791f37.0","@material/animation":"12.0.0-canary.08d791f37.0","@material/elevation":"12.0.0-canary.08d791f37.0","@material/typography":"12.0.0-canary.08d791f37.0","@material/feature-targeting":"12.0.0-canary.08d791f37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.08d791f37.0_1624050761699_0.19563240337793308","host":"s3://npm-registry-packages"}},"12.0.0-canary.e38d7440f.0":{"name":"@material/tooltip","version":"12.0.0-canary.e38d7440f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.e38d7440f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"314d053bd93c294f679439771666beb27c2fc724","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.e38d7440f.0.tgz","fileCount":38,"integrity":"sha512-qLWVAQC/M1Ezy1utgQ07IJB/xs0+Ewk49JvWnG8DcURWbKxyDUHoHMtWJC4pjZaePPxMzvORH9pfMAYDzBASTA==","signatures":[{"sig":"MEUCIDEyAMiuxSCwzo2NJwIaNz5UQ7yRc8KwR+szR6DNMk6iAiEA7tdbj8I7hFdulBqLgxiVoetFLDSFK5YlyrJpZOqeC6M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0M9PCRA9TVsSAnZWagAAwwsP/2uqJH+V4ZKKyIfaLJJ1\nhuWop56DP7eC7oIW5b7/zuTrh/1LaFMzwAe9OtoAOYbKhqTD7obHIJt492/J\n7e4SS7C0fJHBm20Q9wlGaEnMa1ninkq8dfYvo6RUOvINC9Rh54EwCO+U++ue\nS0niSSqehF5Q8rwwFb0Zp2PXVvQdn+iiuklanapj/l2R4ogDf9jpsE1E6ZwB\neMqY1pvdVCrqIGlqDPz6amEzKulrdU4ZWKIxZvvTHO5p+NUdr3vpIGk+3J28\nOcQlH6rmRHytY1dqTadSVfS5sqQoppfSLyoDL8Hf4RAFp5m/IWaoh+CJ00xI\nJCirTZzgCdMEuyNLDD4WRYxDSJ5oU2TStPzuT3CL5tzdyL7gMKFle/tHMV8d\nM8Ef5VcnIBKbL2hqowO+pfpV8Y5+yPUYqdmca4kX6X9LOX4+05AtsUKjIAfa\ndqdg1mDzwLiGUT01shVRCc1v41pPZVTGkuRuodbYFTv6eEiKRgg1ZVMudYk8\nWkjeG43eaDSrRXiKVuRO/GQXF5snQOvvUufTPYDuD0qWu9GyT10JR+l2/DVR\nhf/hXqtqtvJQRDefietUMpgvJL7D/92/OYKDMiKC0PRJItXvCo4R3vNB4NqO\nGaIL/9GsAqgwgNYJ3eO0zDi6PQsGGGC+LnPbFrF6adPNpyQG0ujG3Ifdal5A\nDqOJ\r\n=QLHZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1d46835e968c827eb3b359624ebb85f8e3ccf528","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e38d7440f.0","@material/rtl":"12.0.0-canary.e38d7440f.0","@material/base":"12.0.0-canary.e38d7440f.0","@material/shape":"12.0.0-canary.e38d7440f.0","@material/theme":"12.0.0-canary.e38d7440f.0","@material/animation":"12.0.0-canary.e38d7440f.0","@material/elevation":"12.0.0-canary.e38d7440f.0","@material/typography":"12.0.0-canary.e38d7440f.0","@material/feature-targeting":"12.0.0-canary.e38d7440f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.e38d7440f.0_1624297294803_0.9677467538500242","host":"s3://npm-registry-packages"}},"12.0.0-canary.75900a5a9.0":{"name":"@material/tooltip","version":"12.0.0-canary.75900a5a9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.75900a5a9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3688755992856b41b5b6952c00303af582dee853","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.75900a5a9.0.tgz","fileCount":38,"integrity":"sha512-c02xhdO47aU0AG9HzTqfM5JKM2ZyGPjiF3Nqe8wIn9q0SLJrECLAY9KOLykvabnsASoPD+CS+6hshLL919P/bg==","signatures":[{"sig":"MEUCIAj391TY0efd9ts91nwTn0wQUHCOqKWAVD0kATvoQZBvAiEA73A7oYxhktUg/W3ZQ71q9T8Z/11G3NRzwKGMavCjts8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0NyLCRA9TVsSAnZWagAADL0P/2iuHjx9aZJztvaS/khT\n8SKZtah9/zarR5bhlqkD7OJ1ixyfe5svdF7joREaYrha+m56KPfWUTiEc3Rd\nU+EVHVYDoHiKm978EHkKVcdq4vZetXlnVNbZV7l9d+FHbX2+Oy57xl+3yKOe\nNEbKso0z5nyp2ctqfD0lGKem0eFJmodtMXO1B41Yc7YPe2/2DGa7wy9W5pya\n8DhOi3FsUTnFBGaaj6l4QTYPKUvA7fNhGKrSIbb144fpWppid/AVfKC4ExK1\nvNJqm4xXI99woynK4x5eW6TmeSb5CyJzf4LXnSgJSptKiqy9jtiDHHmyg5ms\nLa/bSEolbRI/uiPsYmIORS/cVyEcRrqN7kUOI5D1OieWqkcqD0s0dX2M9f6d\nLPd82ar9870Dhwk269osKEa9tIolCFbLNJLONozj7xqenSEdMXkjb6S4yhof\nUkXg7GXLGpeSMZ8gG4TMSntOwnW98SzhYsyTv+8IFocIaY3DxjJa6wh4kYUt\nwJxCAT2crdueIsG+u+3KesDEejBAXH/Qq+YsNJiWbAEeQE9HZAU1cfTPGkh6\n4gnlVl6iytyo8UUV/gNCrOzOJAZn+lXl7MaF6Dbn/SbMZYmyrkTH+bj2Foyc\n+uCfzI7bc8+Uo3D52o83AwuC9OKQ5WyQmcZ7Dcr6HS52ecqOTn49GTfJXX1B\nvXvP\r\n=+bGc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"f08daf05a41f44cbb5e5c07039e1e165d123c405","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.75900a5a9.0","@material/rtl":"12.0.0-canary.75900a5a9.0","@material/base":"12.0.0-canary.75900a5a9.0","@material/shape":"12.0.0-canary.75900a5a9.0","@material/theme":"12.0.0-canary.75900a5a9.0","@material/animation":"12.0.0-canary.75900a5a9.0","@material/elevation":"12.0.0-canary.75900a5a9.0","@material/typography":"12.0.0-canary.75900a5a9.0","@material/feature-targeting":"12.0.0-canary.75900a5a9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.75900a5a9.0_1624300683344_0.3144958419329862","host":"s3://npm-registry-packages"}},"12.0.0-canary.33e6f50e9.0":{"name":"@material/tooltip","version":"12.0.0-canary.33e6f50e9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.33e6f50e9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9408a2af47347ec4b730f21d0f8f46b30090afc6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.33e6f50e9.0.tgz","fileCount":38,"integrity":"sha512-9UenagmeEEwVzbkiH1Bq9Pu54gFoMl0ctmgmbsOFswRb3I7XWgk64V9Vk1C0PgPu5ZR4uX+zNhzuHslqSTTW3w==","signatures":[{"sig":"MEQCICRsR1e7cVS5vQOjLTbeQXB47w4yVtfQ42xFFpAGbmQeAiBDjipu/C5RN4rJLNCc6nze8SnAeRi2L7NBpK4mHSoegQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0nyPCRA9TVsSAnZWagAAXssP/3qXoLIiVT7WnX0FZWYu\nQljQpiJRZquZlgZ2A8Mi+q9q3KkbQwJMrEUuyAbOzKjWtAqBI9uEZVBKPHlO\n+IywQFaZDyKLf+QE0OGwSEFvg9NoDoaVMAo51hrOcTUHGcnd/IcMK0bBqUmT\nu0resA+gTMM07QDXiOr7sPDmdeTIFc+FDFJZ+GuwNfFXFWFms26xi7CwWWxp\nqFDrbK2DlMJ122MEavdyZn4imNYVXviGqqpDub33nxnBj8ZqtebyslwDbT0k\ngxqX6GcCJ/uoO4By243w6wAb4bnQTfxz2rpntZrhhIXJ1V6RlyTh+PvCVtsT\nqbnwmC84nj/rROsOi74z61syD/BYP2IaKi1sk6GmunRchtH87086gUZpDuT7\neAqkY0dSs2ZSLXEt98HtZG4SHxn40HPv7oLm7nHKm5+fwYmrIGPrA5744T6A\nnkGONYcnGVOmBWYNJ6dGhoj5r0TI9O0B8jkWZwipSxkI4Q1DNwkOaUrLGOgb\n0Ls4uSCH+58r90kbUzUhGflF+JGkP6sydKiMiOW1hZgbhhC2DJf9zuEhSgRj\nLZC4n03uS0COUeLPU5Xudu9dsGYXkJWwSILJ8eyMTuEFn+D7NUY14G5J0Qxw\nuHP+QcwmvtFTlAF41RS3H/sDXZ6L9MoWL3qEejnQYucBLlHE/U0dCf2VmFCF\nmXsj\r\n=nq8u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fb208c22fe558f863d851b5bda74038d5a3b09d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.33e6f50e9.0","@material/rtl":"12.0.0-canary.33e6f50e9.0","@material/base":"12.0.0-canary.33e6f50e9.0","@material/shape":"12.0.0-canary.33e6f50e9.0","@material/theme":"12.0.0-canary.33e6f50e9.0","@material/animation":"12.0.0-canary.33e6f50e9.0","@material/elevation":"12.0.0-canary.33e6f50e9.0","@material/typography":"12.0.0-canary.33e6f50e9.0","@material/feature-targeting":"12.0.0-canary.33e6f50e9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.33e6f50e9.0_1624407183084_0.3624279474532863","host":"s3://npm-registry-packages"}},"12.0.0-canary.8c685301d.0":{"name":"@material/tooltip","version":"12.0.0-canary.8c685301d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.8c685301d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c7c8884c5e78d2e81849a575bc6eadb74739b844","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.8c685301d.0.tgz","fileCount":38,"integrity":"sha512-qrZbtP1LoZwaTryPRqFR9Om5LCPUAuMkIzSZ3B4XGmLasruVm5w/12FkT8leGCMlD790tLblwwx3Kk1B7358kA==","signatures":[{"sig":"MEUCIF3Jc3KAnDmqLL9JsShWUIMEdBq7YCbni8MmFkRf0OYRAiEA85a6B+e1wgs2eleqz78WittePSSctOYGE2IKpD+bL5k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg03yfCRA9TVsSAnZWagAAk9EQAJCAWxrzfl6+cDI7oPxy\nveSTAGpbfc7nO2+6jQMdYbzuVAqCjq1T+VcP+hUrndEctGQLBG6tNMlp/ENL\n/GkSSQZSZuto1xR2mBS+/06R1vx4fJsT+Hn9N1LNkXxA1DIQrME/uQFV0dTC\nXSgE2xMBxNvryTYlLCUb3eTyB00s5cw+yXvZTX4fSpzsQ3bU7zef2uek4m72\nyl7Tco3WvyhC5hbo0uQXL8Dd/rnlzlEbb0ZQhdFysCWrV1A1r+ntossgXLP0\nXuouvETWc6xugtJ3JVnDVG/K6WLkDLpXzzgVdAIaPclLBBmJZwuJnbwOb/Cl\n0Z/+e+Ykwu9TBuO1o4D/2kOrjMSO3vSVg8WHwZ5GUYz1NblpzvqfHlLsPVu2\nsM7+NZ7/x54Ixr7fl3ekFYTmoEdfo/7k9NgQUucC1TLavx9IpbTWptCPNeSk\ntCMJNHUt8nMpUMeIUG/7cALAzJiOxIaexdWXyf2CGQv70LFZgCwDsl2EJnts\nmH/Nxt+jWZDWggVNJbxhHrbqFTShFb1it7OILCCNeMCkuqmabwv5uh1yg7WW\nvL+4YKBu33mCBAr7dRJU5kQ0UfS6FnCNaOAqINRidCW7aEP7VX65m0qiU1IR\nK61VdcbR921US0N3peeKXdWXWph3T9aUkqITrq9MwoxHg/Ue5/2/tz7HZbN3\n1+Bf\r\n=WvlL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"43d0ab810254e565375b55ae118522d89b7e9254","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8c685301d.0","@material/rtl":"12.0.0-canary.8c685301d.0","@material/base":"12.0.0-canary.8c685301d.0","@material/shape":"12.0.0-canary.8c685301d.0","@material/theme":"12.0.0-canary.8c685301d.0","@material/animation":"12.0.0-canary.8c685301d.0","@material/elevation":"12.0.0-canary.8c685301d.0","@material/typography":"12.0.0-canary.8c685301d.0","@material/feature-targeting":"12.0.0-canary.8c685301d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.8c685301d.0_1624472734904_0.17526736440131785","host":"s3://npm-registry-packages"}},"12.0.0-canary.8c7d994ae.0":{"name":"@material/tooltip","version":"12.0.0-canary.8c7d994ae.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.8c7d994ae.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"71413346862ca56675277ae06f57d468ce3dfcde","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.8c7d994ae.0.tgz","fileCount":38,"integrity":"sha512-fW7KBnCxrejI1xAkQnawQHM+l6K9FyqI/5Avm2nGvPN/5wufeT6aXrrOiNWuWzhLz/oBJhXbuwWzAhv7IT8LmQ==","signatures":[{"sig":"MEYCIQDy3NUIUfD9rpehkrkbVrN7EbFPnKxGg1SP5uFjqYU+DgIhAJ0GgWUNwUsaUy6ZEAKQSyhuvHGZH3FXoETzyakBfSL4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg04tYCRA9TVsSAnZWagAA6AoQAJ6aJC65NWd+mRE6TaMx\n9BKk6xa0u7aohGRbANgXAbkDR0aqABM9slPrYKoR3w2nQlsVPRpq6zV5eKPd\n+1o9P7494/gqgg2g2yyM/V+EnOGGB9BVR8fXsTulOiMJPpVOazmFzVcgHhRL\nvXJguhsqDLoPm2XHcrlv8BP41Ns2KnQ1R/8GM8+/0rwt73jftNk+BA4X/Pn5\ncJfUXt4gENAoPtT0S/HaHo48evlrMjzYDO+lJNtpOmxVm6OU5kr0VjNwdj11\nr62DY+RcScmqJxqiyiV5LdB4lJb9Sf7oVwctCnC5w1uRYw3IZUIpqmGZeRVq\nwBpQkz6XExuJzvbgZceG1GBXoPnPGGesSRVsXsdINpckcDQjLk0pbmXM7pPD\nKsNTJp+QWXri8aqNyeM6VJwjMVZQkekpzetrsa028NJsaarm946Gj1m5tEh+\nNEWQEujz70m7J56orYtE7uh9tGHRTg5bgWCY1oWnEOwPFbxv6brEejFWWI77\noCIVGs8/c52MNWR2WEPKzOXWRXONmh3C7gynKoR6vKSPXkuFkg8ToHvkvp/H\n321fTc8/U80QRSRwsCq5zyckJ1A4CzU983l7oUznYMBuWSS2pNuqz8vcWzPC\n38twSs8nr64dmTCpX1YsSfI3zRIQO8831Efs8TN/rt7sG5Qr/4VV9fMalv0a\nvwFX\r\n=T9P/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"85693f86d68563f451e95113f3d03a29fedcf142","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.8c7d994ae.0","@material/rtl":"12.0.0-canary.8c7d994ae.0","@material/base":"12.0.0-canary.8c7d994ae.0","@material/shape":"12.0.0-canary.8c7d994ae.0","@material/theme":"12.0.0-canary.8c7d994ae.0","@material/animation":"12.0.0-canary.8c7d994ae.0","@material/elevation":"12.0.0-canary.8c7d994ae.0","@material/typography":"12.0.0-canary.8c7d994ae.0","@material/feature-targeting":"12.0.0-canary.8c7d994ae.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.8c7d994ae.0_1624476504280_0.07995870243471881","host":"s3://npm-registry-packages"}},"12.0.0-canary.4ccd39bdd.0":{"name":"@material/tooltip","version":"12.0.0-canary.4ccd39bdd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.4ccd39bdd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f15eca9cc64bcaeff99f1292714cf60d15cb1499","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.4ccd39bdd.0.tgz","fileCount":38,"integrity":"sha512-krTQrbrL0aoaRLd6+CdxZVUmxx05JciFWzLpJYhCqvsXHQKjH/4vFkwFt+uVww6kcYbhWH3t4kNqg7uB1bqfaQ==","signatures":[{"sig":"MEYCIQDT6W1UvO6IetwTthAcXaMMhO7IOac1qrog9orly7w2HwIhAL6aDaI7FT0oQBKtv5WQEDWdeomfb13hdA5P4e0ksxth","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1K+8CRA9TVsSAnZWagAA2t4P/R1SplRBm7fAZWQc6qhL\nWF+HSTlcjFmM64LvZE9zV288YMLlCx50ii2u/iXDn05hnnt4Vist9TlvhCsu\nDLFdCqubh2VwuD3AAXPWktC7hzV/u4dtQsTB6u+KX9NMBGhTrQFHp6HLTF9C\nAfLiT42EqmGpwbRHfnblS5//KfIlRsHlqg0mOfXkCggrDZuqLWHn0BMfLKFW\nQxiKKzCie4JOgl0j3giLd9/WxBFDcNE8IamjHEI2KVNtUQ+KWPFBF/S+Jj3n\nPxZ5oYqmZEuAAo1hKhchm48tSveTgA7lLVVxj9I5RNA4R9MVR6N22GZl4ROg\nSWebw57itqHRpEVEhYWvr0utZK14A4u/wJszxSAEEffpryOY9JlbEluTAj14\nqSWNAc3VJZq9tphaAWwzJukOU9XlFaLLFVw6kXW5yRlrI14ADXYf5mER769t\nkYbKfbW/TfGywTk6nlxSOi1U5spZwf1ILjT6RQ7DufTMcSIOtxndbYBeH8VB\nBu1SLzae/SI95eTq4CQw0EwVCfgLq6x9JiMH6tj0PZH02AN8Wbp+R1D2j3h3\nrFnv87VHKQHbRGX0mXQjToEr1cWjc+wTM1XLeT07Qr4v0B/fj3dFuIfRgsRD\nmeuE1I1m+MFu6//azIaDpxYacAQSATrGNbvk+H96YyoAmQSOYdYJ/pRPLAHD\nDF5R\r\n=1Cx9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"0954a36f2cbd31614158e8425662a4969ce9c299","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4ccd39bdd.0","@material/rtl":"12.0.0-canary.4ccd39bdd.0","@material/base":"12.0.0-canary.4ccd39bdd.0","@material/shape":"12.0.0-canary.4ccd39bdd.0","@material/theme":"12.0.0-canary.4ccd39bdd.0","@material/animation":"12.0.0-canary.4ccd39bdd.0","@material/elevation":"12.0.0-canary.4ccd39bdd.0","@material/typography":"12.0.0-canary.4ccd39bdd.0","@material/feature-targeting":"12.0.0-canary.4ccd39bdd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.4ccd39bdd.0_1624551355679_0.10492324221067517","host":"s3://npm-registry-packages"}},"12.0.0-canary.17553e9f8.0":{"name":"@material/tooltip","version":"12.0.0-canary.17553e9f8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.17553e9f8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7988881ca219d1db54d4a2754735326de1a4fc77","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.17553e9f8.0.tgz","fileCount":38,"integrity":"sha512-cPWPSDBKVOUWVHdgkeA9cfIu69AvoVRobn1eOwBx55wo8WhTXStS8E0K53RiUPJKFpCPiDx6lXckmVmJHX0Dsg==","signatures":[{"sig":"MEUCIEHB+C95NdQjdNbO5PotDGoyaHgdnRV7JqGlAsUuDcNEAiEA1ttwPwtTZglCZPR1tUiFFcGXzXImuCC1gomBb7FYGWc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2lLsCRA9TVsSAnZWagAA0PMP/RlLqnNfPRrMf5wQs6Qa\ni2CIGZ/KGNZ1Q8xBPQTPrpXo/OMwtclnbwuM1owdc5KClQlx7ls3fVetZK9+\nu7G0RiU5D+JLmdBQmcO+2EpFDsR+mvCLCWNDRrl5DDexQm+TC/Z6VKSq5fpT\na80+90QrjO3dbo6TkoKmguz0+sdZZYARFYZw2vIoPyxJJQAGMPDZLlZD7vpd\nd+kIZs4Af+muXp9i5I5pXRiQKVCMUbcwvAZGdAm2ZZffnlHngFdV4GY6s6xD\nktVWVQ5E06vRuV7dARcHk8owV/TyTPYHY3zZpaKyI9lK/LBdnMNautvQzOIQ\n/hyHYaNxMSPxsZxNE3tuEzSPiBjRj6inGM0pJOMNOtkt0A/AUBfbQzmzjChy\n3jGkHj2xbmEhmDdbf1+JsR3pyTGqYfsRkgOF6U0KQb4gsvIlnrvE6+IzLdxj\nPoWL1GFA7H8WK7ULzYE3JKeEi24Max7ujU2YhfYUXECdpN0tJGQrQ2y7hPmj\nCEnMJ39QaYr34bW2Fk70WPbkVyjtbL1ChiEOGOIRcr+89v9IyxFWaabUNKjb\nqhYBTAZBQvONwOG6Wvcvl0lkllrZVEFBf+3n2YqgfDbqsqS2STKLmXnE2jeP\nlGY1/YKP6o2l7rR0sEciYRD+TKxoH7Ad5zf+56RkyCkJJ7ymDWGLPUYi10EO\nb5M/\r\n=aKxo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"bbd7dc5fbee09c82081517ffc14264d4834209ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.17553e9f8.0","@material/rtl":"12.0.0-canary.17553e9f8.0","@material/base":"12.0.0-canary.17553e9f8.0","@material/shape":"12.0.0-canary.17553e9f8.0","@material/theme":"12.0.0-canary.17553e9f8.0","@material/animation":"12.0.0-canary.17553e9f8.0","@material/elevation":"12.0.0-canary.17553e9f8.0","@material/typography":"12.0.0-canary.17553e9f8.0","@material/feature-targeting":"12.0.0-canary.17553e9f8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.17553e9f8.0_1624920811978_0.3972593760937342","host":"s3://npm-registry-packages"}},"12.0.0-canary.4c80072fd.0":{"name":"@material/tooltip","version":"12.0.0-canary.4c80072fd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.4c80072fd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"970e64c9205cffbb64b463744f640c45f9f33019","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.4c80072fd.0.tgz","fileCount":38,"integrity":"sha512-Y1sWix4+KZT1s7a1yAcyO7xU2SICuqhgWw/NWb1HE7/TE7+IyHnMUaG+rYeq2+I6rA5WZ72Rlxv+TjAhRZ5U/g==","signatures":[{"sig":"MEUCIQCpYMW5pcWkIleeFc+wVVYoM1WX6UkI9lVO0pW15kJQEAIgKgJu5ygARjMj72wPDVgztKm/8IfXBUAqHGsyFxrXhHg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg22l1CRA9TVsSAnZWagAAPHMP/j5ZvfAHkzfXdA+IQ1uO\nV2A63Vc2+f0yCqcCY2nevW7YWzijm4v34sCMA8umKeIQcWGW3AcL0AsktN+5\n/TQUCwtJewHlguWRk57SLd83gJkQxrZ62IXuqh9toTH/7aXTQ9l5j6dBxYRf\n82ceRYdpTSvol5UK+J434oJG9JQ4BiEx07bl4CV4HUASax7F/5/RCHmrWMeD\n2rtK9Uxf3D43FEcrXOa2om5TU0ILUvEMmA04srG4rgETBt6ZGqlMneQyMGBu\np8Y2ORbxvhqq8Oz+A9jO70lfNsIM1LfveFw+9C4Ey01FPgRIHhJnroS9okBv\nAFl2RQtk3RxZu38maXRQeJ11/QCsQgE94H18vc2EnXDCcNh3aSdKvgYD4aZF\nKIllrVDfrKlEJO2xCojTkJ3DJ2h5ZyXAvITsZ9o1r4SIUlgB1fBguCa92UON\nFqEyYQXwn1u/O1c6n9Julrtk8zp/HdEc/QihC65zXTRZyj7rjhAAX3FI4ZoQ\ne9CTl+EsNaB0ovwIOGbv0kEeKIg6dE+C54FLDHVidvk+I0LxyBClepY1qB2Z\nvvzGcsytzhq8tfkUHmC+uU9/+b9LYpqwVok65gLubsUWlCZzz5eXfVv2+p5s\nyvVGgkEnMQG/zeC3yNYMnQBjXCxe85ZD1Q1/mLwn2pO4fA3/8rkNFNiD8BSx\nEhHs\r\n=Spz6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"9f6d10da43c6e0fbb1366c1e37fbca58ce00dc12","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4c80072fd.0","@material/rtl":"12.0.0-canary.4c80072fd.0","@material/base":"12.0.0-canary.4c80072fd.0","@material/shape":"12.0.0-canary.4c80072fd.0","@material/theme":"12.0.0-canary.4c80072fd.0","@material/animation":"12.0.0-canary.4c80072fd.0","@material/elevation":"12.0.0-canary.4c80072fd.0","@material/typography":"12.0.0-canary.4c80072fd.0","@material/feature-targeting":"12.0.0-canary.4c80072fd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.4c80072fd.0_1624992117277_0.8139724655615419","host":"s3://npm-registry-packages"}},"12.0.0-canary.796811db7.0":{"name":"@material/tooltip","version":"12.0.0-canary.796811db7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.796811db7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f74cdda9e214a4cc7c49d4dd8b6a43bdb7d71108","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.796811db7.0.tgz","fileCount":38,"integrity":"sha512-Zdvq3yCd4pFHKSTppfCCqN8rbuG2OnkJ0xo/MOHEDTFANEjZbd21EEiwkAZE/zmAA9MgN5drf3MVdpQmYpEopA==","signatures":[{"sig":"MEUCIC5qbLzicBGvLvHeyBqFQujIYYAGMZvO7MVufdnOOpd1AiEA6ly/rQ1L41WqFfAk5aixDPrv4NsaVeeKAyRv6OwbzUg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3QaFCRA9TVsSAnZWagAAxcYP/jch43NEHI2hW+NYS06V\nHE9FlBBS10syA/mIhJVsajtNa4hkEEZtK6/b73RbQ+Lu7PpfoA1flA5LAQL1\n46mvdw83T67kRlQqsERBE7RumOBxSD8ATgZgcC2vq16ZTNWfOA01sweuxcxz\nxaHB3ZtKTAyhzEpcsoYzNXPjHC1RtDgneQeey5xH2Nq9ALh4N4dSFqi1tGry\n0WD0dqkRQLzwcrktnD7rSRV9TLubdWwyqxh9RuHj2AAmQTZx9x9eMOCwWkxd\nWsq3UundrlfGO3m7mR8uVbOVkIg0cUcIGJRTUAGqdqfeXYSJCO+ieyjkxXCH\nBJ+RYgBNaUTqjbYmQ3woMIZlu+xYKXnsm82gGO/yCp0uxxkmBWZmyjdlhTom\nWukvZ4ajpzGvfMw9lcfrMeoMVp2dQiNvebixiBL1ZJpPKLBXpvrfyMS/C4Cw\nEybgNQ7ttsubqcTPsLmm+jXOwp+a0KnRzXTKoAxSGpQcyzXHvY3L+ijwpmCA\npsy5w4RFa2/wqPB4Dgb+RGcoAEUJC/lI4WYah+muSsuvdEjUR69KShywU6qr\nplmOyQCcFdqGrsb3RM1uhyDRU68+2SSw4K+N4ZqvOlN0g+Uh6JCtzYIxxsiW\nYWXsOrgvzOfPqX6hE8mh/Q3/bs9fPYlWCFkuBNiNRnVBwfzjsYI0AUmX2PGt\nRM6E\r\n=d4mQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b02de77dcf32bdce7d23406dd395390b35e386e0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.796811db7.0","@material/rtl":"12.0.0-canary.796811db7.0","@material/base":"12.0.0-canary.796811db7.0","@material/shape":"12.0.0-canary.796811db7.0","@material/theme":"12.0.0-canary.796811db7.0","@material/animation":"12.0.0-canary.796811db7.0","@material/elevation":"12.0.0-canary.796811db7.0","@material/typography":"12.0.0-canary.796811db7.0","@material/feature-targeting":"12.0.0-canary.796811db7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.796811db7.0_1625097861315_0.5692101610920803","host":"s3://npm-registry-packages"}},"12.0.0-canary.70e1efdca.0":{"name":"@material/tooltip","version":"12.0.0-canary.70e1efdca.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.70e1efdca.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7379ec600524879952eb7c99aabe96383949051f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.70e1efdca.0.tgz","fileCount":38,"integrity":"sha512-kHnU/TMChnGUmpix5YoO3SYV1JpBQdkSTGAO1tuGWrWTNJR+oHN9sZ32t8nPLeSo3Uo1RCE5yfaPSlNxqqWylA==","signatures":[{"sig":"MEQCIEQAm26mBEbRgzjEfOWKpM9jeDOqhNfl9PbNGCg9SseTAiAreHWkKVa7qyOp28Y+mPnPgYW5pbxBH/P+TRnyrD/Rbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3fZXCRA9TVsSAnZWagAAQVsP/RlFTDRGXdwW6d2XyWYI\ninVZQPGp+s2Pi9VaEuGVSPimCVPL7AAQ2dgMQMpzJL1N5avOzdrpEdyoIP9T\nV/ZBur8eYRndd9a4WuFcDjZk59cgZzrDtyU4sqzkkSWUYnljRpz/O45Ro/95\ndR/QoP2Ub0PypG2ld/Ze4P62RvAWLyQswZMC2FZsWsvm7LTB4Y5DNAiKCGOa\nyhcdKRUWwZG60zBr7fEiq0yB0QQ5FjJQLKCYoX4gsPxKERRppWTQGZSHh84D\nZQqCIC17M3PU/SuvoL/rrwiBIQCmqdjEhIae5MxeU3cbtQLrPX7fW8xVOFcR\nBrvP9hk1Jtu2V5OI/t8elN0Yggvf7ro7yn7H1t/rYuWaIG3WjoPkqKPgM5Ca\nD3HSWIVpywu+7cg5grtGPEcRou6gg2AX4WLvx/wH1A8pCWr88FkkqF5w2Pqo\nMYPqazKCLVl+1qsefVIM3RVRjcSbiLwAd1f8abc+GCMOiKfEQghdtNpIu89S\ncqBE6SKFbLoZCoCh9k0G6Fapc0q3Q7dlYqN/nwcHgYYRNYVZXYPhd8DhkLrX\nhJ6gwnRZ3VaFERto5nXvzb03K5fiM3U2tDnVxm+rePMsFftTVunFQ1sCmq4D\nOdvD4EuH8qfd63Q5ObbjfgZFyFzYkvg425K/CpLmHZAFrLX/GHZtKSm8vEBP\nDrZ1\r\n=lDWf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ab5924ae38bb3ce40d3b1c303e1ae6d175b844ce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.70e1efdca.0","@material/rtl":"12.0.0-canary.70e1efdca.0","@material/base":"12.0.0-canary.70e1efdca.0","@material/shape":"12.0.0-canary.70e1efdca.0","@material/theme":"12.0.0-canary.70e1efdca.0","@material/animation":"12.0.0-canary.70e1efdca.0","@material/elevation":"12.0.0-canary.70e1efdca.0","@material/typography":"12.0.0-canary.70e1efdca.0","@material/feature-targeting":"12.0.0-canary.70e1efdca.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.70e1efdca.0_1625159254800_0.9301391366998841","host":"s3://npm-registry-packages"}},"12.0.0-canary.435866d32.0":{"name":"@material/tooltip","version":"12.0.0-canary.435866d32.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.435866d32.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"58bb72a1c61f0731b30f9787229aab93c4654df3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.435866d32.0.tgz","fileCount":38,"integrity":"sha512-y6jakpUipWNCZE7VO+yKS/WFLkXf7mza7hUqziXtUkHZiCxWdNMk42Dbw9LI8P+BCtofhQM0phJ7IWe4f6+EKA==","signatures":[{"sig":"MEQCIHoQkJWr2d66HoyYZXLR2jUUt5z7VGKwSFlRlZ9oNsFgAiA0ygaS7hcC/GiQzKZhoceOaX5m0nJWH1JkfSvibHkyjg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg31lTCRA9TVsSAnZWagAA/aEQAIiLpGupHOnqIHfn5Atu\nB852gPzsX378sXbISkF5VtFG/ERD5yrw2xpnNOEXdxfbGAWx7x5xsgrRjRVr\nEg4UQjuos58MZau5G4mDucxN6O4e526lkbJ8uTaA3YexJjWwz3/S6QWuOW/c\nZWIdRIK0lBjWcO0juyADhWAgb6Eqg/pLUZ4W4FSU1WC00SfHjOdCLYtoXfhT\ndYE8VkC403giGliXGG40eR152a2jkquKRuFeR5YYDaa22x5s34C3uZpZ7ORW\nlv7UAjZTvwObGQWY7Iok+DzXZKU/vAffkrU2RS6aWjTzFmI2qLFQb1Rojr7T\nQZeOzTPi+H0Gq38OOQk5/vWhtY2vryx66yNRcAo3ZxWUiVIDY9k0+mtHLT0q\nHSR8PpC8Tyy0JipkoH7aNkDSIXPYq1mP6ub01NEOfbf3V4SXnApZjiifYT0a\nPF+HqNCXIiaYupkB9C9oeaFhtdzzbQpixv8CA8inwr1g7bek3Zhv7eicTnSG\nIAsp1YOuxla5rxvXVSHETL4c9XCfoDQBJOhZsVpkVeAXWLivemx/7jZ8Bxg7\nG8H5rjMbDhnJoy9WjxkbV2I1gK26TyblsXuMwOcd23atICL9ZhXQuz7nqk0C\ni21EMM/w2cgX5WhUcDs9jZzWLKuqfO3SuAtHHMSv33Iq1zdh1sVZ5sru3Yg1\nD+yf\r\n=Y9nN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ecf68c368bd1ea5571aa4da569d6fe6c4b8b8caf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.435866d32.0","@material/rtl":"12.0.0-canary.435866d32.0","@material/base":"12.0.0-canary.435866d32.0","@material/shape":"12.0.0-canary.435866d32.0","@material/theme":"12.0.0-canary.435866d32.0","@material/animation":"12.0.0-canary.435866d32.0","@material/elevation":"12.0.0-canary.435866d32.0","@material/typography":"12.0.0-canary.435866d32.0","@material/feature-targeting":"12.0.0-canary.435866d32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.435866d32.0_1625250131388_0.8387729092476865","host":"s3://npm-registry-packages"}},"12.0.0-canary.d0f9f3f2e.0":{"name":"@material/tooltip","version":"12.0.0-canary.d0f9f3f2e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.d0f9f3f2e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"10e4e3970c3e8f4bee530930e6b0bd5b1ff0b58a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.d0f9f3f2e.0.tgz","fileCount":38,"integrity":"sha512-MGv9oxHxrqB5YnGb1WYIhTyMEWgb3omB54VQEAs8xQ3c7KhEfkrzISGn20RswwjyHHTSwKpFFCRHz5z7dLTaCA==","signatures":[{"sig":"MEUCIBknuSweaVVARgBTo9YBwE1p88nmKwcAfvNZLs2jxjePAiEA5gNQSRAyeOUe1fi/pOnGKsq0QX/W74KvqnBTA8BSiRA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg36jACRA9TVsSAnZWagAA6kAP/A5SE9hAJhlLx1zuHas7\niCO+0ZofxA+zyyb5tLDDf9Kk+vjqf5xSNUXyVELvFkUAu7ZLpbvIeqqdiBUm\n4dOb5hxkTh4225YYMqu5hyuiLTUsGXXwaTOfiAmleJ9EqfGF2ZKELSEHsz6c\n7tXuRiMilOvgU+NJO62bryIP27twPnrhOZdkUXl8s2+jyf1VSCFc2wnS/GJN\nLCEAtIvg8/HvEhOpr6oeW/wv+4Z5acUGXA3yg9IVYQbtgNN+k+doq76SVSbg\nrKh+dGDKG71rN5zg9fNglCXJkp2aCQTkEXHqLJdhy6SWrgQQG15WwpgoZOhr\n9Y3RW3M8ekUkTybTjx7Sg9NIV+glG2ZBoqs7X+XpdLuzE8lAisdKjqX3O/Pn\nroF0er5eUxVlvkCrzeC5RcWQL145Lkoc3cKSDikY+7ubCBhOYnX82eOX6naU\nCtCvlkjk7a6AVkgHjFnIgXrH0oLsTGP1EEZKbUnBx+at1s3E7wOhJN4iF7ui\n1d1geAl/jvaMtQ6zRLKc8/n1A6yk9Mg79wiWh1SdwhUci5WVvKhEAOHNoD9D\n9Y1L6fljAQejcxbbleHU08zSjpzpDS4oBJfE8Bd0+SJaoNaneQS11PSim/ZX\nCL7GoMJBEUq9ACXiGwaE6fMBcaR99uae0cSTQjXWnasBXiOEikI/UM6o+60W\nG/8i\r\n=LwpM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ed31c78c6a84cb24353ffd1d406693496f090e29","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d0f9f3f2e.0","@material/rtl":"12.0.0-canary.d0f9f3f2e.0","@material/base":"12.0.0-canary.d0f9f3f2e.0","@material/shape":"12.0.0-canary.d0f9f3f2e.0","@material/theme":"12.0.0-canary.d0f9f3f2e.0","@material/animation":"12.0.0-canary.d0f9f3f2e.0","@material/elevation":"12.0.0-canary.d0f9f3f2e.0","@material/typography":"12.0.0-canary.d0f9f3f2e.0","@material/feature-targeting":"12.0.0-canary.d0f9f3f2e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.d0f9f3f2e.0_1625270463876_0.6911478016220529","host":"s3://npm-registry-packages"}},"12.0.0-canary.adeac0549.0":{"name":"@material/tooltip","version":"12.0.0-canary.adeac0549.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.adeac0549.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e2251420615a70e328e55fc31886bf1b164d7b43","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.adeac0549.0.tgz","fileCount":38,"integrity":"sha512-oRCXMIpeoTc/0yXeqmqmgczOMRePx0MWX/dPGOJ6CPA7g4mL9W573aZI48XtHWmE2ARy14Y/ubALPpFGv6/Kkw==","signatures":[{"sig":"MEUCIQDigiYkcjwD0qApon+LWg+sM0Q1Qj56LR9yz2IXLLmfYQIgHxvVPFFKttXBmHWtpf3wwNIHsvIFb35DBucKR9LTk7c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5xVnCRA9TVsSAnZWagAAcAEQAIbivdL94CStwaVMvem5\nLMOFxuVyHGJZfV0UlDU9Xjx2VW20NqzqeNz1t2RDSrAiLEKNG71wMGRRZDSl\ngj3FiEO+d+IJVJd764cU2BTO2q7ihzMhaLlkoF7VZNeSzn6oVXeLVwAj6G8L\nCOV81qKXk4XMZYntpOBBgPU+fmUdDLAWWea7q9ekLo+mHdXnqkJRHxda7jLz\nSUtA5mobWrigjXiz2eM8GGcBpF2atHgHnIBj1gEDv/UjTaLObF6jooWz2bxw\ntZx8wGftMBVJWes5398vsdk7Kpuz8v7CCgtqaFJi9NQSNZ/Aae6EvVDYHHKY\nkg/VUB2DscKOIHkXu1JRtxdeb0kRX8AFjmuzyM287kly2WVemFZhiKB0tkdM\n/w0Lj/0Cb6mrtF127S5FswyCUFFa8KcTt9W/B4hh4++z0nzE06dE2Xc6e1xa\nRWcXKVbogCAPA6tbS6UCIdSlIuqPEkSl2aksysbpIzVcr3eqmOhvcQ+RwML6\nP+0JgP/SemrJf2LLIQJTrVNWEt2RQmW0l5NXbrVakdFUFq5rsrTfo0WjooGT\ntTYR29KX9OUlGU0LZj7O5NoREgJmiaOjUmNj67+W96upNvI/PlQiG0cbC2J0\n+PoSyKYB8QWagv10DoRm59gd/VDCOhUpQ4lLJHAIrEFx8X+6QDdGCYspVl5Q\nXr4w\r\n=AN2E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"a189bfd7e13b17660ad97870e074af0ee245e36d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.adeac0549.0","@material/rtl":"12.0.0-canary.adeac0549.0","@material/base":"12.0.0-canary.adeac0549.0","@material/shape":"12.0.0-canary.adeac0549.0","@material/theme":"12.0.0-canary.adeac0549.0","@material/animation":"12.0.0-canary.adeac0549.0","@material/elevation":"12.0.0-canary.adeac0549.0","@material/typography":"12.0.0-canary.adeac0549.0","@material/feature-targeting":"12.0.0-canary.adeac0549.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.adeac0549.0_1625757031081_0.08647571587752001","host":"s3://npm-registry-packages"}},"12.0.0-canary.068fd5028.0":{"name":"@material/tooltip","version":"12.0.0-canary.068fd5028.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.068fd5028.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95ea2cfdaa31074fb08cfbbcf14f6e3c04c4e9a1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.068fd5028.0.tgz","fileCount":38,"integrity":"sha512-Yw8XE4KbGU1+uvZT0g6bkEiP6EBIOacbyvC/H3cRflQ3dX3EYawhhY4VlWgPl9Re3HRPQb1LnqgSfj/ftakpbw==","signatures":[{"sig":"MEUCIQC53jcDGPbPVOLHsDMQUn2z3QRciLa+/YFp4iYxkJZWRAIgbX0CPPrPOD+2raYmdZyUhmiWrnEViuSNiklvDtEsz5g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg50xRCRA9TVsSAnZWagAAtT4QAJEtk9k5ewuPvS/n2m2T\n+U+6a7fH7Bb43RIogX7rH4DnRCNtbn9OCnlVuDXuaBwxjoM0YMBAbGI7vhGQ\n/XL/rB4aRUzbjSa2tUKVfqgahJrOjRhpH78r6WcXE23PDLWmD6TNAi4S+qvi\nMD/cNrHhUdYYtaQ2ShwnSo8helVYabtFQVxIpAU8HYA+ccRoknsPXD4btUb3\nfcdskKN9i1dgyOEGENdroXAIXQeAPk+EZP4yuNcftZ9TtUUyH+zQnbfxtr/m\nJ+ZTMgzBN9x4ePCQnqJAHgJ/cQjmlF4AXBuaMNibcJyKeUiDZ8CsHNZcQpKc\naE24lN4ID8AvIVoejoCYEoWPpeVe8DsyPYODNnqoKvSiiCNbBUi3QiAFw1Hh\nxXrRFCR7e8EpMS5R35CD0K1E1Wc2FAed2RPYZfdSvtcpZtG0LQF9oBSavNbZ\n4mmadomVdiG2IC9+9cGU1BXALpfS4zwsmKWgW5KR7Y66hDRShtpVuP+PHGc1\nrtoaBiUQElO5xHtl40ze0/a23XBVL2lR4tYwByU2bCvQ3FsWQ9GdfBw0kxrV\nRUa7mwFXZGbFS5J5ljopFK2DE4NZ0ZmfpHEC6/xX0/MJy1zqJLQ9v+fA5i5y\nbtZCK7+yF6uoOsACM2lt+KTsdSAu+W/tWrMZecWJUDl0SKK7oK1v/EscQydq\nXqzI\r\n=PM8D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"daf6a798ec3c54ddba492f33c939c41a8d88655f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.068fd5028.0","@material/rtl":"12.0.0-canary.068fd5028.0","@material/base":"12.0.0-canary.068fd5028.0","@material/shape":"12.0.0-canary.068fd5028.0","@material/theme":"12.0.0-canary.068fd5028.0","@material/animation":"12.0.0-canary.068fd5028.0","@material/elevation":"12.0.0-canary.068fd5028.0","@material/typography":"12.0.0-canary.068fd5028.0","@material/feature-targeting":"12.0.0-canary.068fd5028.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.068fd5028.0_1625771089381_0.6827091801396195","host":"s3://npm-registry-packages"}},"12.0.0-canary.5dfec7a14.0":{"name":"@material/tooltip","version":"12.0.0-canary.5dfec7a14.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.5dfec7a14.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"225525e0a102a63612967e403d5a94eac80252e4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.5dfec7a14.0.tgz","fileCount":38,"integrity":"sha512-I2WUfT5wde7T/iIWexzTnRbd+HSUtrqszds6MvFY/SDfCm5Aeg9jbZxclvAGSpsBJKrIvCipxMLcUZfiOGYHrw==","signatures":[{"sig":"MEUCIF2VpNCvE1OfiIssGogC4o/HL6VllHNfT5DUnl0tCZoRAiEAvt1B7kDAKr77qDw3keTX96ZAsl3Id2gKR4PsWGtkXVo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7KB0CRA9TVsSAnZWagAAuq4P/0RK7RDrm3RalGz9n4UV\ndIJTc2Jfo8lRT5ndnpeVPuyGeIqCziYKM2CzOOa0p6f18yQliqj7hplEUEEH\nwYyiAmbr7Cf3pmJXSYTfVZAnoZYujM3KkHD905ut9K9ywq2QPb5elknL6FE7\nrOr7UPUELb0ffK5VQcvwpCdtYCb1EWglxgT/OgoC1wL5UEKGwwbCb/ChND6g\nTUHgK0chBq9yjtmMF1Yrw8GREjk2a4S89AMEvkS6eC6my7HqOQKbEK067BUb\ntLf/ZC+DwJFPFsIOZucExtjLMQMMBD7AE32lrPtsjyRswVhqiIbglWgkai6d\n3eR+gRtrpsF6+Ly2pC9F45Xi7XTE3MfXzNO/3d0fJnAdHnnEC3JuiLufMWNL\nXhJapD/5S5I/zU+g3OgWLCZJaO97zktBHVVbF+1UKD3KC1NZm+4/OiAiR031\n74WlwZWHy1DXsWq3QyYKhvyaLF4SanP/SwxnSq+x2kM+mFz3fnG3P2hzTIfN\n9M3epY60PsgIXUcrPhug/zfOSbs6jSmGEobCFD/sJ/vbrnRF5kfFIgyljYxc\ng8b+FW6yEa+XS+c39Lx+CI9nf6c9pjkFuJEKyOPC4AS0fSGv5wc2/rx1nVdt\n2arSj0/vaf4vlPTidj9qr6eLraK7tX85xlZzlY+Tzn1dbbY7q85Ld9bbcy69\nqHr5\r\n=hqLk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"7295656b25be2c03cf7ca7ca800e7dbec4d9b531","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5dfec7a14.0","@material/rtl":"12.0.0-canary.5dfec7a14.0","@material/base":"12.0.0-canary.5dfec7a14.0","@material/shape":"12.0.0-canary.5dfec7a14.0","@material/theme":"12.0.0-canary.5dfec7a14.0","@material/animation":"12.0.0-canary.5dfec7a14.0","@material/elevation":"12.0.0-canary.5dfec7a14.0","@material/typography":"12.0.0-canary.5dfec7a14.0","@material/feature-targeting":"12.0.0-canary.5dfec7a14.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.5dfec7a14.0_1626120308156_0.9861434757457155","host":"s3://npm-registry-packages"}},"12.0.0-canary.07a73750c.0":{"name":"@material/tooltip","version":"12.0.0-canary.07a73750c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.07a73750c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e8ec03194134811929f21d756e50f7f7a931edb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.07a73750c.0.tgz","fileCount":38,"integrity":"sha512-wn5WsVBjE3H2dnfaOcjnoaSsQcISYtdXD2A1qkcZpJeY1vdOF9+Yx8xhxWMY1ni8NXJx/ZdfMIMpwFmb0NQ4lQ==","signatures":[{"sig":"MEUCIQD73iIN06r6f6J7dzW+QmWMsBuWqY6lOCal5MqoRxOo1AIgRIaeA955PuohXNoAeK/xPMvW0mjOh5YAAFmCe0CvL6E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7KV2CRA9TVsSAnZWagAAxiwP/jJHsL22XBx3IMT/hA0O\nxSPXcxbFTTHHVp5sXQPLjzKczgUXVh8p9bw2tSSBYV13JHSQio8tCdQVEhXo\n7aubYIJrtMXmziFzFub8GBNmdYlVUj0/qUy34nGoghpJr0vas8exeXW2iCU7\nRBPx8rVjgvCuyw7QEx1JB2MYJfaaNLA8n0fyJaV2+CVvANlBFHbT8j4XA2Hh\nrn/pNr0W896jWquDT1ZFOq1GNB5nGF1hqZtmnIBgmsbF42DFfsJ05Brk5cpH\nYCCFOHVlUK3AiBEgmZuqsxg5VeglXApke4ZEDBWRjXYG3xwJKvudQVO1anNy\nXq1agWloR4Yxi9NAKWyBlsh0PfgCIWCBJJECM+8AhOAuvvkqKL2sUskgiQOw\nLxrccpTSucSQT6NWSH0jBgQJegTCXOszXQBOphjhVC2TEaSq9LCXzTiOTiXI\nb8GmS82q7wIJDS09JW28Fvfu9L6UqAO/c1FzJHxE6zjlD4nVSb0bybbMHa6E\nxf5JvumowIqoeAtgxSiVLxuqM8ZT/hPwOMEox/nF1TVxLtcZJfFR1w5V2FOK\nYIFBoUo8sgj8HftcHYKEf0QbG79WSOUAAeiN7Nb4Jt9X5+zKxQUCFGbu+jnn\nouN5ksVEYpXdqQ4gUh/VCJ41ssa2tAN0hPQ2+LGhPi3ON48aURC3ts8WJC/p\nU7jl\r\n=BlyI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3534c8199752b92a52696d2065e73b8e4a997195","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.07a73750c.0","@material/rtl":"12.0.0-canary.07a73750c.0","@material/base":"12.0.0-canary.07a73750c.0","@material/shape":"12.0.0-canary.07a73750c.0","@material/theme":"12.0.0-canary.07a73750c.0","@material/animation":"12.0.0-canary.07a73750c.0","@material/elevation":"12.0.0-canary.07a73750c.0","@material/typography":"12.0.0-canary.07a73750c.0","@material/feature-targeting":"12.0.0-canary.07a73750c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.07a73750c.0_1626121590133_0.13633451082770165","host":"s3://npm-registry-packages"}},"12.0.0-canary.3e4c6dca1.0":{"name":"@material/tooltip","version":"12.0.0-canary.3e4c6dca1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.3e4c6dca1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"adf8883138111c9912f1d3cd2c1a10d52209e665","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.3e4c6dca1.0.tgz","fileCount":38,"integrity":"sha512-vM4kP8pR+ygB0+cYLEyCup+zkj8PIxk8DZr6yoy6NotdlyRs8+AD7Q+E2/GlD0jKeAQe+M/QKHC+yZATe5+dVQ==","signatures":[{"sig":"MEYCIQDdl3HJ3efvhNo4DPsiQTxyYB4X/FEMesyChPomKIwP3AIhAOnYtvbtKI2FebwZS88/YCKYXBEeWjQqsMRo3F1M2OfH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7PHcCRA9TVsSAnZWagAAzaEP/2BE039nrhaux/O+DOLO\nmMdp/ftMJI+/+1ockcF2+fbbcb+cm3L6srJS9n+qBvriWNjjSbB7jeRwqAVH\nuN5Ff64sUAYwJyBR+yNX9vsCIJcwvgxXlbWsL2lnfIGmP7cD4cJrZoNDFMA/\nGC4bw9GFJ2C5FRfRDZ0HFYc2V1nsFJr95ybXDgr3ESIshw1x/C3FUcfASGB1\nVwAk/eWUVecyzqs7pVg7ejdqSvORoZB/GREt6+cxQWeFtaHDRjlfN9t81cot\nL1KkNt6MRDHKz40mDFExE8ScoH/LZ4Nr6teO0+6NPUKVYiM6eL8D91SetcFr\nc/WBbcJ19LpuCS3TcgMS+XmnVOfPvd9SZ4SUGRRRdTRBZUlZZjXSLTvAXuia\nGO5vOrasccXnkuPweisUzhv7WknUcZ1fo9TXwx+q6GlGpgT69iKmCaY6wL2M\nsi6gbScm5pFS7PF+bMIJJunocuyuolt6o9l/5T7f3MC0br6p0uTu+BwuX9Ua\nCJtCN0UVskMi4Ahvvuz7239AMkidOtszfrqCTDn2qNzPfpMP3rIFkQ1BZ9pF\nKjgN7oGPJ2nLUYSL/ULTwYLipedsGuVp3lmMkJA96I6D3wzW+vIlFgHmxchc\nYz0AIe8/tVn7Ky61jz0VsH9f7kMuISfaKTVfiiV7k6hKAd+8mx5OVyTeqJey\n2A5+\r\n=YQFS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"1a6a8bc529062b0303c0df830b36d3110a389f4d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.3e4c6dca1.0","@material/rtl":"12.0.0-canary.3e4c6dca1.0","@material/base":"12.0.0-canary.3e4c6dca1.0","@material/shape":"12.0.0-canary.3e4c6dca1.0","@material/theme":"12.0.0-canary.3e4c6dca1.0","@material/animation":"12.0.0-canary.3e4c6dca1.0","@material/elevation":"12.0.0-canary.3e4c6dca1.0","@material/typography":"12.0.0-canary.3e4c6dca1.0","@material/feature-targeting":"12.0.0-canary.3e4c6dca1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.3e4c6dca1.0_1626141147706_0.3598622745355704","host":"s3://npm-registry-packages"}},"12.0.0-canary.ea77795b1.0":{"name":"@material/tooltip","version":"12.0.0-canary.ea77795b1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.ea77795b1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3123d3a6cc107a3b980f24473e125badde149b9b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.ea77795b1.0.tgz","fileCount":38,"integrity":"sha512-TlklHdcpI3ZETQT8iagv0Wd+uAGDaQ9HhmsnJXUaYi2ChqBnjKpii64hGkbCxeKh5xldeWuEJsptpaCh43w31Q==","signatures":[{"sig":"MEUCICubHuVkQIqSVUbolk5exr7/bekcsztUVw9pXCCW5wXwAiEA0zvTA/efZdrbX9yQSFkXKZxxhHoPrFHbyYdm+sSdCl0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7bZECRA9TVsSAnZWagAAAYQP/1gOBjWEJ6QdFsY9Czr+\n6Tsaev8e39NHooC8IOxAR7S2TnAT4dzvKzTnLS0LeX2DTFBnmWjrhXwaZfHp\nduK18cOK94OGNlZiFWzuxZnuwiwOATzJwcAtQ5jwY/QI/jGfH9vxnQ1FtybN\nQUw71ITJYvTZlObZdWLafuKrpjRxrWMFEpOjao+c0C26E53c3sVwx43ee+HY\npHFwxtA2WTyOnDXEPGL3N0+oTy7NqToWZJZbUXJkFmHcwFVsoUR5ZJHbPpRA\n6R9vZx7+yuRIpNQBG+WFCsXxUW/m1+FS2+2MgrAEZR5A4EuAL5NmOAwnjvW+\n+bpJSsDPdgEc7pDKeGMr2IODg/9OH3KMaRV/SwGYi8p+zsL/T7d1dsFBwwjl\nQRJf2V/N2y9huatLzn6jcLWElvZoM5bO+O7PlMwFb5/fyZouPO7XfbkFP9f2\nKQAYtBWYSH72j6zLwTyKTI7teXXj8+072exDHMdN6Fwr3uBKnvspmjPRcBjw\nj+VaL0B3Ouo3QQuS/epJNkCteXwa5+lCFyAjCRn35U+xIrrtIyEKHp0ZDxQZ\nYZX5bztW6EIBZfG8/9SVVQWLEkka7bA3UdO8XtqunkzdPluYO3PnEMFk7ANs\nB7eufICU8OP5Y4iRyLKZX0ScAJFovHuqtScEoEY0xcDcSNsPI8NAU4QK/bCx\nbmFG\r\n=a25Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"830444e6567decdb85bd9b22a92d5f85b103f107","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ea77795b1.0","@material/rtl":"12.0.0-canary.ea77795b1.0","@material/base":"12.0.0-canary.ea77795b1.0","@material/shape":"12.0.0-canary.ea77795b1.0","@material/theme":"12.0.0-canary.ea77795b1.0","@material/animation":"12.0.0-canary.ea77795b1.0","@material/elevation":"12.0.0-canary.ea77795b1.0","@material/typography":"12.0.0-canary.ea77795b1.0","@material/feature-targeting":"12.0.0-canary.ea77795b1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.ea77795b1.0_1626191427828_0.06397423467077945","host":"s3://npm-registry-packages"}},"12.0.0-canary.15a179fad.0":{"name":"@material/tooltip","version":"12.0.0-canary.15a179fad.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.15a179fad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d825b2fd7219076a645578b5f49563858a32e8c4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.15a179fad.0.tgz","fileCount":38,"integrity":"sha512-TP1NHZJ9hLrZOLA2TugGDSFgIwD9dtQvlO5f9QJsIItjV6iQFJqPHyrtEn6/cKb0LnQwOgpqMoXq66vQZuJupw==","signatures":[{"sig":"MEQCIFv8D0fY538GIj1zaNDM69UjaxcVMrJrWqlAfvFWsLWTAiAUrEzpbCciiiYQeRcAgXjdbuz014a9qBpaSWh7Hy17wA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7dccCRA9TVsSAnZWagAANe0QAIeU/KWpJ4f7c1pcGk0V\nL6Qs8CAN1q5l2cGzgoDsyU80bc5h27o6u7LsRs6rhdgEaT/IkujMqwNH1R1i\nesoL4ZlAtO1pfXS1FZLTbxCfLUFVcr0vbyURQQVIN4/ZXjAEQPeFWSRrnqB5\nqDbLHzZ2o5gHvPaeepzcIky3hxLzr0upZgVcUv3JhidHQr6AAXShS7lKdBcW\nKDWanlcKUTifJWANH0NiXLG0UhRSth+7YbNJEwLGyxL8JKs3Vl5klYuTH4Vr\n9kCAe6pjF3ILfYl8MDcfWx1BvGCmShTC0pLfj7Hnt4pgLZ7XwR0sN8Lc5cci\nnzewootKHQeOp9+QBHjCWN8/ZqCyGFs5nw5oKPu3as5gPB4CVg/sfgCFj3YY\naXQ1jMMxHFuSQdvV2QoKqJBdCHwtuRVeNVnQaX/TsQc/WRIXEMLgMqmRrgcZ\n7kiFQ8kOF1hDQVrIUDJ7PGIprUY88rWPjBqDmB2D//ZUmdKJBUGTvWRBXPN0\n10y+xdjePs18nicCcn/bbiGFFULUH9+hquv1je/FIPCaCtfUJ92pn7Zx23iW\nkn00Mtqf4lPhXlxB54NtGDMpRFXmR9N1k49fgib3S+oz91jzKZTPgAEBEkEE\nflXwUQqgD66gkEgMWOJR9d6brCUoyR1lReU+cWxKEfKwWJJrFjH+mQ5vRYVM\ncpOy\r\n=q7KZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"eb659691c3a77be825ea082c434c0b24c53cd610","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.15a179fad.0","@material/rtl":"12.0.0-canary.15a179fad.0","@material/base":"12.0.0-canary.15a179fad.0","@material/shape":"12.0.0-canary.15a179fad.0","@material/theme":"12.0.0-canary.15a179fad.0","@material/animation":"12.0.0-canary.15a179fad.0","@material/elevation":"12.0.0-canary.15a179fad.0","@material/typography":"12.0.0-canary.15a179fad.0","@material/feature-targeting":"12.0.0-canary.15a179fad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.15a179fad.0_1626199835551_0.3247237371886895","host":"s3://npm-registry-packages"}},"12.0.0-canary.c73142a1b.0":{"name":"@material/tooltip","version":"12.0.0-canary.c73142a1b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.c73142a1b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6c6fd2c5c9eb72325da1c283b8ca88f7c5b3e593","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.c73142a1b.0.tgz","fileCount":38,"integrity":"sha512-pWxQwhUw80QrZ23S7ACmMQ67ubQudV4ri3Qw4mCc5ypvPg/7wd5H9lFohq//GvaELr95oN0oyZMy4DT6Yl9r1Q==","signatures":[{"sig":"MEQCIFwIuiyRElbD/wFwe/ry3Bz/HmTaX6peidkpEJdf9P7bAiAnb3HuZo6OT6yy/tXxV1MEymc/qITqk+byVDBC+JFlWA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7d9CCRA9TVsSAnZWagAAabsP/0fiXLyThAhROC5M3Eu1\naoHc4ci1bZfkdLPxK7+sW44gyWNbavLbr14VfVGZ3Rvd8CElwh9meq50u4vY\nS9AGvScHx7yY9AinOwkAlXRDW5e+wq+Vt2OxqoQbEmaWaKKDb/PWlwt7yvoN\nZPXXVG1jJboK4vSeS24qcfmW5z/A0RegaeSoCf/IXdOh46KUhzfuuRQRSeeK\nZHrCtIdiQWYQVuKHrDIRPHX9Nd6ckETUhd7G1JeOwZyG0uxXiQCeSA1lkuBH\nihvD8RzKwJCp6P/6ih4xmucaxvV7yLXZQ5cGo+TPSDZwUMuMC9gLwEugvMVO\n8gMjOTEyHfQ/1+h+MxLBPZ637jzQ1u4EricDFFJxdiPUk/VHaZTNpY8OuXC6\nuxDdYBUTFwcR71Y3by6N27A4+z0Y5ZZ0J9vGuuFGAyCojCcoOtvmSd9GLuMD\n1pSAKvaTOC/CzQD6qDk1jpfsPhSVP8v4/3pvksY74JA8tbAe7Pzvs0/SZb6s\nX/i0/90b0nly3uJ46pbP8reOwmRRoARDwWfwGF4DOXfbfvwnByd09M6acPjN\nu2A59NMV47Wjnxmtk3yWcc2j7+hM3dJMWYlE/D1N8XO3StPC6OPsYGYs8xSx\nVcf9p2KxkHJcNgU3/tgQSEZdQt3jVQG+59LmXQoct5pupXUMcl8DnU+C5Rxe\nyFrk\r\n=Tlwp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"037ccc3828bb7b7c6f3375754059c10c231a6b60","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.c73142a1b.0","@material/rtl":"12.0.0-canary.c73142a1b.0","@material/base":"12.0.0-canary.c73142a1b.0","@material/shape":"12.0.0-canary.c73142a1b.0","@material/theme":"12.0.0-canary.c73142a1b.0","@material/animation":"12.0.0-canary.c73142a1b.0","@material/elevation":"12.0.0-canary.c73142a1b.0","@material/typography":"12.0.0-canary.c73142a1b.0","@material/feature-targeting":"12.0.0-canary.c73142a1b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.c73142a1b.0_1626201921795_0.8598443363644932","host":"s3://npm-registry-packages"}},"12.0.0-canary.d923db73a.0":{"name":"@material/tooltip","version":"12.0.0-canary.d923db73a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.d923db73a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"010f949b8a9c659c2d9a6c11f5f088f4bd3f24c6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.d923db73a.0.tgz","fileCount":38,"integrity":"sha512-st5RsRVNzrs3HnNJkJTrgeistHAhXS9Xxx8K8BLUiTEUhGACEow57McavOndOborvKHM0nc/cn77K5yj0ypIOg==","signatures":[{"sig":"MEUCIQCrKSKZG9yWBPlR/N/JziLiYaY02eIDUEb/pUwkuHwkTAIgb3CD6Et05gzTGYIB4X19ZBli2p/ZuIXFDG2daUTwFaQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7f2jCRA9TVsSAnZWagAA5zIP+QG9NoEy4ji+U0bqQVN1\n9DJXFBRLjdOM2KQyCERRSwfwHmC2sWb0vwaPseGbaSi0wA6s87p5AFtUw9Bk\nYfrPxx5fZ7rfRhGC8p8aAP5BNNGj17bToZGB6EcW+5B8GdX0868b76kKJNZU\nOxHflvYUt9WKfRI7CA2Ad6SSSzWMHLLy/+Sdg98484noQfZn5IvmvlnnWka1\nEbSmhA0/2kTuJK6Wpa9gOZNtc/HSJGLium+Tj0VfoUZltAiMvA2XUZU1IcOr\n1T/6C81c7HpQMNrW6odOYBHtMrQUixt5qeZG9QNpBYsF6si3oIHVkJsA+Cfp\nDVrI1O2OANejzmoLFpwBvusylrwdKv1Ol/QjOAfE3wLMVh9369zjRZOJioVm\nqpzLGcf6scPNwYdnbCFN/a9k4/U7Fi0AtQ4TrRt1zFE2Uxdz/nFANHS6BbzC\nvgzWec6GVSoRfQZbLowgh68VyrZIBQOJFmdQoc5Ux36eAz6bdqAQnmuGBM/7\nzt09+8zPS3u1Y3Vx831QMqdxy3l75FWtkvN19WyYHRpDShY9ceJuwHorjuH5\n6/Si19yq5QrjlBMuG64ZYKUVWTYU4XSpArFurU5BER9zn5UwLOmWazNeqyjq\naXqAftNHqGTwE+apHM3gLm8lLTAoRpr/Byb5OCp29LAw0zkiB9jPw4Daxezl\nu3dg\r\n=/BTL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ae010eec116ad324d7e442d7ffac5c8ddcb9edf6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d923db73a.0","@material/rtl":"12.0.0-canary.d923db73a.0","@material/base":"12.0.0-canary.d923db73a.0","@material/shape":"12.0.0-canary.d923db73a.0","@material/theme":"12.0.0-canary.d923db73a.0","@material/animation":"12.0.0-canary.d923db73a.0","@material/elevation":"12.0.0-canary.d923db73a.0","@material/typography":"12.0.0-canary.d923db73a.0","@material/feature-targeting":"12.0.0-canary.d923db73a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.d923db73a.0_1626209698665_0.3121993188343952","host":"s3://npm-registry-packages"}},"12.0.0-canary.22d29cbb4.0":{"name":"@material/tooltip","version":"12.0.0-canary.22d29cbb4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.22d29cbb4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e81c509acf0a187d31090e0309d88493b5672d79","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.22d29cbb4.0.tgz","fileCount":38,"integrity":"sha512-TxyD/0AfiUqNtCYcYSjOcQi1DntOMvwwQFwtI/KdDbmyLujzEkr6JCOTCYMvywX+LHK0TEOy1Tb+cNimUpkpzA==","signatures":[{"sig":"MEQCIC4R6utV8O/Ayn8cT2V1ODYiLpt3MmprLPo2CHE7ffgsAiBZhpiDnIZj0Mdv7r6OAOhS1Echvhsd0Z4lC9myfQ418w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7hkACRA9TVsSAnZWagAAwWsP/007LBToFOwlyt/dJlrk\nCxpl+6gsQNWT0Kob2lwIdipW9/SzfrdUTZCU29YpEHQ8hYPAR0kuiuEy/UP8\nPk5i21XCkd+hcGOzEV8PK5IAJlaDLWFZx9figUlTGfTvkdViADocg9nAL8zh\nnuxnpVh/mYWRtmB0IWg/tFWfnLbOTzwXcan5dmvm6qHj6NCqS7fxS9EnzNHu\n19tMgqNxAjvgFhwcWHPmXEE4WNwIV+87QMzWW+oPd8uDnxX65DJuiGvuOXO/\n67HDuNJ0kwHeC/mzDFB6Dd5TTbfMfY+myXgppmX3LRImyExHFgECltp+IrQx\nH5dhIBRrQJfjQE/vCkBJQIZd9gRO9+4mTjFMAoCoPMwaI52txybN0Poaa6Iz\n+CFRitfEbywBZndUC602eKF3vPOoms+rHVWgZESWl/+TrUmo7WBq5Ik0QqZr\nbGIYxOtPx3xHvjQhbxHLf/iB1P9nDpUg+atinsnlCtqokZk61k1DzN8HfshY\ndzeCmvl5rTHm6ruEsVfyoam3CgeQ2m28WRtnelhIsstd9/4J9CYBwpPWN6TL\ntwc8zshAkBP34fikjOm3Ue5W3UFogzbSD2HMuVPzn7V/+VjzliLCT2ycq5rK\nQvKKNbL6f8R1FSGFlbLqWS8HNaRMV3CiAjfQigK1wJxWELoUTdoRyERZP0OE\nyP3k\r\n=w8ub\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b37054450964af349924b81bae43ec6b3beb2808","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.22d29cbb4.0","@material/rtl":"12.0.0-canary.22d29cbb4.0","@material/base":"12.0.0-canary.22d29cbb4.0","@material/shape":"12.0.0-canary.22d29cbb4.0","@material/theme":"12.0.0-canary.22d29cbb4.0","@material/animation":"12.0.0-canary.22d29cbb4.0","@material/elevation":"12.0.0-canary.22d29cbb4.0","@material/typography":"12.0.0-canary.22d29cbb4.0","@material/feature-targeting":"12.0.0-canary.22d29cbb4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.22d29cbb4.0_1626216704292_0.8642581779650362","host":"s3://npm-registry-packages"}},"12.0.0-canary.2749604bc.0":{"name":"@material/tooltip","version":"12.0.0-canary.2749604bc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.2749604bc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"121a554bb94dba5d3985d3da16552a7bfd68d207","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.2749604bc.0.tgz","fileCount":38,"integrity":"sha512-UjfOKYUmW59FPaWQaH7Fha4pMFM1T+sXpkUUELUGqbKzK4Lr2bkKSkeOqR1CLtIiwnTfKkJ3lorSHUdUz5bgHA==","signatures":[{"sig":"MEQCIB+lL9PAwlLVaZJy0LGbN3BaTbTF5xRi+lUjf2iZ7UCyAiBSPMLGoqnShN68nLlCDiImRlreZ1c+7EeJXN0lPjB5NQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7w+FCRA9TVsSAnZWagAAxaUP/RPGT5EY7SsuFktviyUI\nxSiwzf28vSc5S/s6nqYR5NW00WJIxn3ojmsO8MPPGKBdqPFCp75cNEh0zveq\nB72nTEU7LNssZhKgh67P+03pnJ4RJAWSKQdfYzfVZSmoEhMmySWTPuJACUBp\nYoB9/I8bhzDkQkqXIMlAQq3fknJpgo4PcWLtxwZPuqLWWcxjwNHQjySHOxyW\nSl5pdIqoCOBd5I2x0nrAdYoTpfjRyO8U9JMqrZljx9RrMQHo5eqy8yi6JF1p\neUGyT4eaSdSeiWTWThAPjoxUUwcOJsNwQ7zIA7Z5d9GXyP5KfoKsFJOIJwlv\na4d65m/amfE1RRBCqLVF6ytagH+XytS0kHSseZqAJPme0mNz3ZBs6JwD30On\n1yItpYr4VLkCX7X5bCSZhffql/WM1fj58cywncx3lH0bJvBHRfeTJXH/HqSb\nUpCiE9UoejsgiJB/GES6KA6LR7LBk/NWBYlWt/gKZmVVVkFSpEW2KK32vZdZ\npjPOaPZMPfxjvl0u6R21JSnE7XYSR6PtnKL5v3E8+3WsaCJwkc/FA+JcC9aw\nv7SsU6/aGaY1GRi5varxF2BrZhNQmmZRkfzWBSZMnek9Ncwvrpp9KjsFCSOr\nEG5AvoKB4KIjapXxDJHfse6DaJ3gzq1isgq1dqZbEs09rBLrtq+inRSjqh3F\n85L9\r\n=KLe9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"58ae4287239fcccbe4c5dd9259164a0660c76f85","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.2749604bc.0","@material/rtl":"12.0.0-canary.2749604bc.0","@material/base":"12.0.0-canary.2749604bc.0","@material/shape":"12.0.0-canary.2749604bc.0","@material/theme":"12.0.0-canary.2749604bc.0","@material/animation":"12.0.0-canary.2749604bc.0","@material/elevation":"12.0.0-canary.2749604bc.0","@material/typography":"12.0.0-canary.2749604bc.0","@material/feature-targeting":"12.0.0-canary.2749604bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.2749604bc.0_1626279812911_0.2497773447804179","host":"s3://npm-registry-packages"}},"12.0.0-canary.e1703bed9.0":{"name":"@material/tooltip","version":"12.0.0-canary.e1703bed9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.e1703bed9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cffcb560fd9a601cca8e4d01da62e9498d452884","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.e1703bed9.0.tgz","fileCount":38,"integrity":"sha512-fCYM0REBPut563BVRffjb+amwBD0A7xzZLLUrdJY8Ik9gkP0e6P0bmt43YDTYap0RbpJzXo3MCmF2oGAs3CeiQ==","signatures":[{"sig":"MEQCIBY0qcK4W6rTeSZx/31t3pR9aF+83CBwXLQQdak+kX+5AiADB/ti/3oX/Hzi4Xmq0Ip8OTMPDiW04Tq6ieihH+hRLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":817543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg71vXCRA9TVsSAnZWagAAXBAP/i7GzxKRfVAk/g37vI1S\n7egY7ok8Sj19EsTCBESWCgwhmngYLa9acrPfbmX2qUNCb8rGSEkOUJbEd+Mp\nzJ6V8XORKQGdpEHJp2z8tTHr36d0wrRVaoNKFuFX+q0JsTh8nk3QU+3kmmAv\nFG5m7UqGPL5q26AnVzMiEjPs9fkK6aANUTCSTw9xYm7ER0ToWD3JkbABND2k\nkfgIUQTvTPgzKmx1h0z5W0YkHQY7Q8qkqz9frDqr2CCPPXXDfCbbjbH70sts\nIj+wxPRTkDspSw4n0LFtPItSRoU393O9YHQlLDIpQZw1e93kIHg4K8hq5c4I\nkxjtAIzcJFRUDz/oTuoHewGw7LmXHWjbViSCi5Oq49WS5u8DQiM0HBTZVgVa\nv4VxeidhzlSkxkcJEDFMp/2HI9x/FByDsfw/3EMsTYThLP+70GbLRgZc4OP4\nk/GNaQ0WmRFHfCtqCUSqinVyUWnYpy8pNp81vtMqnAAJHw40rYZt1cHqIS98\nJZaJ7Q+AHaUUVWFNiYBL5xQMVn68BPbgEoQE3+KhEP8DH46mqVm/AESRoRI7\nCoWGlR9vL48mDirSoztl5yYQqQDa835RYPjjOpx8izNwfI3fXZ8L6ZLFvkT0\nvZuRNjHZdjrF3f6rrKFBiwfnYDSeXvQQAbbd5asWxiI0XiOSJZHttLXzNeY+\nxq72\r\n=r5z+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ca9075f939dcacc82290fe2b01214639958bde93","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.e1703bed9.0","@material/rtl":"12.0.0-canary.e1703bed9.0","@material/base":"12.0.0-canary.e1703bed9.0","@material/shape":"12.0.0-canary.e1703bed9.0","@material/theme":"12.0.0-canary.e1703bed9.0","@material/animation":"12.0.0-canary.e1703bed9.0","@material/elevation":"12.0.0-canary.e1703bed9.0","@material/typography":"12.0.0-canary.e1703bed9.0","@material/feature-targeting":"12.0.0-canary.e1703bed9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.e1703bed9.0_1626299350646_0.7004380549979203","host":"s3://npm-registry-packages"}},"12.0.0-canary.de48eff0d.0":{"name":"@material/tooltip","version":"12.0.0-canary.de48eff0d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.de48eff0d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c9875ea6e93f5da6007b3e72adf178bfd7287fe2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.de48eff0d.0.tgz","fileCount":38,"integrity":"sha512-2gWXfYccLJiqlTGqHWEW7zxC3ktND1in2cxTM3jNKi1wdz7cU0VZqw+Gn/V0NHe7HJ7FgZxI2g1hEOPLLOEceg==","signatures":[{"sig":"MEYCIQCRcK7GlIIUVEPWq0xgpsKDQE5P+QyaMz0fyA5EsAB5wQIhAMHrAm9ScHgc1yC7bTOaRijEw6Hesj9VHvYCTqs3mtVH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8Gu5CRA9TVsSAnZWagAAdiwQAI0NLoFXrSP4AMwPMiM3\nOIFB1V5zsbjV7xbh0ol1VIZPs/7SCWqX/1VMTftxyUrw5t0SCd70KM/avPlK\ngHd+HVNha9n36SE4BPi4BeIMrYeX8likzlaohE7VLIB6qotJaTFsFdwGPiUC\nBprPnJpsl8ZUWBE1uEKCSlVIR+bvhxCbYVcP0FtbtFOJPBBtDqsZrYicjbh7\nESbJipqf1GQfBDQhmyQ4QwVj4pJkT9HrC3X1JSQmyaYsQkbY47PxWxkoz2X2\nxwJhsPczppRrx7QCxEHh/3Cw8992in2R/PhiTzP0wiiaZt9PjIM6eeWYu+/r\nFrImhqnon7vqA59xVTKLBsUUl+oZgM1zJtDPWtsg61jll9uU6izzLxCiNX0n\nymQPiiBI9Fv+Hq+pCpkx706ABixEZZa6ATUkvL2ijUx+gRK+QUwH3GaUvvh4\n0fV4c0pVsJNxkZcaYu9wgsLSWyPFkZRJw3b5NNgpSVmBV1J2fSsIEoNIc9DI\nA2Fjg5G/RIT2lFaSiobswSWLcnZG7Y+5Zna6sUpPAmsEau6pQCn3/8Y7vVUE\nso+sKd8LEia3uH/qiltwYKOaDCO54J94xBxCH76oYgeaHt32KLqbbN9/0mnT\nHwWvHsAWaWO6JVrqSXCfltky6CpDeyqsdenTo24GlyjqrgiH3vdXQ1fb5mEa\n43wp\r\n=dz5v\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"121530dfc073c7b24dc1cb75732a0d4c0e6a3f28","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.de48eff0d.0","@material/rtl":"12.0.0-canary.de48eff0d.0","@material/base":"12.0.0-canary.de48eff0d.0","@material/shape":"12.0.0-canary.de48eff0d.0","@material/theme":"12.0.0-canary.de48eff0d.0","@material/animation":"12.0.0-canary.de48eff0d.0","@material/elevation":"12.0.0-canary.de48eff0d.0","@material/typography":"12.0.0-canary.de48eff0d.0","@material/feature-targeting":"12.0.0-canary.de48eff0d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.de48eff0d.0_1626368953660_0.7885316324483502","host":"s3://npm-registry-packages"}},"12.0.0-canary.4f060adc5.0":{"name":"@material/tooltip","version":"12.0.0-canary.4f060adc5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.4f060adc5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"997057e43920c867ebe5e3cc773eb081741af107","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.4f060adc5.0.tgz","fileCount":38,"integrity":"sha512-33UYDH8EUf8QllcvJA+4SjKkfgXYubuptlT7ulAb0zyzLtMeR41792D/GPrOVfmCEXxyDUHtLYR9v+D4guDijQ==","signatures":[{"sig":"MEYCIQDHhP2lvo0FOoNzPyErinJRSKGYgXj7+gqsgpwhJY/XigIhAN5QYuyazflLetnlrZKL4wHcHeM9CF9RRdXmpuDZUu7w","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8IsQCRA9TVsSAnZWagAAJLQP+wc4QROZIkFKJtWOLm3w\n+8zanVJVC6LMAJx1CW/KbrRAJpHzz+snI3otDO2JmWOn9Civ5OLN+ouLp4Fj\nZIFXJ/9ywuVdE2iZV02/LJ7V4QwJgDOYtfLSPl2WPVwvb+npk+khJyaLGAYn\nsCosADXIPAKtVv2AR/pVaQsKlPfezylak9OzJwg4lt0bakaDuWAT0p+kQhe8\nwQe26aTSm+KqqNOTbw+6lvjQ9UIJPkUtTCosxLhgXVqFXCnrfThG5cgKKuJq\nTce/Cfrm4eUk+zocALSMGDfKTStMC5SuDV59rY2HSjzi/jo96biUMyyriNwK\nVXzB8Km1M4WFHmad/I+Y8URIBKrsl/Lw/ZkmYkoD0T3Cji3uGJKbgSH7WeYu\nQ4IBiS0Zwxl7TuzDZwl7xexj7flQ7Y9mg9u6rVkDetH9AwndyIv53iuondUO\nffrdCk8kWGuBGjaSEKN7sqcz5UNhdE8q0fsGMc0ACI1zut2cXr1tvVN5pWdM\ndWMacTxElzmKYqxzTgxlEP3kqUYOnE/aCBgWfg6BEJ3EmtTb6C9gdi1rBxjw\nWCILnctTuR4Vcxgjbplw295GNqCox1L9LVy8PKkEXamyakgFwfTRt/ZC2iru\nItAuAqNwhvVnLnZCP9quPxCbgNBPEMp3n1QCHEr1hGCQsDAxBtQdsgbiH5to\nR0d4\r\n=bGKA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"2e70b8cd653f195a01f93c3e9928feabf39fa87e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4f060adc5.0","@material/rtl":"12.0.0-canary.4f060adc5.0","@material/base":"12.0.0-canary.4f060adc5.0","@material/shape":"12.0.0-canary.4f060adc5.0","@material/theme":"12.0.0-canary.4f060adc5.0","@material/animation":"12.0.0-canary.4f060adc5.0","@material/elevation":"12.0.0-canary.4f060adc5.0","@material/typography":"12.0.0-canary.4f060adc5.0","@material/feature-targeting":"12.0.0-canary.4f060adc5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.4f060adc5.0_1626376976623_0.4688922043691648","host":"s3://npm-registry-packages"}},"12.0.0-canary.bd25779b2.0":{"name":"@material/tooltip","version":"12.0.0-canary.bd25779b2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.bd25779b2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"85a2aaeeccb691f10b59736ea8b36cce0f5d2a14","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.bd25779b2.0.tgz","fileCount":38,"integrity":"sha512-F7GWsSfB542AmKu05PyP+4M/rYwvj5oYGs+ckEuBO/xqh6P1rBBnzlSktRXyfYJL9mA6eQckbTp3zqreYqqpGg==","signatures":[{"sig":"MEQCIH7OL6INfrrM2Uxtzz60LvEbbfHXluUFMaIEGSqLTxFyAiBPr2BDDJGjcXZulpS83QRAeDeaWZ9ZKCC3MVeq6R5ODg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8J3pCRA9TVsSAnZWagAAi3kP/1pI+3bhgpU+zla6Rw4l\nTil0pHBr6JtRV+HAGgSW7P07gJtnz2Tu2DAWfsTaXPXdmWEUF+f4X23n4CHg\n/REY1HhcCwLHmf7EFbbNYILQwIUjGeZSUL13Dmd7xk+kcvcWZ+ha8Iy8j41B\nmVyw2tc7NVGZNSRG607oIDUWnk6lKC6bm2nc6F42dfyO0MJj4k9clqm38L/X\nt2Iw0mVvMwzq2WULOfXo65JwIPEa/pf+6YnglEY+p3Q1dkDVA9pop8YHOz7s\n4f5YXPcQjdrJ4PGGLaC1W0lX5L0CuKTM5XRBOakvJcx4UmLFs5T9rSTZhyEQ\nC19g/Q3/PwsN6voO8N/g102FWOqC/2dKDAWaeUjZ0hs8pFHEU/Xbi55Ky3aT\nrCCX0H+AjZhl5TXaXiPHAo2yVfeogk+oYfqiHIl+HLfE02ehkjdIlGWGBzj4\nVa+8B0KEQVh+b8nvzEAgnZKXDG7vxv2jxW7tKINci9NPFU7tWv58+uaR10Ki\nN1mHss2gOC/pV1rIwYZEahEVcRDOhkaRe4jewE/vHop20yNIMW8JdyD56uTG\nrm0kdHVH/UnI//4QJA5+K06ip+pAYyyT2XYQd8XpXeDmVv6LFc08EEUL2D/B\n1k9yc2+6phS73jE2KyfIFz7nWsI3rCm/n2hHCQRJ9yOd9j3mbK6ApIjM9Xs8\nw6Dl\r\n=5jZv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"3ea8422325f9bc5f9a356842191da47e282aa4dd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.bd25779b2.0","@material/rtl":"12.0.0-canary.bd25779b2.0","@material/base":"12.0.0-canary.bd25779b2.0","@material/shape":"12.0.0-canary.bd25779b2.0","@material/theme":"12.0.0-canary.bd25779b2.0","@material/animation":"12.0.0-canary.bd25779b2.0","@material/elevation":"12.0.0-canary.bd25779b2.0","@material/typography":"12.0.0-canary.bd25779b2.0","@material/feature-targeting":"12.0.0-canary.bd25779b2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.bd25779b2.0_1626381800866_0.7459340324507893","host":"s3://npm-registry-packages"}},"12.0.0-canary.9f68a932e.0":{"name":"@material/tooltip","version":"12.0.0-canary.9f68a932e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.9f68a932e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ba9234c80aca60c6dc9a37ec4e9ec9ccfbb3bf7a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.9f68a932e.0.tgz","fileCount":38,"integrity":"sha512-MplA8aQ3gXuwGoTijeZhLs1EkZmSGBOCD4mAw9j6B+RznUiDDFZF6GTobcCD6Oxhz7n9jzytHT74eyF1oVcxUw==","signatures":[{"sig":"MEQCICKtem+LRHYXaEwXqAHsh/xe27Mn8jsoVNwLG53DixzWAiBep0PB6ClOpTyN724tBxGmayQX1m4QzBoCTDOkGOZDQA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8LHHCRA9TVsSAnZWagAAF9sP/i7fozJHscZeEJ6+IY2J\nOAB49LH+NyxoqGZJjCVNAkHAr5X6d4JBXGMzmXtp/UZv5JddHFRfQcWajAPG\ng+bYIr0NXDwQNPOZhzfdPJIgO71V1i4qkheMh05CULhzCwa96XSLrLj1AWuK\n9kcY+7ey9nLVQjpMczyMwuHb2M4jifH4AH/j9zgo229p1f16yx7l4GCtHD25\n7winUlxB2rJ/VLjkQaV/QOsHQMR+TmWLXKJI0LWOqvfFivwT8QXiM9A1Jw5B\nbjJL8L+aeIKNJFteAy8Ta5YB1L8lNH23bERG11Kh8pqfJ87DxBhohLpcdjnJ\nmX27GaFioCcNmBBxDHMS89qb7CqCOxUNVQ5NMlubmFapgNDlZo5V834fyQuQ\nkziHcZa1h3o7i+G1AxsXi+DtoAncOBjOh6u9+3VzFqLz/eNxyOsk1jjnJ9Qs\nihOgRGwl+/bNYtD2WxfkC4O8ohlF530cG5R/Ze0aggIRQX08J9g9eOiGhW3e\nD5eg3QwAfGpZS6gDjNS2S/7FyiG1xRM7Q8Yn+NPqYQNf4w2JWG4ZiN2+ysL9\nzr64Lm6mk+6hjXjebgtmEJ/tGpaZYV+gciaQhVeUdyhrTKMnzmwjUvQ6O38d\n440LOpXz4pCbbekzwEhOdllNJdugT7OCE9Gp7/H5dDzMmeD+D5k9WnOl+Rb1\nhsch\r\n=q+Ju\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"34b4e5801eaff79707e9f2c769df2c1a34bbdb11","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.9f68a932e.0","@material/rtl":"12.0.0-canary.9f68a932e.0","@material/base":"12.0.0-canary.9f68a932e.0","@material/shape":"12.0.0-canary.9f68a932e.0","@material/theme":"12.0.0-canary.9f68a932e.0","@material/animation":"12.0.0-canary.9f68a932e.0","@material/elevation":"12.0.0-canary.9f68a932e.0","@material/typography":"12.0.0-canary.9f68a932e.0","@material/feature-targeting":"12.0.0-canary.9f68a932e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.9f68a932e.0_1626386887086_0.04580675743600926","host":"s3://npm-registry-packages"}},"12.0.0-canary.4eecdeaf0.0":{"name":"@material/tooltip","version":"12.0.0-canary.4eecdeaf0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.4eecdeaf0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cec4e44478829ded07404adfde066f910a508906","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.4eecdeaf0.0.tgz","fileCount":38,"integrity":"sha512-m7GzLqOBsWnqCc7YAibbkTzZUhPU0DpobHNFWVRLCYT+HZ39MZMf9Lw2Rk/9LULuB0WwiaorWzVCp11Ts9IEVQ==","signatures":[{"sig":"MEQCIBmxfl6xx1O6mU/qGjJJqv4fmrJzwLGO3CKzVlSruGcfAiAIzw9mkYg1ZPiRuley8oCprLBm0lOhMrPMhtP0tI0X1Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8Z64CRA9TVsSAnZWagAAP8AQAKUZ/kn1UOPDP4NzSDZL\n7yRCVbHMbHqkdwLj9C12pMGHT77dQ9mIT/IYJVwedzzaCjb4ZqePzPUEaV7G\nhd6XgNhSWrJXLO6lTiN1JcgFy5LBR1R6lBCx3EzBRW2qnmiUsvktxfhMuPUM\nJJ84pTIVz1AYEeGZvCSjHt87pGyLS3gi+tvPsl7JAqsUFM8v/tzgwIbs7Yld\nBAkieA//6kKT02bg6xIgw6GIG6K09DyRfpxwz57bULljVwmY72qp17jvM+kE\nHJ6Ad3gMZU+xoZN+8gxRwqb/rdaYUf8ugyXW6ho6xN5D1sSmFkDSFte4tdJP\nZAPbohRcX4OOg0Yz1jbaf8kOQgU8Nd+XosXe0eoC2ayWvh5lfax67lk9eGiW\nD84yDakk/1f7Kc3r/e88X57mHUR0izOQIOlhJYzTfGmxs6VeIgcs4yNSRUfj\nVKPwCCmz+zxl8Dh25NAoy18+vNPuVYLdO4FCVJEEArjAZmX6HP4pUQmjdeN8\nNo//czzunK7C6hYLPg//H1bIy0AjSfC2kbhlEy0JKh6LoHpx19QKPZer72H2\nV4CU72gI+cFe9spXN0L5obteRCY+tbB3mGsJA4U2RszpCWCtkV31NgIz9Y4y\nHHY+4mC0ykakfHGmle7XJ0DM7OR00mDN8Ho7efo+6haMKk3TQr6QuAQKgmWM\nyeua\r\n=4MgT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"89a3faf78d32cadbed38135c9ae10ab1f3c8e9a6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4eecdeaf0.0","@material/rtl":"12.0.0-canary.4eecdeaf0.0","@material/base":"12.0.0-canary.4eecdeaf0.0","@material/shape":"12.0.0-canary.4eecdeaf0.0","@material/theme":"12.0.0-canary.4eecdeaf0.0","@material/animation":"12.0.0-canary.4eecdeaf0.0","@material/elevation":"12.0.0-canary.4eecdeaf0.0","@material/typography":"12.0.0-canary.4eecdeaf0.0","@material/feature-targeting":"12.0.0-canary.4eecdeaf0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.4eecdeaf0.0_1626447544148_0.5474858258396929","host":"s3://npm-registry-packages"}},"12.0.0-canary.7239684d4.0":{"name":"@material/tooltip","version":"12.0.0-canary.7239684d4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.7239684d4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"62cfedea718c5ae0361e9218c2b20eeb59905231","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.7239684d4.0.tgz","fileCount":38,"integrity":"sha512-NPEJHmw4uTFp9s0H7VnOoqQqqiQN9ox4CTsWLu2DemNk15fUP8iIOzqC7qcpm3vFldpRjfaz7rr/KnsSsQa7SQ==","signatures":[{"sig":"MEUCIQCnOW2tBJE42IJlgnxGAvFZVzzBZiimca6PWfsYfmWRXwIgCemMwiCvyKD9mJ8yhjO/fWT8OmjmUxOG58MW6+KT+fE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8a0ICRA9TVsSAnZWagAArWMQAJOu7l+kRx0ngUG6swwJ\nauQXukn65TZ5G/6/kFJ7waq0b4fH7OmXlk9k8Yle6eHjxMN9RS8/90fUZHiW\nz1TLSzEjq+ndn8gYHK1kPDNR8SEzaHR9wn6pFje7O/K3isf0DL4e2yF8aUlh\nuuo0eEs+u+pavitrGAFiJtfvdF6zCo6THE3DdmUHCv+MmQGvAIX72Nw1CMKP\nT5mugItvVO35lkA//mXtEfec26yQpJtBIRda4KD74gHpQBhswBou9qBPX9QD\n8W/t0THpsZ+SfRPvejWnnkGPHMDreQERbglsm5phbfRXfiKSl75I+YhYm6Kf\n8/ZjQ36n5UZN0DTYP652W1U57AYDewrYBoswk13AbQ26mWcvd/JbwLuBIo0l\nSpLyjg2TfL2WmqW+1M5BB249BbBz8bJ9G7zD1WqhYtOf0NKgTVJTbMS8KPnQ\nxmYiaMoYwKocGbSICaA6ocS7nbVy1GgZM1/0O3ryLTJjDwjBeLBQ6VZwwL8j\n+B8fFsbVyrM4ZhhTlHXUuUFQAbnOY3T4N41WTapn02zpGos6imYsTdKkLMy5\no3UyNrg2UeSR7Hzu+hvmRjsu+Wb3Wvj/PcpZjTJLYd0qidjHumjoQ//BKleH\nyeYpoPRWHAZ4RPibv30dFMUbqzM9tuZ9O1lKYgLskfVWpmniUNIrSH3W8lcm\nbjPu\r\n=6IJT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"4b35543a488bb22a0855f6f0d00b047fa76bd623","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.7239684d4.0","@material/rtl":"12.0.0-canary.7239684d4.0","@material/base":"12.0.0-canary.7239684d4.0","@material/shape":"12.0.0-canary.7239684d4.0","@material/theme":"12.0.0-canary.7239684d4.0","@material/animation":"12.0.0-canary.7239684d4.0","@material/elevation":"12.0.0-canary.7239684d4.0","@material/typography":"12.0.0-canary.7239684d4.0","@material/feature-targeting":"12.0.0-canary.7239684d4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.7239684d4.0_1626451207957_0.03366882184455311","host":"s3://npm-registry-packages"}},"12.0.0-canary.d5f1f7c72.0":{"name":"@material/tooltip","version":"12.0.0-canary.d5f1f7c72.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.d5f1f7c72.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8833e0f747cf69c5218530650716291417c2a61c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.d5f1f7c72.0.tgz","fileCount":38,"integrity":"sha512-iGyBL58lzKrGT/ppGsqPi3ZdjwHUeCIBYT0efUkMfsH9NV9pNM0W+zr3gj2EtOi8j0XHrSEgb1KS4CqlaT8Log==","signatures":[{"sig":"MEUCIQDGdVTZcpITot0J/5AA5xJ7rao+mRhAC23e2NG9ae1rUwIgVxEdMqB8Z0tzYPTEbXeCUme6x3U12qPcLljebfQcw+c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8bCACRA9TVsSAnZWagAApT8P/2bvnkN4rc3H3FFwULNm\nQUK7dAe9Zd9RfUGoKyt/uWZq0n+QGyrXm951u03rOFFlV1aJy00Gyxh8kNKE\nXLjGJeSD+ecby/Xv9CFxa369eSeF/ddbz/6TYxQmTjWoEvNHgT/AeDuI7+9d\nWPEB5YCeop4PnfKJjRTomst7aKMpu7+dNva8vkkyOENpxiPs9V2dKdmANTwe\nS5+rehoh5xlbSyO73F1Vw5xR2tPHFI4r4IrT5nsmyCONbU1wFVmRzBsrIiD5\nfxaqrVncMZ8ejoO4AlPPh5n0aAUhUyCRmhw/Cc1fdu4L7nygS0HfeLWd1+dV\n4xF6KSXNA4o1bK/Nl4C9vEk2GPjwFmpPaGtw7ePrxuGCcIESVRssIKPJZ84U\nEAJuhQrzPc7HqRrT6+vah2w6hHqB+biBYhBKW6gG6c0b+efFtUezVbKXAi+5\n5mkLRMlU9au76/i4y1bELAEc51ipeWpJL6wSudka92qxqYw16yR4qy99Vd0B\npWrKxPzBBOsNFotdoOeQOWyXcnfHh7KzVHqTVxjvlCDRWDoggQ0Wh4r+a1W+\nY9DjinRC+5mNvZgigskz6cMeFssLv7DCemKVqkAnJvaNDYNCBvPFlVo6Xcn3\nhLgg/s3XKtPP2aAO/U4rMTB4HivQOH9/IKagzvh3b00rEjL9Sc8obyVAsEnI\nIMRt\r\n=Gp28\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"ef327d93f5a591e88ce5af94a2bb181d97b58472","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.d5f1f7c72.0","@material/rtl":"12.0.0-canary.d5f1f7c72.0","@material/base":"12.0.0-canary.d5f1f7c72.0","@material/shape":"12.0.0-canary.d5f1f7c72.0","@material/theme":"12.0.0-canary.d5f1f7c72.0","@material/animation":"12.0.0-canary.d5f1f7c72.0","@material/elevation":"12.0.0-canary.d5f1f7c72.0","@material/typography":"12.0.0-canary.d5f1f7c72.0","@material/feature-targeting":"12.0.0-canary.d5f1f7c72.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.d5f1f7c72.0_1626452096080_0.9531661165254439","host":"s3://npm-registry-packages"}},"12.0.0-canary.4d95812f9.0":{"name":"@material/tooltip","version":"12.0.0-canary.4d95812f9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.4d95812f9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b0eaa1b297f34c4799f7501b006c4620b2bb9e5c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.4d95812f9.0.tgz","fileCount":38,"integrity":"sha512-ORb/iIGlEWSOm4P0RJOMhaoKRJuaS2hK6z2kbHVDDs8Hzk+ZtG3Jp/pHg6tn0JInt8i3dBXxqtOFRuwGJToIKg==","signatures":[{"sig":"MEQCIDTTVcJtbRh0C5o+Q9gNcXi4GfZ6WiLceSxbiZw3r+ydAiBAo3a13b5AGyWi7NYL0JHqdJoy761Kj7UmNrjE48+Rxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8eGJCRA9TVsSAnZWagAA07AP/28M+klSoHyy72q49dfI\nPNk8vNa2LA35HeFEpR+SPLA4WdY+caKQL+twyr9W7C4LhXUzj6mIEaD8XWdO\nEB7oeIL6fRUqe1VIRpDDBIkkreThevKUVbeR9FSBK/1VafW9KrQdPq+bG9UV\nvscRaMOuEt8LU5WrbSPQ/QeDY+UX/uOnaCJDZVsT1oLfY1YfAFRyhnH2Fwsh\nMdhtc1qG/+4HgdcZNMQjuIDTJtS4w7WsscYPn179qriT0rX+mcCmxuMop0cS\nNlF+m40+W/mjRu9wM0F5kAcflH0wEc1RESasMzaxnGkBi0jq3SOmmLWOFwDv\ncj4AVgwOxn4TUk3Jq2q1O29xRzW1Li9vp1ZmbfyL1xgarNK6FkSCKuwGCB6/\ng105bLKlACxBPAVV8oPYUgXD9LiS/6lcFaLwL8XOywvvBLuH4ZEL8tgkf8Ev\nHOAALDCfBJxZdhMBLIS9p+oMiyOQrYG0QJTRMTURqw2VeonhSR6vD4qoyroV\nxkG0kk77FYbi1j8jxVq+ySgcRQmiYXeWhqTbp2Nd+5VnuTs/Vr4R03QLEsx7\nA7rs1CZjp7H+Aq54u9TQ5AuX0dsNbwBrrKn4yEdkv8Dj9tERy1eqNbiEJrkW\ndsiJVyYeSoaT07xZ55zRrejIHNBjkmeATFeZU4QE42aqSCB+CWhPSaTGUD5B\n5ASq\r\n=oh+T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"34bd44726ccda77331fa29afdc1d5ab7ff0879af","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.4d95812f9.0","@material/rtl":"12.0.0-canary.4d95812f9.0","@material/base":"12.0.0-canary.4d95812f9.0","@material/shape":"12.0.0-canary.4d95812f9.0","@material/theme":"12.0.0-canary.4d95812f9.0","@material/animation":"12.0.0-canary.4d95812f9.0","@material/elevation":"12.0.0-canary.4d95812f9.0","@material/typography":"12.0.0-canary.4d95812f9.0","@material/feature-targeting":"12.0.0-canary.4d95812f9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.4d95812f9.0_1626464648981_0.5643733926562458","host":"s3://npm-registry-packages"}},"12.0.0-canary.38d1846cc.0":{"name":"@material/tooltip","version":"12.0.0-canary.38d1846cc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.38d1846cc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5283631a2d6f866fa2ee86d4f7aff0677be3760f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.38d1846cc.0.tgz","fileCount":38,"integrity":"sha512-MB2oL3w4MzVhmuKt8wt8XjO53GAeOub+WQmeK0ZUWkaRzAEja90bbMjy7qX8QCXKOegu67zWfZtAdQOd2TQUqw==","signatures":[{"sig":"MEQCIG4Kc/moKlfvC09vLyAENPFNR4ZBG1h7+D1YlArqkYjqAiAkrRAxcBjsfnjaW9/ZJqsGJaobfQP9CVSziJKxqZHb+g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9ce5CRA9TVsSAnZWagAAVngP/1yg0xKQbhSPjxrJdi+7\nHp28/yDH8aldAQ6dws09H9G5mVERDmIGWAhvI/QnuPwt8lcFbwkSiY3Fr+dR\n9YnCCSAdlgobNAZGO807kLpK5JaXmjLU6DGTbXjRwQ2s/eYmgOxJpSZpz7ef\n4lkbJhhFI4PNIPa6PvcHLGvtLZ/EkjnNZ1ry07Sc+5ARAhh9ii6WIN3a8JYu\nB+sULRggOJ5NIpShhrYptvIBl+kiFICGsD2HLvfAjCJ5/Blq2eLyqYLiiu8B\ni8LTmpwcM8Gd593NF0lFRzH3UocwZaJwUDsR51QJg5SH3//IDoWBYcc3vMkF\nLOB7rhO6DujzSWhO3EXNNOE/NDAF178Ygo/Ca6cDjlwi6LWNgfFjLg3GXt3P\n0KQPMy8pypRx2kOwgFXob6e/QGz7pbXQxoakN32YXSQpHN39K2Fg885RjX8r\nkpmU6wfJjupRlvbqy13G4hUYEVPQCSpQTQdQ9usXrS2IMS7wCh/vblKg0XxM\n3z7m4ei853VEX2FwLt87vDaV9rSZ5P3JmcEKESNOyx7wQXdGYDtZaFv2AW3F\nLXkviFj4U2VHhhBeeyeaELH70NUapSwje/kEZ3SKkDMz9MNYYweEu4vgFSqD\ntNdl5pHN+PVjryX+mPpfp5PnBU7n5zHE4YNHiVbzEKjcGvPRqcs1dp8AMc2W\nOJ0q\r\n=MwMf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"77a8b2af56ebd184dae02df9198e75b16f4db385","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.38d1846cc.0","@material/rtl":"12.0.0-canary.38d1846cc.0","@material/base":"12.0.0-canary.38d1846cc.0","@material/shape":"12.0.0-canary.38d1846cc.0","@material/theme":"12.0.0-canary.38d1846cc.0","@material/animation":"12.0.0-canary.38d1846cc.0","@material/elevation":"12.0.0-canary.38d1846cc.0","@material/typography":"12.0.0-canary.38d1846cc.0","@material/feature-targeting":"12.0.0-canary.38d1846cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.38d1846cc.0_1626720185505_0.566998612547486","host":"s3://npm-registry-packages"}},"12.0.0-canary.3f691eccf.0":{"name":"@material/tooltip","version":"12.0.0-canary.3f691eccf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.3f691eccf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c6fb12707060de41b050a8ecc22a06b8ef0afdd7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.3f691eccf.0.tgz","fileCount":38,"integrity":"sha512-Vi7y9hJBj4gjwafY8+yE3ZY1uQ/OU85Mt0G3vcyI3zS4kUghdq8xFmXa8kMDXnGhlbHmfNIIIcJQKa7xue0M6g==","signatures":[{"sig":"MEUCIHKu9Z5Dr8EQjJEbKG8D6nTwVkRsLae2p9ORcwu092xgAiEA2D4lhRsA06SoZ7k1vdb/29EyAM7FIlBWGKfImujKF7A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9vVfCRA9TVsSAnZWagAAHnMP/jTO5fF+NO4+d9Bnj4Co\nVSIffDgOyzd/RlVHDGqjpIxgrr5DTksvw1BsGrTgXa5QzLYlWXnpwgYSpabV\nTdIU75HwtPFVwL4U6SPoxFOjq3LILdyf2ByutO6U8fs0urQB3ymeJX3r0BX6\nACa+0NMUab5KWInrmnLmQwIvDLRYNKVqGn+438u+FEa8oMey1Khosmn81Lx/\n+JNthaOPoLBHhog4v36rSFS3JjRXVuBgOaGKZrwJQOR6XM5gwF5+E/JPtVBP\nHwscr0LtDoBI2+H1mBbj4k3aXMCsJE0VBrOZHF6d4sCWrFxRt3ZlwEMEo7Cb\n8vNSJ/fLnJ8KiDUtn0d+hPel9KVcg/GwKDyGHSvjrHVID0EeFXlEEcZFzSw1\nbjrFg5HwaB6ShYO+eq53EjTt0hBKmHUazmd4hutsLs7nrg3kvf0Cr5tufJHL\nyzmnvJvamO7FMHJmicy+kqgUtNXncDdHDHKuBF3EnCbwYUtssQfBxsbiyDDx\nngH3SsuZQjovdEEUtsZqcXkvM5z035+e+GJIFStCC64pecrJmPfR8Lcu9+bs\n/Y+4v+t2chSHHSOhmsFq9QqLdOchQ43kBsrC7kFbUq19n/Oo5w/XZ4tfN2ox\ncdOPDHzjgY7MepwosRNlKtvhJ9RE+XNeosz1xeUGWpR8zR+h7PFdewfrV156\nMACq\r\n=PLIq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"58271219b83ef8db16c68153037e69345831b4cf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.3f691eccf.0","@material/rtl":"12.0.0-canary.3f691eccf.0","@material/base":"12.0.0-canary.3f691eccf.0","@material/shape":"12.0.0-canary.3f691eccf.0","@material/theme":"12.0.0-canary.3f691eccf.0","@material/animation":"12.0.0-canary.3f691eccf.0","@material/elevation":"12.0.0-canary.3f691eccf.0","@material/typography":"12.0.0-canary.3f691eccf.0","@material/feature-targeting":"12.0.0-canary.3f691eccf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.3f691eccf.0_1626797406966_0.30128064334063476","host":"s3://npm-registry-packages"}},"12.0.0-canary.ebb5c73bb.0":{"name":"@material/tooltip","version":"12.0.0-canary.ebb5c73bb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.ebb5c73bb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"56902f25f15b42aa355413780e5d8bbb51a163f3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.ebb5c73bb.0.tgz","fileCount":38,"integrity":"sha512-z6LXJ6/aCvZuUZ9nSUC+aoCIAW8po+u3R3H3kz6/EtN2Z5bls65C3Cpbd6+PzE2oQxzgrXXMwdboCeqcAoadqg==","signatures":[{"sig":"MEUCIQCKBXazVhpyLn8NjkEcdzI1KBdcg0rDD1sBUr9BOrNFOwIgHlxm5JdEsr6dISjRP6HMareH+RVqrypxBaUU7B6yFaA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9wCTCRA9TVsSAnZWagAAAioP/0TE8M4AOW7mUFOyc2/5\n1+dY6pFZ3Ow5+llTvRZ0t8KsPa2xktG5ISu/ap8bh+LhB7c5ywia9HDg3vHp\n97/Lvx/ReVKGsLV2TVGRniSakNhYCrgc4bDUfmlOYL7wrSrMouMH2EPSw+7e\nrqOCqQKw2qMpM6n0lCcrMJ7M4d3u/6sJv8AUKU2oP241rFUmSdyTEPramuf+\nAVmNdQH1edCqL12DGDcGJwtJoqq4ELF2tmd2iwqWs59Xj+PV2Ir0FhRgMF87\nvMznZQrsTkjmY8pCgz5MrXEhm6uVBrK86rR6o5pLKMy3UG63Wjmf7Nv8TE3u\n0ZRIO/76uXBqbSi4fIQQUrIhUl8LtdQbBi7v1WVK0iLaSNF5yalioA+sWZWd\n5LaIhojsCPdGyudeM4zKRPXcl3yB3j6dpSj3capIMbkealhn7IN+TMKCvYCK\n0VoYKm2q5k71bWJYTi07TJp7wddQtLTL/byfEEGlzgrxYDmvTRVrBBHyH5Bl\nce+rm6ur8V7Q7KSjE+zrGF1hyHnkNcMlqLZYES3JqnJPWd64KCkDDiqeCNVr\nOd1OR4h615T5ZRvz9A1h7Gn83C8Xe1n3bPz1Lcd5zUaj6bq4KJgCK1xRgub2\nwviryZlssw4Jodh4aWul1wHKR01lVMm7Y/G6Hra9eWLOsLbQcCznkdyqE5n5\nJPwG\r\n=SswP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b37a38f7ce62c0d87ebbb4bafa0f1fb02aedb050","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ebb5c73bb.0","@material/rtl":"12.0.0-canary.ebb5c73bb.0","@material/base":"12.0.0-canary.ebb5c73bb.0","@material/shape":"12.0.0-canary.ebb5c73bb.0","@material/theme":"12.0.0-canary.ebb5c73bb.0","@material/animation":"12.0.0-canary.ebb5c73bb.0","@material/elevation":"12.0.0-canary.ebb5c73bb.0","@material/typography":"12.0.0-canary.ebb5c73bb.0","@material/feature-targeting":"12.0.0-canary.ebb5c73bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.ebb5c73bb.0_1626800275477_0.8719238467291186","host":"s3://npm-registry-packages"}},"12.0.0-nightly.778a0e8a.0":{"name":"@material/tooltip","version":"12.0.0-nightly.778a0e8a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-nightly.778a0e8a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"29e0095dd06db5ddf68cd0bb33deb260a9d3ada7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-nightly.778a0e8a.0.tgz","fileCount":38,"integrity":"sha512-PipFkLUQWZLu0LeEBBmTsSjvgyGuzBPZ/vh/FHhBphMx/pWygodWqg0mOzWL4449Jg2lbnh6D3OvkA4MW6hQiQ==","signatures":[{"sig":"MEQCIErBoL+ys+4pqLacLNS11/VX9+BjBp16WZJUSCMGbiWTAiBaT2FTpyl39RXlXAMcOZoO3xJcl7CA9t9feGOsJuG7Yw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9zrXCRA9TVsSAnZWagAAVXsP/33W0yPmJ6H3Vo5DV9u4\nbmrZgrL3+NKFS4KbJdNlpHozj/2FIcp34OZGpeC/qBPD5lLQVurMnOj0IyMF\nF+2AxQkN9kZMaFx19L4Wu8ShSNuMcT0GiICWiwRIjYmmepigH8W6RmYeqwHu\nKmShbD1J0ToUpXvrnGzaP4VJqhgSoeWRO8F1+mJ7PN1PK2Z/YrNuvRFTHQKD\naowkofEViZs7GSJR3rOCABAfjJGjGn9YfL0sal/qpQzVXD5kuW1nA6RkLsqq\ngn7qIH4Y+Nb0aTfRZg5SmUGXhQQzwybrlr4WZrfIDjyRHVsxTLB3QOubnTmH\neM2bd/VIXZlV2JNX8R8dfwFNT5eRhy7jI4Q+Jf3dUJjgI2IDP1tCEOBxxJf2\nLpE7roLGQCl0y7HFoniQ9Gx/KYZahq5yUz1X3bOvqltK6/yqDyklnd0s+7PK\nPbdBsTOD/2HQmnUJXamjDNMKlnpY3NY2xrOfzvyeZyKSWbU+jQPIhptcEkfd\nU2JRb/ACY9whVGHHNCJmV77GX14sLslTOVIVtQMBnU7yuIELQd/PKT/VfUqu\nW4hCv4a+1Gsodb2UAa6b1WFusNeyI/SYe2KTadeEdlpxQiSyCk+J0YNynMtu\nAN0Kp+PhzDtl6AAjTn9rw3OKDT84Xwz5C9T4bwQ3DiDhezm6BaZdq1avihJI\n+ndZ\r\n=aF7J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"d86234d661f09ad766ffa2f82c69582e585a8fdd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-nightly.778a0e8a.0","@material/rtl":"12.0.0-nightly.778a0e8a.0","@material/base":"12.0.0-nightly.778a0e8a.0","@material/shape":"12.0.0-nightly.778a0e8a.0","@material/theme":"12.0.0-nightly.778a0e8a.0","@material/animation":"12.0.0-nightly.778a0e8a.0","@material/elevation":"12.0.0-nightly.778a0e8a.0","@material/typography":"12.0.0-nightly.778a0e8a.0","@material/feature-targeting":"12.0.0-nightly.778a0e8a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-nightly.778a0e8a.0_1626815191686_0.806211069729674","host":"s3://npm-registry-packages"}},"12.0.0-canary.791311bba.0":{"name":"@material/tooltip","version":"12.0.0-canary.791311bba.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.791311bba.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12cb4e117fef1576e57014fe470602416c92b6e6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.791311bba.0.tgz","fileCount":38,"integrity":"sha512-ZIWIiMad1bMKiHV3G4QaMeNGJNZJXNYWlcc6yohxypO7G3EDQJp1/tGscMSKQb/1B44iN2wv9VSxj0jMQyDw8g==","signatures":[{"sig":"MEUCIHyv52FLkS6ZxB1qhyWQCg228q7JLaw4WCgYPmACVoIWAiEA5YVAq4wyjQ8IDkEIDjZ2Vbgn0Rg1MekfzEyZzMAN6k0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg90ljCRA9TVsSAnZWagAAQaoQAJuPTTtpmOK2jahjwZ7s\n0XblbOTtcVVMV/BTydxPABtIodcoCY1erdqR0vvCjJ0+upX+DOiElLo3PyQE\nYRaBEWvaINn9KjtEANItqj0H1nXvhywrFyOMaC/HZ2TUvMcBgdFdkxPAieZl\nsXgNwbpc40H+eILYIh+xGCEf9OQDgC7xhkUv7WSi20DQIMh/P0HSmClu5IZH\nOsTlAt77QlIprjdJK0v7Hh+yTJCMmQeqZ9SVzrBDHqQVYxnybSbf5Xdm3Dqn\nk1eSBfu7rG5X9zaLVX+cdFaOOe2RILFcRSkiRTTbxYpkNVrAj5yeEqz7Tv1e\ngnbVqOcvuy48lB73O/uEP5eL6h/XSxwGmDLciOm8Mj/WiQ4bs8Y7pRi8zgeS\nPwA6byeAxO3U6VMKUYuNBrNKCTXc+ZQgE1yXDlpZIFnmkN/cPyO3XzciYkAu\nkshKCarg9zIh3Ox0JVZzBjOGhtLXq4NI9rGl6ihj6rgbXKHZxtjyCMzX7ocu\nl5tBSGVK+Da8c6nBYLWOSZTkgRxilJuvgvA07NEXctGeY65L2CqMigb2IZkj\nvHFLNFgI4pc96Cx8+KCCB7YqoxGgTpjAEH6z2tn5u0Fq4nNJI3XfB4Eg8HPk\nIOMLaRrLiuE4mNB0VeYkUogYbTIslioNomE9v0qMZf0LPfuE9RZgr1a9PVdI\nDvYl\r\n=wi05\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b915b82632a30b60ae4dca5d12fc23d5a5df4d4a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.791311bba.0","@material/rtl":"12.0.0-canary.791311bba.0","@material/base":"12.0.0-canary.791311bba.0","@material/shape":"12.0.0-canary.791311bba.0","@material/theme":"12.0.0-canary.791311bba.0","@material/animation":"12.0.0-canary.791311bba.0","@material/elevation":"12.0.0-canary.791311bba.0","@material/typography":"12.0.0-canary.791311bba.0","@material/feature-targeting":"12.0.0-canary.791311bba.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.791311bba.0_1626818915468_0.7261997242370966","host":"s3://npm-registry-packages"}},"12.0.0-canary.85e9a6ac3.0":{"name":"@material/tooltip","version":"12.0.0-canary.85e9a6ac3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.85e9a6ac3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"10ab0b7fa6c1b3cee4d1d99d1ef4234e8324e3ec","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.85e9a6ac3.0.tgz","fileCount":38,"integrity":"sha512-GBUTepGcyI6Y0C4LusNm1xCK1XSzg3WMi9UKLj9JukWalW01dSdQSzZ3y/3ZAjuxCBOo6wLDpWZascfmpc4C0w==","signatures":[{"sig":"MEYCIQCkOnZpnT/7CQkCBB/b38cAie+azjyFHnfNDkvsNtVw9gIhAOTa8Z+JPYwpfsP8BGG9n2QwV8AF7GrjdONoDyUfsdOc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+D8hCRA9TVsSAnZWagAAUJQP/ApJt83w6+fSt16xAhnj\nBLOKI2er4sXTf6eUImDFfvhuZ3nHuSQLM3eb0PiIJ1udHVzF+J/+Oprz2G+U\nbJNTvW00Kxc3vJSZpTZ6yQwAIMs3ODI8MK35/jSTxVtJH0/BTvYElCxmcZp8\nUMyKGu2TyWgz4m3PSMh0j4TqYOZF2CEfZxEfGxjkuePN2XbThZY1VjquNqbh\nmb4l/CcRc/UI8W/adfO6n4rSr9Od/A4Qp1EDMwXVsghuOjIlisO/SLhZPAT/\nlWFPwSPUzkG759DHUdOahwt2lbJRasmMWWOHXBee4bt1odULfcW51mjoFf9u\ndPqhClvVtJ1+sEVrl+MeiKq5LJplMyH412tLW0CBBw+V04OJX1NkygdcZlmV\ntSoG+ofWSdsZ2i7Dxgu7awZd1idjF4V0jNvZilBZF8Ki+rY/ELEPkIOCz/fF\niFhMWt4/g3CXq47h24COiXKgGYZMvh6BHTPS8G8E8aXzApgo8F5iIpApgQoo\nCSJQ7VNCRQZIwef7BvWWFkOed6ib37RBKRXhD6Lz9LDjTdHB72uRFvFnwdBR\nwVNZBiU3yAN0clxRW/LAsiv9GHlxpvfDjADxJJdfcufNATGkYZH9VZA3YV7v\nL623k0L2NYNkCVP0Ec6PYTnyIZbDzSdAXIsmOIspW/c4A+nFK2Oa/iGB+GEe\nc2Od\r\n=d8ai\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"651354325ad21ac082f791ec2abb0aa32b3ba936","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.85e9a6ac3.0","@material/rtl":"12.0.0-canary.85e9a6ac3.0","@material/base":"12.0.0-canary.85e9a6ac3.0","@material/shape":"12.0.0-canary.85e9a6ac3.0","@material/theme":"12.0.0-canary.85e9a6ac3.0","@material/animation":"12.0.0-canary.85e9a6ac3.0","@material/elevation":"12.0.0-canary.85e9a6ac3.0","@material/typography":"12.0.0-canary.85e9a6ac3.0","@material/feature-targeting":"12.0.0-canary.85e9a6ac3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.85e9a6ac3.0_1626881825590_0.9901440592165784","host":"s3://npm-registry-packages"}},"12.0.0-canary.6b0442278.0":{"name":"@material/tooltip","version":"12.0.0-canary.6b0442278.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.6b0442278.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c94aa362e8577bb23a01f5efc083747c3059930","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.6b0442278.0.tgz","fileCount":38,"integrity":"sha512-0M0tGx+lBROocp6phhF4P0O4OyiZV9qs8jnV4Zmpby5VY/2zVLGJyOiCpdBLZVrnHukklT23zelr+NJA5Rkbug==","signatures":[{"sig":"MEUCIG+yEOxKjf0xotdS1l34t1O88D4MMNwAuf2jkZvmCvqYAiEA8xqhujszIA3LAQkbklp+tJc562G/TwimsVufDYBAHhs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+GyRCRA9TVsSAnZWagAAKHMP/0+CcBzsGT318BQvsqXy\n12gxQNSTckp8i34Mf6Vgp/2GYK2fs7nFvfyfe0f3ewOVLv7/8rIXegM2tB0K\n1S6fVQRUxme0RsAzMqrT00DKzrw0HQop0fEkjfr1f8OBnl8zZByt6IQHq7nW\nGrcHSWiGkT2sUHHXClVEDqqrTTepKFCdIYz+pmuKlKQgTNsv/RzTKxGJXR7v\nDjZL2mgWNaH63n+/JbDObdYHr6GXTKqxK37an5TbMY1zOTZujMGICz08O6ro\nsvYeTzcV7r7DuZCqKMa3ijsrlep1tyc+g3xb873QjBHhVkWthFXv3qynrhmY\n2+TAgEy9b0uPkNA3F+YQAfBQY6kWzJ97NXhoGDXVO065h56qWtg88i8Q/+sM\nmeyPDZyfhSUifjrxdbZHe6/NGxg8s/AProovu22PE3KDZZ3ihC2Icvf9cwIl\nup/JGpibnN2sj8/Z5efh5wWzgUk8ljAyrt0oEvlJ/2+ctAmMX9sYuemykjPn\nnnM8kxfNPxXxhtyi03tA6kZk6D3Yf4sJknTySV9Nk07458ibt2Y8TojZkjwf\nh9AEWCb9nCz3uo2EH9m8ir9FLVuHvigWFX6o5Ubds7xiClte7drzVvyIg4eE\n0MsttkjO4JuF7pyzqy4LShdgiobSSGpqE/0HimqS6vEkns1X22aIDOb7Op9s\nn8vU\r\n=GOez\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"fefa69e22f9083ed30aa4ea05114191682b45a14","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.6b0442278.0","@material/rtl":"12.0.0-canary.6b0442278.0","@material/base":"12.0.0-canary.6b0442278.0","@material/shape":"12.0.0-canary.6b0442278.0","@material/theme":"12.0.0-canary.6b0442278.0","@material/animation":"12.0.0-canary.6b0442278.0","@material/elevation":"12.0.0-canary.6b0442278.0","@material/typography":"12.0.0-canary.6b0442278.0","@material/feature-targeting":"12.0.0-canary.6b0442278.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.6b0442278.0_1626893457020_0.8824915719420814","host":"s3://npm-registry-packages"}},"12.0.0-canary.5f00e454a.0":{"name":"@material/tooltip","version":"12.0.0-canary.5f00e454a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.5f00e454a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"735b434978435835451ad6231ba2a1517f5d07f9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.5f00e454a.0.tgz","fileCount":38,"integrity":"sha512-qKfuHjWT2Vwxp6MFZUxp7SHCeozLgMikpf7F6QnYkMCTjg+7NmlZzApHhrmgCxewY6l4EBv6UUS3tfdP6FxkwA==","signatures":[{"sig":"MEYCIQD0/PFHY9gYbU+iLqZKN7JUQdKgBImwrnoUciC1pxQxIQIhAINT5bLIHS34Z26mrLr1LfMecb6hpev88jRhYFOgsjxB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+aXOCRA9TVsSAnZWagAAgAQQAKMLGpZl8xT6EmSnx/eR\nMQtI6iUj9P794QUyOEntzQ71idCMiKrTQBb5nsdFXy3ikziFpPIC1y/L1Cm7\nm9P7oB9prriApw0yeC+g4kVrq+XCNtXisjsKA3EQ9dQpLHaAynW03pqeWqy5\no/wHF0jXaJQFBx13D3Nt1RStBdSbwT+tBptuGSZweKcakJ6ZmwoYiCC7k/65\n5/U06jI+6A4brYiaezJ07LoLVc06qL0iEvn62/GzTTuRRLaKONzwinGdBSpo\niIHfe9qQ1jq/noshn2H3G6hpwqlnavtUutQdgex5ooq4RMA4WvPIB/aN+J1X\ny0dn2f6YhuEMJ2IAM6JmXHqXd+Vff3Eguk0ND2NBzVHBxx5NGIi6z9zTSvsZ\n4TpvAx4Cj0etwfE1RS3pXy4BorTDy+ZogGSYdZX8d2WvVNFddsqcft9D1/L6\n5ECbJQk4S/ca1CXFBMk9ntcdM0SkCUuR8bqrNtY3AlsZDZ1BuzNuwOlhGz/9\nKzg60l6C808/gFBmA6wcUo0Ieb5oOjLFaEECei3p8C5ICKj5MimX66SbpYBp\n6B76bfk6gNDHXOQy5aIgOw2KcqFacpGhERsyimetmbA5twb9INRTGEJQDJtQ\nwKawRhIidHDOkSc1hmqYntE5cp3KbzpU6PdsHoyFbmCe6WZ/+FLn+7YnfhnO\nKrro\r\n=beSL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"b9c8a5899d6bb5475fc5fb2c76a300d4a28f0ffe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.5f00e454a.0","@material/rtl":"12.0.0-canary.5f00e454a.0","@material/base":"12.0.0-canary.5f00e454a.0","@material/shape":"12.0.0-canary.5f00e454a.0","@material/theme":"12.0.0-canary.5f00e454a.0","@material/animation":"12.0.0-canary.5f00e454a.0","@material/elevation":"12.0.0-canary.5f00e454a.0","@material/typography":"12.0.0-canary.5f00e454a.0","@material/feature-targeting":"12.0.0-canary.5f00e454a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.5f00e454a.0_1626973646543_0.8229278789931174","host":"s3://npm-registry-packages"}},"12.0.0-canary.90e08fc6b.0":{"name":"@material/tooltip","version":"12.0.0-canary.90e08fc6b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.90e08fc6b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1d01adae4766ea2b13da4fb8ea63caf16602bd14","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.90e08fc6b.0.tgz","fileCount":38,"integrity":"sha512-8pCBhfk/mP1NbnpBW4OVytVTNTNVbDnPTXqZeKbnbND/tixU7lZOW7WplofbSCapLNOqfe9maO+uFiixK5ULmQ==","signatures":[{"sig":"MEQCIG0reBVC4xU8C1YYdsBabQJYfJJADIorZC4W5eZtxfrsAiAw7HS3qCG/YcVxLPjzU4Pd8mKRedTTTatz9BHMafvjPA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":816347,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+gGkCRA9TVsSAnZWagAAjsYP/1UiYWKHD0XHAmRz72S1\nT+iXXCGzXgAWDfw7u2xkiEGe9aigqwmFY+qQ5X91Yp88jEiQcUoHddbeQ04d\nAb+7PsrcNHX8XNSKOPHpKVvAI8q+Zbv4vX2qgga5OJBiooF/M+u2maJ+dBCY\nLcRvNRtIF3ZGbsEq7bjmgNVjZPPcq8e+LfRNibemuGbfFSsUSPeB94v/j5Ev\n14MCVHDguceR+Uf1abvJBpVyqIJiqTgUkmEUdhhUfEI0WS10aGe6PmW+0KwL\neLe1Qzg2l9LRRmeow+nAzxSTAPoenpMQomzTkha+QGXig2eIsV/8IUeSmeCX\nG/fAQL9N+MNZQjnCpIYL9Gtsh+NDFEYv+gABM+ExMuxK7I5fOso69Ag+1bQI\na+C8weSRy6LVoYlRFngS6CjZWMuZ7oRmesIpAtx6XCTynXGCky9tbJglKa3D\nHVTCE64IrPXiYsH5pQO+QXEe3wrGh37vc4oy8nVYbcyMoYA473pWOIISrtn1\nzqBmBOorRLVzeQAWaxlGnRWjApnZ375/DVp6PK8E2xPqkjdcphnMiaHbe6+r\nrDSh/TTkcoNB6K+cTYfM7KAWHrNyXTHHM7wrDCftCzDKRGt0bd/FV/sLOwYA\n/jxrHdXgg307o0kL9CCiLxwQtcSUJXq+zzUPLqzfvV2ycmdtcVmbeb7r4dWI\nyusb\r\n=JjUl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an element.\n\n**Contents**\n\n* [Using tooltips](#using-tooltips)\n* [Tooltips](#tooltips)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element, such as a\ndescription of its function. Tooltips should include only short, descriptive\ntext and avoid restating visible UI text.\n\nCommon use cases include:\n\n* Displaying full text that has been truncated\n* Identifying a UI affordance\n* Describing differences between similar elements\n* Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n* Guidance on a particular section of the page or object\n* Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n 1. [Plain Tooltips](#plain-tooltips)\n 1. [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath\nthe anchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated tooltip)\ndesignates an element as being the anchor element for a particular tooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element.\nWhen shown, they remain visible when users focus/hover over the contents of the\nrich tooltip, as well as when users hover outside of the anchor element or the\ntooltip contents. However, they become hidden when the users focus outside of\nthe anchor element or the tooltip contents. If the user clicks within the\ncontents of the tooltip, the tooltip remains shown. If the user clicks outside\nthe contents of the tooltip, the tooltip will be hidden. It is recommended that\npersistent rich tooltips are not added to anchor elements that already have\nan click action; the click action for the anchor element should be used solely\nto toggle the visibility of the rich tooltip.\n\n#### Rich tooltip example\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and\na second time from the tooltip). Note that rich tooltips with interactive\ncontent already use `data-tooltip-id` instead of `aria-describedby`, and so no\nchange is necessary for this variant of tooltip.\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an anchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor element (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Tooltip for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and [MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of tooltip foundation APIs.\n","gitHead":"267e307e557cdce4bda13e55c34cb0d1aa0d0b8f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.90e08fc6b.0","@material/rtl":"12.0.0-canary.90e08fc6b.0","@material/base":"12.0.0-canary.90e08fc6b.0","@material/shape":"12.0.0-canary.90e08fc6b.0","@material/theme":"12.0.0-canary.90e08fc6b.0","@material/animation":"12.0.0-canary.90e08fc6b.0","@material/elevation":"12.0.0-canary.90e08fc6b.0","@material/typography":"12.0.0-canary.90e08fc6b.0","@material/feature-targeting":"12.0.0-canary.90e08fc6b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.90e08fc6b.0_1626997156262_0.6699629805978935","host":"s3://npm-registry-packages"}},"12.0.0-canary.cf5b9eb86.0":{"name":"@material/tooltip","version":"12.0.0-canary.cf5b9eb86.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.cf5b9eb86.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"85e01a12a094ecc1e76bd640451a51709db95f8c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.cf5b9eb86.0.tgz","fileCount":38,"integrity":"sha512-WcZOR4R+VBsXsGY+rv/qrwIN/r3J2EBudrTVL0baHDbbNPCIPmzyBhEZaenC/XziciarjcQpwiwAilTszsIrjA==","signatures":[{"sig":"MEQCIQDTW4f9CiFuWlu0kITE3EKvCim33kcv82zZALaL9x6ddAIffxYeb9rWszLe0CmxjDYVgs2PfwcHbKQb7upEg8LO8Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":817343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+wa7CRA9TVsSAnZWagAA65gP/RwRDAxzr8yesHXgMczt\nqY3xiCeFkl1RF/sNaEkBlNzhcNbX6wDbUZRibfmSdC2PB31Rh3UG/mQ1kFx0\nTk2gYSH6ZXPzTKjOUxTXwIY77Z+fgXGvGP8DrIRZR3pfYeR0+K72Z9k6sPHx\nnsfUqFbra3mZpqDzoyMlA93iHVOXxa1KTIq687cDYlG7VXVY/Yt7j0nUBeSV\nNfTo8zFHsKTg8UBhe9qpF1+klWPxJbweUlDQ9lX05xOaYT1FeY99q+p/ap4Z\nCMR3yxeTczdghHIk/84tHnWiL4/JewEP7v67dEEiqVSyTKdbZpSFpOE+cElT\nN8sRN6DdJIbK4HgeOHYH65v48wzbpWTVUo7Ys5Wzs0rIq/cDZ9Uzi5aUTW6U\nEBSI8/GCoTyOhlFeuq77fJGVM8r37KFT0eEBr61uc/G3N3MWemMbIt2bSaWw\nG/Y9aX28NkPMSifB7VuK9Coy4wn4pqIAULb01k2TgYIuQ/1kI4Tu3BcfxxBT\nLG8cAL3YSspnO2yCOta3LBMOzsQAjxf5mmX0ZgXY5MxbDjvWXL0pa5KqD59f\nvgoMU4GP50sQ+MiNZcMabdnPmUIQFsA+JV6s9euDHLly0cxGUsNpnCLlGvTQ\naTgfH8TjCuvKxH7a1OwQ8KevU8H3GAHe2oFCuQNtaKgIiajTPVq7/s2q8G3L\niK1b\r\n=SumL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8447b42cdc88335a4d5a37bb048f5babc1c5bc82","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.cf5b9eb86.0","@material/rtl":"12.0.0-canary.cf5b9eb86.0","@material/base":"12.0.0-canary.cf5b9eb86.0","@material/shape":"12.0.0-canary.cf5b9eb86.0","@material/theme":"12.0.0-canary.cf5b9eb86.0","@material/animation":"12.0.0-canary.cf5b9eb86.0","@material/elevation":"12.0.0-canary.cf5b9eb86.0","@material/typography":"12.0.0-canary.cf5b9eb86.0","@material/feature-targeting":"12.0.0-canary.cf5b9eb86.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.cf5b9eb86.0_1627063995427_0.5398974085185713","host":"s3://npm-registry-packages"}},"12.0.0-canary.3f36ac75c.0":{"name":"@material/tooltip","version":"12.0.0-canary.3f36ac75c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.3f36ac75c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"abc9ae8620a31e3691a7a4befbd96b53f345d034","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.3f36ac75c.0.tgz","fileCount":38,"integrity":"sha512-QQ98QPImitT//DQLmnaVYAAj7ZzdB0g01z3Y17O5y+1YGx1TMSge22lF6qTNqm5pC+xt1l7rshGlKJpIb/VfJQ==","signatures":[{"sig":"MEUCIF2OUzvDTCeMxvxzULbD+VJ7MRunxUsQqW7MSqgaXQVOAiEAvnMEJRCjy/odAG5Eo4gLUE94u+k7MN9UNtb4te0Tlcs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":817343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+wtpCRA9TVsSAnZWagAAKicP/AwPLlmYd7uc16SaUv6S\nk87U3t17FhT+n1mHty3r3KX1NV4J5k/sV//+TYrynrq2RsRGHJtv2SdzyGeb\n9gcYNEx8jTuwT6ktRvKKb0JVsUeTL3PxGuKyURKeyWraZyOrNqoZgguZ4E3W\nrsKZItgQ8qiHq85XDYxzyBosDaIOpY5gN0Djpw3gmpTmP9t+ZYUqOj7zLLXr\nFXaviIWkgCwso9SJBUUFIhfyBkxhFb/WXslRDYBA2XRITQTkUgz24x/K8iZr\n2v1tIXx1O+pJn3UN5ZyHHqSfkwLzclFmYPPQ7coPUs5wT98sHr99v2mqBda8\nqYJmOfBadgZEfmx28BliUfPMiGdhqnVFr2oR8cAnbhfNRrMz8ieXB9n8T/Yu\nVrId/FhIuZTXvsTeTMgl4k1BsKixNkLH2ldJmISrEvGHOGBoQvzvsjM1VFCQ\nfvUdeQc8P89JzTuu2qNp8LZEHLpYsPbnHik75MFNcEr8PoQJC/OSQn5YosGJ\n1k+AZlvW87TEucr1KbZlvJm7o1E//N2M7LAMFL2oLKRRG/qpxcgJwQ4g4+rI\nOVS19SNl7CzcVs19aC2g3yWaP5g67t0xsiRcpeSXWK0uTO/GQ8L0fAvL5RS/\n0b8K76gO/8Ep4Ts1jhZ0FgoNcl0K7IiYHhUS5vMfKqm0DCkmMtykEeKfiIdx\nqzXL\r\n=ZpvH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b0f70c5fff2a6f188b24beae7ecdf708b5bbdcb4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.3f36ac75c.0","@material/rtl":"12.0.0-canary.3f36ac75c.0","@material/base":"12.0.0-canary.3f36ac75c.0","@material/shape":"12.0.0-canary.3f36ac75c.0","@material/theme":"12.0.0-canary.3f36ac75c.0","@material/animation":"12.0.0-canary.3f36ac75c.0","@material/elevation":"12.0.0-canary.3f36ac75c.0","@material/typography":"12.0.0-canary.3f36ac75c.0","@material/feature-targeting":"12.0.0-canary.3f36ac75c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.3f36ac75c.0_1627065193549_0.821903043645343","host":"s3://npm-registry-packages"}},"12.0.0-canary.ea1e1b850.0":{"name":"@material/tooltip","version":"12.0.0-canary.ea1e1b850.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.ea1e1b850.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6087fa6a502bc4ae3b2215e7c0483718bafbc765","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.ea1e1b850.0.tgz","fileCount":38,"integrity":"sha512-+gtllpSzKfUBZNKADSo+lmE8ZSpPWBWMrIL8JllibvkyW1j1BVF9+NIWQ3+4mAVjKdRvrPxarbvG9g4TTCU8zA==","signatures":[{"sig":"MEQCIBf3lQdOxQk2ROhPgSqcScx565RubSMszSvCOWR72oWqAiAZUhauss5qt4IWSwNQQGaPAovAJTY5uM9+eSySk9K4Gw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":817343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/H6QCRA9TVsSAnZWagAAVQQP/1HeYhcMSuUQYH6u442p\nHcrN2gHvPOjswLz9g3r2WYDHncMdJRzTLgn/WJQuQIB3PQQJ3AYXz7yzhF2l\naGT9a0bagnsNrgmef24eHw02FyWsHNDlrk2Mppcu0XwXnj5oZIYdqOEsHlZr\n9pe7iz7QOacZjrON4Nzv6G4pZ/OYo6nh64I8l/vsixNH8xsvnTCG5NeBXI12\nh4DGK2Rok36/MFtFAmkuTD7hEliWYNVP6/Szg+Q4b3ILvUM6KuZuyjPISnXv\nyiJXft/F8Kk1jF53hMyqLE5XMEyAUBBIbabJLiRQKdE1UUR+B3e9pwP/0Hl3\nm31/JdK7l+XpBVFVt3tWYtYwc164whM4G21N97Y1PFPcxUotV6HIe5dNrZg5\naC4CKBU6CVoASvHTL2jTUIiJQvfkUfiPBLXh0vFfamQ0kK9hS3a4SWkK+Q1o\nMei/Ql3k3kn34fVnkadFm9Fy+WDFQkuknUhe93QMgMZd+VvyoGlD6E4eoDAq\nd1qrX7auulCmCvQYFX0AxKS3FVOOal+E2deXz/07p67UpvH+0h10DYr9EfM9\nUBQvKaPxx7D++5PGR0zHesCOpV97pKapyzPghN2+2QlwifVTzW8lBK8fyvZU\nwmJxgt2mQmhK0Fu2iWDhO4drcXHyXHyG55m2hEf3+c64m20T3XOsC7CdTQRj\nbLX4\r\n=r0mu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7c296c6f9b2c20eb32b0501c98b6415bd193dc46","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.ea1e1b850.0","@material/rtl":"12.0.0-canary.ea1e1b850.0","@material/base":"12.0.0-canary.ea1e1b850.0","@material/shape":"12.0.0-canary.ea1e1b850.0","@material/theme":"12.0.0-canary.ea1e1b850.0","@material/animation":"12.0.0-canary.ea1e1b850.0","@material/elevation":"12.0.0-canary.ea1e1b850.0","@material/typography":"12.0.0-canary.ea1e1b850.0","@material/feature-targeting":"12.0.0-canary.ea1e1b850.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.ea1e1b850.0_1627160208820_0.6260284432669692","host":"s3://npm-registry-packages"}},"12.0.0-canary.22f390c43.0":{"name":"@material/tooltip","version":"12.0.0-canary.22f390c43.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0-canary.22f390c43.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ce47b3a099a143a9c3aefa36d8b8d3538d2fbef","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0-canary.22f390c43.0.tgz","fileCount":38,"integrity":"sha512-TxXslfbbP9qD3HiPoiqV4GfbJua2J+4CRklsDVyc3YZFOHGoddz9tU9vv0b+ll7t4JgevGHsYyqJjTMg+a1aGg==","signatures":[{"sig":"MEYCIQDbdsamTiqFXE+yGiWpaAiyjFrg7M0JgqknxB79EmRsIAIhAKfQd8Ftgiw3ZiiJkaDbmalkV8UrS+SWeauvi4HwSFPD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":817343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAFfoCRA9TVsSAnZWagAAnMkP/2g39ehSLEvzLe1ywQEs\n4xQ3wX+cUy9k2viuf5x1koHUOrhmnz5gYRi2fyLkNxXKu/6j8eUfSVdq6PVi\nEAKLtCBEic6wWeHdu5rfZqIIII63b9hip10QvLxNK4JyKegsQPfCklKME3dS\nKWo/Fdee21+1gY6R5YBcks61iBuNXXgVok9SAnWGNvoLe+tneyZJnN7+r5UT\n2ZllMVmdrX3/RoC4C29wMfO4hgzasI49g9LmzlLh60z+/4oMWRSXqXc6HmK/\nMQoGvjf2/k9zEezV2tYmjJWcvDS1ihahuJnTb2kO+3wAXqphHNFDJ4eSt8Hh\neV8LNWkU/PXY/fewBrtQz2yIEezmBbWK7mXegbau7NNMIxk38wQPf6sIVHoY\nD5I43JsxQTJ8z1RqsvzHJoMYc8qFKfL4ZaeOw8EUweA+Ry+lnPdqITgXWi9w\neJsS5jyUBGpgJswSZpxGqlFJAtYgJckX3Di/4ehaEBSVtSPwdYur+D2oeOMU\n2FkZLFBNdjy83iATQuRM34H1Xgydlruhe7J1Z1HWD6wr4P8BpiYYzbr0rzYy\ncvz6dooESFRFJfIWcvESV/LGeOeOZ3LGxDWbvab3gMO1jpFxsR5fcBjOyNyS\nw5rKbfAxtZgBEWj3bOL99c7brJx4SxR1Fqh7NUsoopJMqyt+aL8B40fCSTk+\nly68\r\n=fSQw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2eba31ea1c3ae3c0e3497f3dae6cde368675a496","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"12.0.0-canary.22f390c43.0","@material/rtl":"12.0.0-canary.22f390c43.0","@material/base":"12.0.0-canary.22f390c43.0","@material/shape":"12.0.0-canary.22f390c43.0","@material/theme":"12.0.0-canary.22f390c43.0","@material/animation":"12.0.0-canary.22f390c43.0","@material/elevation":"12.0.0-canary.22f390c43.0","@material/typography":"12.0.0-canary.22f390c43.0","@material/feature-targeting":"12.0.0-canary.22f390c43.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0-canary.22f390c43.0_1627412455885_0.026204292502156612","host":"s3://npm-registry-packages"}},"12.0.0":{"name":"@material/tooltip","version":"12.0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@12.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d74383b42cc6eb489bfe4b09ba1062a19e8e2f1f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-12.0.0.tgz","fileCount":37,"integrity":"sha512-YpXlidnWbymm5WdbteU4dSb+hdRMCrgsn1gO6xZ2HXfyiKX+2oqWvMZoSHMnCEc7oUvQteKybKrtD94T7CUeoA==","signatures":[{"sig":"MEUCIHoDNqqbGuXqnOaY9DR+TcY5EP22X6GmmseW3YZnRNlDAiEAiwx5cTIbqxsSkMRAuizhvQH51O12tcP6GWx2j11ib4w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAGOnCRA9TVsSAnZWagAAZasP/0NLayhH3bdyedvql7Tg\nGQhZipYCHcovxUz5I2M5lB75W/yU/rr38u38dnZzxzVR7WaUhdfsA8ixouiu\nBa1ELWmIiYcCYlKnHV4T0UnR5pb1+z9gsHHUOzcM97PIzu792snRmazspYGc\n2hOwvXFFVSLBV13bwIsyy5udvtfDEP93QLdKo8a4LO+ewZT168qNiLLtgsLV\n90dv42IXIEMACjbcWXdIDQbVUnwhwZPe7aQVkVi2sBWp7k3dRM8dlOAcEFid\nExWgaezPLAEF4VwQqTULGH3c7fCxQjixkHAiXKivXdNz2oSEr/zSwvy5DnJV\nZEpZCUVkcGU7Y+H4RXUnNcDNN7NkaMSu7KR77syp8lO4l6fHMzhZkb96jtrl\nVPjmlgTHnVuITtayFewROYaW9hez9teAUogXbzGlFhzq9zL4V0slxRcim2su\nywiayTnNLaSaUwoFNila5awNsJxTFRboHlQxRrYL38hENENQ4uWL5KsOdGnj\nB036U2OYbuNqTqbrBxdX47A9EKV+/RuRsM7elK1GugBVgcj9OGxqAu1IYwqq\nPDvgIFoauHJfTdVP1rSs9tVuJ0ZUseWNwlXmuXzCv5BBLryvtwLgRswOh6Jv\nV8HXEjQMvHB7Q6Irkm0MICZIy8+63/f30RFmT/MSdxtWHGvzeSCaaYMgipZO\n/0op\r\n=/D/V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","gitHead":"ae85f7eba0d72f4fa5f3e8669cd316336b3e6828","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"^12.0.0","@material/rtl":"^12.0.0","@material/base":"^12.0.0","@material/shape":"^12.0.0","@material/theme":"^12.0.0","@material/animation":"^12.0.0","@material/elevation":"^12.0.0","@material/typography":"^12.0.0","@material/feature-targeting":"^12.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tooltip_12.0.0_1627415463053_0.6843224275498716","host":"s3://npm-registry-packages"}},"13.0.0-canary.ae85f7eba.0":{"name":"@material/tooltip","version":"13.0.0-canary.ae85f7eba.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.ae85f7eba.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"daca4482b5c9acf5b26aacab27bc8af8765d5008","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.ae85f7eba.0.tgz","fileCount":38,"integrity":"sha512-FLb0fCUELXcqhK8MHc+3EPxN7OXr7pReAtiE9CfrIRJZZAVwPb3vc6OWSeYmmH1SeKomwQUa+yEt/n0SzLVT1Q==","signatures":[{"sig":"MEUCIHMEndzmPtRAr6mM5usL07U3btsLqXSxeUAN3XMV2ZDdAiEA2aZbc5oc1PhFvhxCvlUia9ZhP/rdhLFLkIeFtnZDY50=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":817343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAGQBCRA9TVsSAnZWagAAolsP/iRC0Nwh1O1aHWtr7KjG\nlkXw3Yr/vJusi2n047214gGua36chDYo9baxx/if19ZvTBhu05Ty64iTCz3n\n1/Dgxv3C86ySc81W1NEeviyPX9jRsvF2ruMC0yX6JD7ogs64KFXFmr+tkRqe\n6zKYPh4iGzcFogXQCZWVwWRbKZQyCk3FS3RfjUAHqxQNPIjMLkxSXR9tI/SS\nyqWsCz8tb4x2jWU/jrIKs5mmoqFvjVfiEmlf/j159uYh9UEUGc0Eg4rB2ZZO\nQho7VbmJYedzGsZbAGRTQdiDmGJWteKU1n7TZiXhLk8UTMZOsf+5J5xf2Ok0\ntZsD4HHggP292UxINJIxsKM1yzWKFe3FSLa9++tXrvw1j3RnATxqwcxCHUSc\n/xQ2y89fahH+id/XPv1gjB+3K8DCi+RQ9tuaKpJ36ilqZsegar6Jxx2HH3Ft\nMflQgaK8QnOxOvVBbq8cw75anEw+3I6WcZecHFJJXMLfufUKNmRsCVi0yjQI\nKaVWSUyARSbTAiW8gPjkuttwWZiwHKtDA2izv3l5qfRqetho9nhevTvlGyVy\nzShVYe65SxHKf0ovUfpB0hQ46dA2BPPWLorVgRZm9zBQVRa3opGHD5haNsoo\n7lzV+IpK99jd+nT0oses0v/UnUOKv+MI+YeCGczlvw0DVz3TvS14I6nRhXxF\nhQaG\r\n=8kXs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"087c731cd84ebd8c578510bd4c8dfb5d11e8c574","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.ae85f7eba.0","@material/rtl":"13.0.0-canary.ae85f7eba.0","@material/base":"13.0.0-canary.ae85f7eba.0","@material/shape":"13.0.0-canary.ae85f7eba.0","@material/theme":"13.0.0-canary.ae85f7eba.0","@material/animation":"13.0.0-canary.ae85f7eba.0","@material/elevation":"13.0.0-canary.ae85f7eba.0","@material/typography":"13.0.0-canary.ae85f7eba.0","@material/feature-targeting":"13.0.0-canary.ae85f7eba.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.ae85f7eba.0_1627415553109_0.6134505102015999","host":"s3://npm-registry-packages"}},"13.0.0-canary.5981207f7.0":{"name":"@material/tooltip","version":"13.0.0-canary.5981207f7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.5981207f7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ce5cf4ad9a7212d323938c2658d5159d7ed8b6b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.5981207f7.0.tgz","fileCount":38,"integrity":"sha512-FiE5gqC1NlYEALKix/gsP44k5ivA4SioCP12hM2lQVQ2x20uj3mldkriyjPelqRcJAdyaZqOpFzzQgw8u7Dt5g==","signatures":[{"sig":"MEQCIBNHOYAZj7WJr+bMRcUGNeTWLO43uvS+Dz0SbOIx0uLWAiBXo3z1aZ9w1o7O1QSDqtQkHzpraJarup+I1JgzTUER+A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAJRyCRA9TVsSAnZWagAANGAP/0aW5Mv/VvSjaZxrcUH6\nVa+nFSY9D5q2bPr6nZY6SObV9SBpnW09rf4uHAMkoVkHJsRzEIl6707TTDw8\nq4uZwmHLHkFOWI3Sy/3iK7mpGZMaBC/L4Oy3dWQhP3d96Z23ZGA6PgbqFXcC\najIMCxKld8GjNN6iwQL7/OD/5RGzzS4bY0zgl0Ys3QhtGGow969lJUfqRrNe\naUc6aCVgGaoWTQ9j+95/HAjknshIZ+6F5mmT/puvQoZ1HHGLhNWNkwHSnUAQ\n+swSOYpCr7g84fvKYB7q74vAarQ3M+3wr7PWtHsst3gAOFTTswXC0VqGsdpL\npayR3s8Az0D2cPbqhshCpISnlaFvnM+rZ5w09J+Djo3qCvvCF51fJvGwNryH\n9Y7xjdHJd4nJioNWTzgJ9ZlTALl6bYvZtmDSMn8GGgM//NWJG70hj8KI4jvv\n1dCEmFf6Pu13RQQ7jXd2CV4D86rODxfFyTLhlHmHZKX1wr4kI0rdSIoDhp1+\nhHSWHU/TZUrpEZSaNhcUbXuqDCAAzr1KFerh4LeSD4BtcJ9WKGgCoRos9ppJ\n7oZ1vp0c11mMUFkj2TRQc493pxNnNd5Q4M1axdf4aW0HgkQsVNkIjWkUkBXH\ncRtWVkub28MDEQoHjtl1bZ+HHvUmqlC72BoYUeM20neD7mFmQkF/ZqUMd4T6\nMgI1\r\n=150Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8a8b67c19b2a9f80923dd162098b373bbf34b58e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.5981207f7.0","@material/rtl":"13.0.0-canary.5981207f7.0","@material/base":"13.0.0-canary.5981207f7.0","@material/shape":"13.0.0-canary.5981207f7.0","@material/theme":"13.0.0-canary.5981207f7.0","@material/animation":"13.0.0-canary.5981207f7.0","@material/elevation":"13.0.0-canary.5981207f7.0","@material/typography":"13.0.0-canary.5981207f7.0","@material/feature-targeting":"13.0.0-canary.5981207f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.5981207f7.0_1627427954279_0.0313801804712881","host":"s3://npm-registry-packages"}},"13.0.0-canary.83bdd0222.0":{"name":"@material/tooltip","version":"13.0.0-canary.83bdd0222.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.83bdd0222.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"35f428e22ce2d4ba5c9ca8ea94409fce755756ae","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.83bdd0222.0.tgz","fileCount":38,"integrity":"sha512-HpYFOCnt2Dqp6URMBHNdZdi8x24uDIZgYXq5SmYlvAsXKHOwf05fYDeNLBUHFLV81NQt6CBhGKeiFMuo8wOr8g==","signatures":[{"sig":"MEQCIEzvKPtFIOfjo8y9G2QwKIZnATcefaP+RGN2Ao40D10pAiALHT0Sl+38ModAhTxl7lE1Z3eO8m8Tb0+aXNpUvEg+/A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAZNgCRA9TVsSAnZWagAAVFMP+gJnWnAPCnqGNQI211Nx\nuuZeodco7BB5oN8HJ+BAAR359CxyDNQcgvlIPJ9hObr812EBHVZXkp5Y0bCF\n7YSvmTzsJWdE8brBJ6nEoD8wyvr1o9aAhPA77amDAylrH2LeejwB45KArWw2\n4Fkf4NZlpUiNWXxUu16N1piQ1FC9CkvjKQlVWR//y0gmi57U5xgwfF/IDksU\ntoz31G9WqzQ6b2mAEtt1uTSm2OYsvW4miZWRxVBTpp0OsN0AN254Qd1hkoKB\nnnf5BWKhrnGyFXGtusJlCFCiee4vrWhLTFJs8hnTLfS6hTBMmzMxvJYUv+lp\nuLpoexf1hHT1krfIdsBg2H0tUws7E3vSZyrDzgEgTT4R6jrOJn9ghYDg2Sjp\n0E3GSCbEKikd8ZhYHTbbmOWcKRAHhwkafAE/dzzgNUs3qcp7EL2zpLnJt+Qh\nPtNt1Aw6xl29UKJJPKgqDzATpY9h5EvkdhzbFWKPSaOVpR/AV+mH/AEepvHj\nktXFnjAg9vFjm5QTYK0z0e0X4OmDRrrAcbxI1yKHU+6cQ+6ERgJ7WFCPb9Vv\n2L/oI1aeu7kDGF4EcIOD5vLmDdLyVMKKZUQZMFXlr+0mkLKCk/PcJFUJqyou\nn/FtsKRrLNWMd1YlM/pTPHvHf1L+MeSGMcmeg3oHlxFcaOE7dxX2eMPUNLKS\nL26z\r\n=5Mrc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1f2b23ad4bf20ade58cc1b10490e9ca3f9469405","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.83bdd0222.0","@material/rtl":"13.0.0-canary.83bdd0222.0","@material/base":"13.0.0-canary.83bdd0222.0","@material/shape":"13.0.0-canary.83bdd0222.0","@material/theme":"13.0.0-canary.83bdd0222.0","@material/animation":"13.0.0-canary.83bdd0222.0","@material/elevation":"13.0.0-canary.83bdd0222.0","@material/typography":"13.0.0-canary.83bdd0222.0","@material/feature-targeting":"13.0.0-canary.83bdd0222.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.83bdd0222.0_1627493216120_0.7795156914546737","host":"s3://npm-registry-packages"}},"13.0.0-canary.28656298a.0":{"name":"@material/tooltip","version":"13.0.0-canary.28656298a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.28656298a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5be38058b96b68acaed5ae7c88e269a548af9208","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.28656298a.0.tgz","fileCount":38,"integrity":"sha512-/ZbGjHLCnBOQaeDhjyGxuAcTELRGu5HVZh9BM5cU+Y0gW6qnLrxZU+lWF2ESfbU91RqdNUL9fva2qRiMu/ILGw==","signatures":[{"sig":"MEUCIQDdrmw4WwXBr4jvGiAC+1YD1m5XtuosIMLJrT2O6uCkuQIgZ9qpzC87Q2NktQx1gWtkvXmGu0FdHP7TvAdRET5JaDQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAu/pCRA9TVsSAnZWagAAUWcP/jitk5OXTinn6+KUl6R8\n+461VMEkJnrvJi5Ii3qVpxpKU9KTZDvZwMo2C/SyRyeyYOJF5K4YxbkRxOw/\nZVezREkVJAmCkT9sISTuFMr4lxAqCpe4fvkONn0tD14zKCxp6X8wTmzWi3Ka\nrwtC5PIdq288g3c0upkcgSDXOxIxloBFJGrxjTwAxnn2EGxECpB3IPVzjHVi\nmhALUKpbSPJofXQdu6Oaxy48nLALrgdguPso8Qzw3PTDx0TFD99DqoJlrpx7\npawkkdsHJbfBX2dvzVjN/bpQRZHbKhKNwLI2pZCqj9dqq2ktvx4ISTXEbN3F\n3odppX6DAV/+FG7xxeaYNhanpLeLy4c5nohCiV6O73X3FlPe5jgd8mxHb5hh\ncmmW84Mlenl956TosxS02ZLrpCjJc2c9fWmpkNxIcKlYg41Czu8BkNMf8mtA\nCaFou3PLSIspSzpwtHYQaVGktaVbaBhUXUKiDhzXFdBynfh9ri5e/6rVsn/z\nKWHMQO+rLejafowh5Kg6QtZ1zsVVR2B5h7WLh1FjnIr3IoAhaYaqlZuMM4Fr\nhXADhWTdCeVS0PYsafgbwJvAABGzQi6ZzG02PYvQPnWUYErX6rvbm2p8ZnbJ\nm7/M5v2Q5LMrYRAMjqC8MW2dnuiCZEAo4Z3TDnFQrKGk2qbI7FPixl5ob62Y\nQYIz\r\n=KFRW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5fe3e7fec89669c56504c13aadf80a71a543df78","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.28656298a.0","@material/rtl":"13.0.0-canary.28656298a.0","@material/base":"13.0.0-canary.28656298a.0","@material/shape":"13.0.0-canary.28656298a.0","@material/theme":"13.0.0-canary.28656298a.0","@material/animation":"13.0.0-canary.28656298a.0","@material/elevation":"13.0.0-canary.28656298a.0","@material/typography":"13.0.0-canary.28656298a.0","@material/feature-targeting":"13.0.0-canary.28656298a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.28656298a.0_1627582441064_0.7402573686237715","host":"s3://npm-registry-packages"}},"13.0.0-canary.9e797daaf.0":{"name":"@material/tooltip","version":"13.0.0-canary.9e797daaf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.9e797daaf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2f3cdc0c5c6739c50d2e8532deadc6dd46d62d62","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.9e797daaf.0.tgz","fileCount":38,"integrity":"sha512-lS8IM1d0Khmy58tYNlWoQwXgSzGX9sOQ5wZLukXLdOVWuOgYtsFzJ2/32LivnaYtGrNRBHAAoH5yJcFNvLzQwA==","signatures":[{"sig":"MEUCIE3+de6hywH6teFPf8MKX9NUdWiwvedFjZ2xQLuxoPsRAiEAhlksgjS6IgrgNiFQ4TrsYv6NySIUWneT18yfJcVJnyU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":814848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAvUgCRA9TVsSAnZWagAAtN4P/0aSwPB0sJr2Gt0MUgSC\nT37h09RggMG0qzqZ1FW6RW2KncDErZrE+zj/mrS7vQc2c7h+pCPYDTeaGVa0\nmuxc7cRfwbLEFqJxVMNgAX8UjnHqLIFymqmcNKb+SyrcX9Xv81U6WEolJyDZ\n0Wfpv63960t3zr0C+y9Mzc07hOg61AZvcXCf0kZOFREEwutx24Y6hCLXnfuN\nVTisLLvGD0Pv21R/upJtRKyvW0oI4rW/1uyhBJOTwU2Y2hzJHH89gvnU/AXH\nGOMpcIksz/QKKBPpXadONI5ChyaIGKlZ6mRGHaOStd3BKeWK6Caqltkkbr0e\nK4sgCt7jIudBU9uFNp5+b74IxLRa2RRuWutfxbbt7t/h6OOdHhVrX8OYpSNF\naEYRkr1W9QdxE5lF2E1CjcTf9C35Q7jIKvQgSq4VPEV9TztCj/D4UIGsqXov\nN6hDzUyh3NzW9kuB5/GPsikxaW+O4vTWMWtR4s26MBpT0FMoX5P63NRvBocs\nXbfvIjhbvFCV6rDglPlL3QbcPMxOyDIxfrXtXPlwABYgtDjnXCQiUey0laYg\n9/f/E5AL+6ZLIYm5y+BvtnwGzvM2aapb3tyFVwfSgdIacWto0082pYffIfZz\nI17ojV/zxR4ukK/tagMLCt9cwLqHCxQIYIl7dOJKWj96Uok0yKIGI3G2b54k\nwN5D\r\n=8Jlg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cad664597e3cc10ce42dff721f26f40b986db48a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.9e797daaf.0","@material/rtl":"13.0.0-canary.9e797daaf.0","@material/base":"13.0.0-canary.9e797daaf.0","@material/shape":"13.0.0-canary.9e797daaf.0","@material/theme":"13.0.0-canary.9e797daaf.0","@material/animation":"13.0.0-canary.9e797daaf.0","@material/elevation":"13.0.0-canary.9e797daaf.0","@material/typography":"13.0.0-canary.9e797daaf.0","@material/feature-targeting":"13.0.0-canary.9e797daaf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.9e797daaf.0_1627583776604_0.9723575097500141","host":"s3://npm-registry-packages"}},"13.0.0-canary.adb9f1ad8.0":{"name":"@material/tooltip","version":"13.0.0-canary.adb9f1ad8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.adb9f1ad8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8c6cf4eaba367eaa1eb552ed5789fecb3ab0d386","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.adb9f1ad8.0.tgz","fileCount":38,"integrity":"sha512-SVdeWhm6D7DDtWjoWepYY2T72o/gsEb+6fAOpOj6cwl4PCOwRbS9XvEsmjyRylu6l7nw+U5y61T3p9LDG980iA==","signatures":[{"sig":"MEUCIQCtUuql4QH2KGvK+6pMCoziLvc4RbYPW6pXrji6KeRgmQIgFloUpldizgCYQHN39AnsUR9WZmI/1KKrSI4t6+JadKc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBE2eCRA9TVsSAnZWagAAXG4P/2xqRgczWSQAQs2VTXgp\nY/HT44lcGq0rHwwjwKY4xybISfC/3YZHNZ5zBF5yA7dkNw5CEQbhbWBDVNz9\ncWrvMp7RdqdDD0F7d+TZJ7RItWSWqJlndaFmqU032eHqgS2y4aGBX/TNPnaM\nhGXjOpoe7vRSxtA/YgYEB5t1ZZdlcboU626nOjE0em5J7uXI5n4PX35sZ2JL\n2qTsRPmY5m6YAkKtzYAWjXLm/JUDriUOfWOwi/l9WpNyAM7mROtWBffEAQr5\nsU6tofRIMhTNhFTpYXa1swZVpMDxpJabloErq9JABrHrP7VmlTxpDQsA3Cm8\nhbD3ksFGoRtLqgFzmXdyshMNN0m1Zgc9pyLhKIrKEdi8bNknPFKMMW66j8Bw\n1ylgZhJ+5a7vK6tEcH122cFpvSh2AbtR9uBTIz2DwX+3LTIBYsdjDiRGNw06\nU6jAeZSrweDuMQgSVgk5/A6K/nMqHA/c9+OSt8TLfpQaxYj5gO5NhIX+eePH\n6FAzCjy0UYywgQGyidc1DV+9mCU6k3eKIK+8c2DZqTX2T13jn9Z4H+bg854G\nGWkL0DZMRzPjVaOc1nXIYmKoMxQtSPcu5e0nphfxWuipd1BMc2beWecBmDqY\nJ+mo2dWBWrvMELrAuO5FaLWBNS34P/wfmsLtjMS7aAGebwE9LoUjeBg2zcMr\n0Zmx\r\n=ldC+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"db010696805aae457c8d8c9da8b394efff28ee35","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.adb9f1ad8.0","@material/rtl":"13.0.0-canary.adb9f1ad8.0","@material/base":"13.0.0-canary.adb9f1ad8.0","@material/shape":"13.0.0-canary.adb9f1ad8.0","@material/theme":"13.0.0-canary.adb9f1ad8.0","@material/animation":"13.0.0-canary.adb9f1ad8.0","@material/elevation":"13.0.0-canary.adb9f1ad8.0","@material/typography":"13.0.0-canary.adb9f1ad8.0","@material/feature-targeting":"13.0.0-canary.adb9f1ad8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.adb9f1ad8.0_1627671966769_0.9101886266817931","host":"s3://npm-registry-packages"}},"13.0.0-canary.cc5377458.0":{"name":"@material/tooltip","version":"13.0.0-canary.cc5377458.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.cc5377458.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c8c8fb1af1b5a502bb728428b5bcb19c41f9444f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.cc5377458.0.tgz","fileCount":38,"integrity":"sha512-HGCmBa+QKidZVdTOF18/XJoB7wTXqN60ye7QXLJUdVWj/5nsQ3yKUliH7UVuGacKt/DvW8xfSMYZyOUvEZ8q0Q==","signatures":[{"sig":"MEUCIERO+P5HMmsoWmsMfYe9QmYuByjkBn2zLO8vgg5+zTA5AiEA52WflGvtN1d5VbMvbLBHB+dxL1LrfaNW59JXC0RXVtY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBHBhCRA9TVsSAnZWagAAXikP/06QYSWj/cOPnViZnxHC\nTRwFVyEaxeWA7QmbRP9o6BEYBSIu8jPLiR5xJ2sOaVFJpawAErfu+DHXBNzP\nJot24TpmxLwUkvof2bGZLDjjqtWNEraNRk+ZMcYbrwzD4u3o9Q+nYxAUm4UD\n95Pb1nuFl62vOH8Hf3fPHKsurFdfL9eX/Tnc3EFC7sPYRHr/BJE3akxW52rc\nVX8NeKfua/wY8EVIhIAREZHM6wNCYvWAU/LufKNL83kM5LphjK5KdIfoebdH\nqX5D3qHNihCqUYmJ3+OMAGnoDcOe9OFfUyol7mWsjfGf36wwpzn4qb+Cffg5\nKzotsDDNLDwBsQJlL8XNE+3JbhXgyY+b5mjTJuFrEd57RnSMLaua05Q6doI+\nh8PV11zQ1bKpY45P4iAoi/cwM1paQL6sQ36sdYNwvOpJZ203S1RPznfYQRHf\nOBUGxwbnoobSzgVCEZrtQghMBkrTbmti66NQoincJYDxBBoA5wpiKvPP/JKW\nbtVC+q6TwmGcygQ7zWdr6Cg28AP7hF5+6nHe5mpKyzCLjUmK2e6s/TEN8RJl\n6cTWsGvLx37UV+gwxqRCUvXYVqHtpfEEui3EAmmhA4KHBswJe3O5XanvzEr1\nawzUyIQYr/uXEiaiAefu0H5ostHavI2+pC1xa+dEudRn8ebAbvD5Hvarfair\nH/jY\r\n=8mtI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f4f5852cfac85d68dbd83665da839943c29dd866","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.cc5377458.0","@material/rtl":"13.0.0-canary.cc5377458.0","@material/base":"13.0.0-canary.cc5377458.0","@material/shape":"13.0.0-canary.cc5377458.0","@material/theme":"13.0.0-canary.cc5377458.0","@material/animation":"13.0.0-canary.cc5377458.0","@material/elevation":"13.0.0-canary.cc5377458.0","@material/typography":"13.0.0-canary.cc5377458.0","@material/feature-targeting":"13.0.0-canary.cc5377458.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.cc5377458.0_1627680865119_0.8512585877702672","host":"s3://npm-registry-packages"}},"13.0.0-canary.a395972cf.0":{"name":"@material/tooltip","version":"13.0.0-canary.a395972cf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.a395972cf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ee3c1447a547b4aec1818115be49c9def2f0394","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.a395972cf.0.tgz","fileCount":38,"integrity":"sha512-RHZv3IfN1u2hI4C8OXglE1Zurc8Ot8yn7x+G0KY1PyzKLQ6VafvHRL3IatWPDBVN/w1lwnwooScI97CuDmNtyA==","signatures":[{"sig":"MEYCIQDsPEb8v7aH2QQYBLlYZ7fJwYpjl/I/nNtWSzagKYKWbAIhAKrqEyLVZp/ZElt5/rYOfhXLmvGnKc6UGGCMoThI7IF+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":815476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCbQICRA9TVsSAnZWagAAtKoP/1uZ9dUg7HGLzA5U36Ox\nFwptm6vj3XLflwhJMRUb5tIgBsvfE/2FHRW3KyhK7hr406WFcP4j2o6vecWu\n4es6Aze3sI8dl99HYMJTSjoMGIEZP3A5H6Xj3F+DAqJOT9jUL5qWP9JWqAhA\nSiTjwgqBF9ue2POj47rMOTxX61+gQ0njXP3s22IRCefs/9CxktExqak3ISfS\nyWRLejkilZQtpou85vozewpSXdBGwgYdUgj3euBtzBdnVjmw/jghwMqs567O\nTWGt9iIuQ41/s58kwUm71ys0t5/x0mwx351r4OW9mi1zrFvRfx5IJJx7Hmqy\nZNjZ/K2EdPoIMkw5Q/sO29cjzPsKtnUbjtHx32rupMUdTrd0NnAZ3V+pZGuV\nhCfoaJaaLLbqNCLMIkdb1wqcyU+wqOFvAXLCi+8gJwrIqqnZkz1Ck5Ese9Zj\n7sa7FPshoxiyZpHjNtDlHSfOtAKf0fvM9BMurcb9Ju8dSnCs8dUydC5cWPsq\n7A+rE8y9Afj9DvSMY0XGAOlmjwggHLnlAFDO5u0AfZsbgazaPjn3mFciR9SU\nTw9uSN2WEOE/wqko0667U0QeYBJxCdIJFbz1c8FFDOS0HoYJqiCp4Sy8evQd\nRgELvsoq9j/CRGdM/oHwJy60ekFvcPOxdZbVPpGZvd2/4BXuSI3c7nObg/ls\n6qR/\r\n=1Ft0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"00a6b6110465620df99cf5f775d52a1054c91cef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.a395972cf.0","@material/rtl":"13.0.0-canary.a395972cf.0","@material/base":"13.0.0-canary.a395972cf.0","@material/shape":"13.0.0-canary.a395972cf.0","@material/theme":"13.0.0-canary.a395972cf.0","@material/animation":"13.0.0-canary.a395972cf.0","@material/elevation":"13.0.0-canary.a395972cf.0","@material/typography":"13.0.0-canary.a395972cf.0","@material/feature-targeting":"13.0.0-canary.a395972cf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.a395972cf.0_1628025864015_0.8811694235235814","host":"s3://npm-registry-packages"}},"13.0.0-canary.7c96e6b98.0":{"name":"@material/tooltip","version":"13.0.0-canary.7c96e6b98.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.7c96e6b98.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"265c0719ea5567bf6db2dc3788407ecfdce4bcbc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.7c96e6b98.0.tgz","fileCount":38,"integrity":"sha512-qB/UQFJJhXy2fN4KJ6gkYdE3mwbMMKG38VxtLTN6UdtNay1yLycj3SFfYNVlvx6QIyc8NgEEr9gIrcWI4X2dNQ==","signatures":[{"sig":"MEUCIGmCmc7QKqFDglpiuBSTwthym6I6kTEi9JAKOXdQ36ivAiEAm6H9wZFRKOBO1hgcgQbdKwIwRf3vKnnHcWNTmV93CeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":820064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCb/dCRA9TVsSAnZWagAAijwQAI6rM5N6KdJ1T6lHzDxr\nyf2dGJEhvKENW2YyC/V0EHjCcaK5Fk3V2HvdgsZ6BBnWH916a7H9x0TwplEu\nI0aRxdO2gxeEAkKHCpkruGn0gmYA9jX8YTOjyRxiiL+LuUWK9kLzQx0QJ24X\nouCbl90DkNYMy02pFOC1yo3MBICzeI1EG0MdXD+nFvy8Tj9QlbiM9qHaBapx\nj99dQqg8CR4upIl5RDOgF3X1we2g/YJIOjfsAaDhy8J4UuFYEVIJ9b9qMNl3\nt3cEVlAUeCl//Mx3ohKzdeXhu0aClhlWLHeF7P6IbknIBaz/sR6ppS6AR0yj\nxEEQigqMZSFz62QBKNhnxBt8o/1C+WedMYf/RrqCvcGZpDoX7zOjLtvnNbQy\nXnfonLdZhCH6qe1nUGPF092Or3UBMBFYSKSgAOL0+IN7axInpsV9lQ+3WkQs\nLGj0H+toQq4k+41fkn0wYv9T3rHwsR5UBLI9iekpmQ1JR9mUdnPZ+xAFDzwz\nfE4OxU5tluH9f4F/AYjECcceg1aIUS/qlpwjVNO2lj6ogvywaNzBUCbmoWpH\n74xNI6ynX6ZQeL/Odlub3GbtTXYJbCdniXwjPPdzVRxdBUICH3zqvK19TSVy\n8mV4bfiJePA/wMBOC1wnrrW1Jj57xqaP0JKuiLUS+lqeLwNH9E0OtAjRF0B5\nBG+q\r\n=IxjF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"38c48bd580ff0facb66c28bf9caeebbd2a6a4033","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.7c96e6b98.0","@material/rtl":"13.0.0-canary.7c96e6b98.0","@material/base":"13.0.0-canary.7c96e6b98.0","@material/shape":"13.0.0-canary.7c96e6b98.0","@material/theme":"13.0.0-canary.7c96e6b98.0","@material/animation":"13.0.0-canary.7c96e6b98.0","@material/elevation":"13.0.0-canary.7c96e6b98.0","@material/typography":"13.0.0-canary.7c96e6b98.0","@material/feature-targeting":"13.0.0-canary.7c96e6b98.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.7c96e6b98.0_1628028893771_0.20522051384001294","host":"s3://npm-registry-packages"}},"13.0.0-canary.a80c8b2c2.0":{"name":"@material/tooltip","version":"13.0.0-canary.a80c8b2c2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.a80c8b2c2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5601666ab0f439d057c7fa99d87fabc4bed83905","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.a80c8b2c2.0.tgz","fileCount":38,"integrity":"sha512-rkIQD4+empQev8wPLt9ir20X7/NT3v/BYVfVQqloX8lAASpgdPTruJLJqHuyWG7Bakqlrygmqe/BTO3tKnCK3A==","signatures":[{"sig":"MEUCIQCy4Smsk+F6fR4KRUdyTwHfl1EmCPgXz8ojlUN3BCciBAIgTpY8kWj0n1GO/Yp8QZjozG72M5F6yxTOoMP6csylVKU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":820532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCyozCRA9TVsSAnZWagAAl/YP/1BjalqV8smCdHGvHtok\n0znpceQ5gpOvCltZJpqlgG0U0quq8Mr21Yt9cT4rZLgKd/uSIjc+dMk6q0W2\nsy2W0MeY4aLvwGp1tooqphyHd2MtByoeNU5QiUMjUsY5WFX9NAFujPfHiN3Z\n6FW/1BUDjLoiJQ78l2CMXuDeUV5a9Ew1mZTEjvZxKqYukhI6pk+5CST9Tg0Y\nsOwA/37JbQjoW/wtz2yg3q5O6Y/sd/oNS+NSL13OkkYtF/fjwP5angYoC6pr\n48bEt9e0ZV0qB9uP+LRQZRcnxZEvL/xy3HeCsRXZ1/rQ3PeG7vCUkjLX4Iv1\n8scLka3DAuiUv92V6yI1EzqwZCKuulYhPpUMPIdcOEB+Uc5AhffgyxZQK+oy\nahkIQy2Cpya4FPrbjFe9LL0ALW0WMw/rFyhU69TbIaWIDUGCYJvn1Ngdzg+O\nG9XE+1rcjadmZ8fze4T1P2gR03aATbW39DkIQpVcPJWib7K64zDGVC7tVRJ3\nu+St/abodySzm5rayDyM3eRJFb5LfOJ3LkMPDareS7yJe1KlFNCIH05b5Udp\nHDl4zxB04bLSv3PlfBDutMM5l8pNjNi6lBfmBjiX6hz5reEKlJYpAsBv7IPJ\nsxmXQM334nETk5mEUjpLt2zQzIRjrPw+xz0ExWhkk4nla5WMyv4zuAEUyVKO\nEWN5\r\n=UE/j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cb4d3f1d1d37c50939ed5269748eebb96f798601","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.a80c8b2c2.0","@material/rtl":"13.0.0-canary.a80c8b2c2.0","@material/base":"13.0.0-canary.a80c8b2c2.0","@material/shape":"13.0.0-canary.a80c8b2c2.0","@material/theme":"13.0.0-canary.a80c8b2c2.0","@material/animation":"13.0.0-canary.a80c8b2c2.0","@material/elevation":"13.0.0-canary.a80c8b2c2.0","@material/typography":"13.0.0-canary.a80c8b2c2.0","@material/feature-targeting":"13.0.0-canary.a80c8b2c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.a80c8b2c2.0_1628121650924_0.15544297355302983","host":"s3://npm-registry-packages"}},"13.0.0-canary.3dd611091.0":{"name":"@material/tooltip","version":"13.0.0-canary.3dd611091.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.3dd611091.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c8112fda685a39a2e404171d59a184040e76e8ae","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.3dd611091.0.tgz","fileCount":38,"integrity":"sha512-R5JtK0iEHFYE4bCgEMmHY7600ZnAe9daeU6RLrp2oFaAVi+GVJ9GtjWqLICpNuRKmS0y58+BEKvZk5Uft9tqzg==","signatures":[{"sig":"MEUCIDmTsji7AIGgtpGeAJq/IgnunBLzjCw9WG79EWcehgjsAiEAzULgxzQ+rtzDT4sgRJJV7ZfspseWaPhADPmCTznbwPg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":820532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhC2GsCRA9TVsSAnZWagAAnkIP/2R3WkY0CQhlg+o4rbWx\nbvI30UVelkU9cP4pgR7koBuFG298lfU/W2PB0wnHNI55EITtRApr6/pkNB88\n/OUEmZ6LmJunfaHjfLPeBptiGcDd+yTXtaoZBipurBOXP61L4CMRNpTV/a1B\nDYnqk8ugs4XhYXjirxU80dzOYA12wh6udwD87GnYi9vDZeSR/vTzpyBRthfE\n526K/UNFtyc2g+5M6AphOEcB/s4XCN++y7qnME2qXqVVvhJAe0t4Hzot0a1p\nhu5nhgVQXQJYBKhLmpV5u+nLvUsb23pttMOzwqVu0P9qINchkOnTT74Un6OJ\nFQWMBIAGFlLd+XZW0UYr/Qiu1rblBvr0ULxtIIyNp9eJuy/MjfSOdR73TAxi\nMNCQwwhIM72blD0R53WiERuq6rOANbZTkRWtA0eZ8hViaTEIYabWWpCSgQqf\nhet2SSfcV8WJbbT/i4Kv1sgsBOExzh8ADDyy1kjTUo4JMfHDo1EyeYXBsvD0\nD0qG1wpfhoggL7wnb6UrB0VF2Xj1l36/lytcECwpCqIrtD2cgoB9nzCKKe3X\nyvhYgs6ZpD/u8NjdXn9jDlU7nZ5ditG23DOrgqp7n8ESsX9LWuXwDPdOSoew\nOtFN7sLeIgDztkAFEqkCNXmD5MfsxeYhGUypbTJU9EyYN3XAANXwu0FVbbmo\n6fGz\r\n=TjV0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"fc6a6a59d9c86ac1f85efd94a4aa6a8e4c27c379","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.3dd611091.0","@material/rtl":"13.0.0-canary.3dd611091.0","@material/base":"13.0.0-canary.3dd611091.0","@material/shape":"13.0.0-canary.3dd611091.0","@material/theme":"13.0.0-canary.3dd611091.0","@material/animation":"13.0.0-canary.3dd611091.0","@material/elevation":"13.0.0-canary.3dd611091.0","@material/typography":"13.0.0-canary.3dd611091.0","@material/feature-targeting":"13.0.0-canary.3dd611091.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.3dd611091.0_1628135852320_0.49316245829092775","host":"s3://npm-registry-packages"}},"13.0.0-canary.5dee37ff6.0":{"name":"@material/tooltip","version":"13.0.0-canary.5dee37ff6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.5dee37ff6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0fdce1b491f7a83e806e3a746da784944c05489b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.5dee37ff6.0.tgz","fileCount":38,"integrity":"sha512-wEGN30mkfpTyurCxPosuMaEgY8UZgXL7uuD1rTSWevLTT7y94zqrp/ezN9khlzB6u3+CyqFp+cuKVzrNxB4Mew==","signatures":[{"sig":"MEQCIGSFy9RcwsmcmXsewiVdgvr4j640F0lGmF2W9e0okJYuAiBFHgn2NY17SyaW60hB2IiO4o/xoBw5KqsuV0O8ixroag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":820532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDCM7CRA9TVsSAnZWagAAyqcP/0ueU2WPGf4dK746vrF8\nWBMwYrwDWwb5VDAcwphjkaSyl7lrQKqq1cfahbJzLxjmXRz6QnsiFVOOV+Bu\nTdCRsbu8XCFAEqrbdDsSBQYu7PkqCoU6ktV9I2WmKoVnDTB5Bonr+mIPCM+u\nbkOYzhjdz/EYgQZtaSnKrZNKiMqvt184j091pO252sAQExydl6W2lgen+4wi\nRbF9+VqjmOsMmTGwk4smBcIn9p6qHyzGwvrWuvvSyBlrNCu+LE+zqT0vZuY3\nkVa5DmQTMYUFZS4xqmuds4Slrb0RJ/XZygbZH7yZcMwsbdO0fmOHlTMLoytq\n0eYYK5cmyHG4nX6AOygZGQuB3K6RsgP1AUr2iUwvXPaMRBK/8cYi+U9Ag5ZE\nfLTYFx3g/EFnsqm4byk52iJZs+J5iGUD5POOOtvDByPjLRhIAmBq14V7Jd1N\n088aUhuIcWT3dyHSjY0uQ8mVzZJDGhgOeAoUV2AdFJ3CV9vmzhUewOQHXAQ6\nZe+Kfi+xoGlZKI1CVQvjRmRrPjo+V4kjIJgJEeO2rF4WzctMeslUkCMYeoQ4\nxNMr7BtO0ewPLifvM2EOwKtFRnmeVPtD5pShk2DRJd0CRxHOdN7jfHYiActD\nSPvxTVwnsU/7kI4gDWlhmBlcneYojXNbGCJlw8pRUG8+i9wKb12W2vO9cipM\nFYbB\r\n=beEJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a7b521f6e807878ddba15c813505134621ef85d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.5dee37ff6.0","@material/rtl":"13.0.0-canary.5dee37ff6.0","@material/base":"13.0.0-canary.5dee37ff6.0","@material/shape":"13.0.0-canary.5dee37ff6.0","@material/theme":"13.0.0-canary.5dee37ff6.0","@material/animation":"13.0.0-canary.5dee37ff6.0","@material/elevation":"13.0.0-canary.5dee37ff6.0","@material/typography":"13.0.0-canary.5dee37ff6.0","@material/feature-targeting":"13.0.0-canary.5dee37ff6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.5dee37ff6.0_1628185403528_0.06689420054718842","host":"s3://npm-registry-packages"}},"13.0.0-canary.bf405d22a.0":{"name":"@material/tooltip","version":"13.0.0-canary.bf405d22a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.bf405d22a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36e2b364e763b03e3d645c59150e9c75851c8a4c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.bf405d22a.0.tgz","fileCount":38,"integrity":"sha512-LAFr7McyoZY8HEJ7FqPmYKtj7Vmx8Qrdb5frKLa/UYfEP4oMKyic7Vz1M8q8YFVOAChKBvah7axKuotpx6iaJw==","signatures":[{"sig":"MEQCIBxste/12cd6UGDisPVpMlbhdaxb4m2j+tBRHEGJTfxUAiB7U3oG8pGdTHCko175uZ0rW4puhgghfOJVLyXkOWQD/A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":820532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDEe9CRA9TVsSAnZWagAA2TMQAIDTiFc+DIeJtMLjBoX4\np4QSvPgKkrPpkLfGY+7UfituvHmvYIBTjPKLk9eWgcS9qWewpPk7TnjEk0on\nSetmMeA1/5dUJsxmcJdXe0ogmBzvMfaeLpLddB90xoP1DO0vnjt63LGhwJNd\nzFJpNXGjkQ+0HSInzIviuKnfbA9fIbo98LOJWuTKLkRgrxzyBGmr40n0bBAJ\n6Fs6XcLIMy3MkqYs7+20U62HsBqfApG2f58eMLogJkZqFQ1M5+qDQKxgxAzm\nBZs3NDlpTRZ31jAfVIa6DXvE3rygq4gvqMZ/brrwxCzznu+Dc7J8f0DmvC4C\nUEKb0WpSHLDgSMyNpzAPwPEJTPrt5kQWy9cT62iGDA58tTzxpiVlTs6zUx/v\nG4PowQ9+BWtF6NgCjX+8z4o4SNBK5Oae6RIbWwgMYc5Ju5sLWpmqYUndXCb7\nHW/QRcKfvx3mUDTlJFjat1spu4usjW7aeHSZ8xiKg9U7PNJaZ0ufgnX9AhNV\njANEPrRpNzjGZwSbbe1/Pqv3/SHmENLPhO84ktuXl2yZroaZkR9f0c5y3Mlx\nsn1d/7LfmP5d/u3NoknPsdPN/z9PwGS5jyAZxNEZ2oEL5BnXWCm8STPg2385\ncIS0++FAbt/3mw9NNJoO09WUFUc/RB6YyHqTckm96qir9UKOXAZBGnHaz9XV\nJrb2\r\n=B0WR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","types":"dist/mdc.tooltip.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"00ae15a245c6a46fa0a13aa61a02e5958c0eddbb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.bf405d22a.0","@material/rtl":"13.0.0-canary.bf405d22a.0","@material/base":"13.0.0-canary.bf405d22a.0","@material/shape":"13.0.0-canary.bf405d22a.0","@material/theme":"13.0.0-canary.bf405d22a.0","@material/animation":"13.0.0-canary.bf405d22a.0","@material/elevation":"13.0.0-canary.bf405d22a.0","@material/typography":"13.0.0-canary.bf405d22a.0","@material/feature-targeting":"13.0.0-canary.bf405d22a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.bf405d22a.0_1628194749747_0.14663787445614251","host":"s3://npm-registry-packages"}},"13.0.0-canary.b47dd37a6.0":{"name":"@material/tooltip","version":"13.0.0-canary.b47dd37a6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.b47dd37a6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ca620cf6b305f456ba4b26153818997b268ed8c0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.b47dd37a6.0.tgz","fileCount":37,"integrity":"sha512-dmn7NDpg1tzzlGq3q8KUp2bCdxzpCo9kOP6LkmKSY4uXurBM9jlKtSDSDg7aXCdYRk9JzHz+FygJbOiHPixf7g==","signatures":[{"sig":"MEYCIQCigIjxsR5BbjULKPTOtxz150AYOuDVbOoEb/8VyLj2oQIhAIprv8g3QcB01uN65NxPnAjHRPEFwl6OytzguDTEst3b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":799042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDE80CRA9TVsSAnZWagAA/4MQAIbi4PCIxKuaUOnEXY7C\nT0fAgd1UMIkT0/ap9urehWl9v+gzYM7P6ExatJ1p2MuqWFSHKQn4ztw1saso\nMrv4ETPWjxexPUuFZTGGsm4btK/rZKNA4hvZ/vWcHXO/C6uC+QVbUnytBm0q\nLJkqnAyjZaYmVi0a8kQtTSRhYFswCs0uU2Y5qiuZsiZqFroCcwSFjcMdQigW\nQErFMtpxVDs+HEgcQg286EVOV19QGdzn4QMPe/CmbXLT7v1+o5f4n/IExipw\n63HHAzH1wo4w48ebxbPMed0YbJ+mZ0b8kZXZwdh7fJ0omeet/ANU6+YIlVAY\ntLNwYUYP3q2fYDpkjm47o08E0GW0tjXxHK7MVFRMxXpL+41kNUukGuZTxaE0\n5esZ3OfDUUzJXQ/4USZeskVfJrMQqpay3COm5f+Lq++Rqt/s7T0KJRQdk7gX\nu0/qJh7eWPsfAscz0GJ0/KpmklhWl/FVjH0iW1AcGxtIFrnWx2o9Gbysezth\n0RRoptTkoRRVU6FXvsIdCtUhkycYgUhJkuOixAEkoOkWr1HTX5r9ZMNemroT\n/wbMOxdpw4mK75/XauFIRQh9/wJuUYW3QtFFSY7sTX374h9o3Jy1oH7fQEW+\nn+8oCRO3txbUxzyiI53GwwtZYRvWoL7VOhGx6Vpbk+spw2AOFyj4xvfb6hTg\nz2kX\r\n=PIuE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"47f67e5fb310c13dac39b9beefbd6b53fa54d1b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.b47dd37a6.0","@material/rtl":"13.0.0-canary.b47dd37a6.0","@material/base":"13.0.0-canary.b47dd37a6.0","@material/shape":"13.0.0-canary.b47dd37a6.0","@material/theme":"13.0.0-canary.b47dd37a6.0","@material/animation":"13.0.0-canary.b47dd37a6.0","@material/elevation":"13.0.0-canary.b47dd37a6.0","@material/typography":"13.0.0-canary.b47dd37a6.0","@material/feature-targeting":"13.0.0-canary.b47dd37a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.b47dd37a6.0_1628196659983_0.8281341395099056","host":"s3://npm-registry-packages"}},"13.0.0-canary.6c82b965b.0":{"name":"@material/tooltip","version":"13.0.0-canary.6c82b965b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.6c82b965b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ccfa558c00d8a89120841e1baed1c3f46e1f3a50","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.6c82b965b.0.tgz","fileCount":37,"integrity":"sha512-q5irpv1oFb29MnfnOo7EwQwSwJNjj9IKnnR+djjMAyy6Ds8M1Z/PZlMtdRmOAju641sjOl4/5PfBF76XLCOlPA==","signatures":[{"sig":"MEUCIQD9BCsAVc76uMz/sl05TfDxCCe032iTPw7nrTpEiR4wIwIgDXr7sDCluao5wSNNmzBHnXANb5/TN6DHAWXeZNLXcA0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":799042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDWA6CRA9TVsSAnZWagAA+9IP/0BqhSQp1mptfWKpd2/x\nYO4CBWDp0YjWyYq8O4O5/8/8bfmGmkpl82JZ1fHXbcKWa/zfGHfhUf+ZWT0p\n6mGwOdCqaScRARUthGR0t7ELr3ox1CSDC2rfgwOcB91DLy00gbU8bdXKWsgS\nmef2ecSGEZA1bpl6I+i5vyGnsSCHfWeCg6juhrnoSdA2JcSF4wODnn54NEjo\n7UUZP5DGUmk6EgVY1VjCQy4dYQfNHK+X7ObdJM+9wO/1y/svCOf2iESk94N5\nQgz3dDndp3amwqpDX106zU7LCl9wc2eIHa8GVfuD428aosyXH4L7ixduThJ6\nP04LNIpNZVS+okE7Sz1sTD+m/BcJnO/eGb69fyy9Sk99tSifiI9JcYR6Vgov\nZsohxQmhzlJ6wFliYYjj2GATioevmFaqW9d2+j3yafcOc4Jyej2vGOnL50gL\nZxw8wkGYZ5PCtMOKJfR+KQSpQilWxtT4Xz4Fr6SIYtLxExZ7vQbvx02DLOgt\nmdw355XEct8EH3S3dKTdIPmU0S7qzSzexvHpwuWIH1/Tz3Z2xPWLPuPvEwqe\ncWNB88WHXixerkUnOmdXzmae53abfRUvoQZJmVjsVy4KUckl6KfWCCy2SMlB\n1S3xBT90XTRQVksDHJh9BZkAepHBB1oUw0Feg1eyXVyDaeOqADJwdAQG/8vb\nh1SU\r\n=yc0g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"434420b9fc9470dc77940d2240234a564be58d02","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.6c82b965b.0","@material/rtl":"13.0.0-canary.6c82b965b.0","@material/base":"13.0.0-canary.6c82b965b.0","@material/shape":"13.0.0-canary.6c82b965b.0","@material/theme":"13.0.0-canary.6c82b965b.0","@material/animation":"13.0.0-canary.6c82b965b.0","@material/elevation":"13.0.0-canary.6c82b965b.0","@material/typography":"13.0.0-canary.6c82b965b.0","@material/feature-targeting":"13.0.0-canary.6c82b965b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.6c82b965b.0_1628266554525_0.27806002523096773","host":"s3://npm-registry-packages"}},"13.0.0-canary.4ca11fe76.0":{"name":"@material/tooltip","version":"13.0.0-canary.4ca11fe76.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.4ca11fe76.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bc701552d5b9aee6f058ee506f9db883ead8d98f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.4ca11fe76.0.tgz","fileCount":37,"integrity":"sha512-IH0Dlgu5OayiMoFKQFYbRORgDzAGN/LZ5yCkrVO/NF2CRgmUnVnvOai+aWwzPKWNTiANBDb1FbXB5QzjddKlIw==","signatures":[{"sig":"MEUCIAefFOgwIl0GDp3MYg7k3kZKPXpnKGwOso1odtwWNbTwAiEA/YDstX80Jv36nQfJcH5ZtiZUKBKIA2NTwwGp7eXFMQE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":799042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDWyOCRA9TVsSAnZWagAAIcoP/A543TCHhySbZRWI7Guh\nJRd2hunhHKgy+Kd4oLgCfKWHdvvDXqeAbSpP3abePi+Jbs66Ed0ukALj33QL\n9ez0eBl/cl6BS+17Q9rTrQmRzXrxiJHfvNXAbAdiBMfigEUGBJZ1iKDkLixP\nBBDszpchvEwU8hTSOcJ5J2PitF2Ul4BCxQDs5VEUMxbP03ZB5T3FVcCSryu0\ny4/JXy9zQN5+CRVOQLwaL9Vx/To+OL3lWnZQTopiHx+poIbqKDe/WWy4yUGR\nTlSumCaxDeXsyAfdY4AtnSuNUb+uVNT8+6xCmQkFhLb4+3XeVNXIjNqvzfGo\nEo0JHVqcRw02sx8S8lBSjzDl9shwdkj0aYOKZYi7m+4qKh6w8l+Ufdc7HEFA\n6IxyqyeCt8d2AvYzNVUDif2JbCmVDfiyeSgYhxcMKHrLHiJ8H8qN955r4NcR\n7H2XCVFSTAA8D/VSePUEFmPpGRUg0Clm+Kvkj/oFbY/qTYeRV+qRrP/H98JL\nz4yeN+PSs6ZXLaL1yUMSFYaOUL4GJhTy5u8/406RJNDe7vkBOyYq7ucDOu6c\n0qCmZa8tIkKVFuNDuuzKqEstzM15d7IgHMGJz7YlQaR5wXBlSV2+qxQt72gs\nyZ4LJ2hn0osb6oN47TU0gqkfSGMvH7hz0qPjRho4p7+6j/sMEyWNhGWY15II\n5JcZ\r\n=tt/t\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`, and adding a `data-hide-tooltip-from-screenreader=\"true\"`\nattribute. Hiding the tooltip from the screenreader will prevent the same\ninformation from being announced twice (once from the `aria-label` and a second\ntime from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\"\n        data-hide-tooltip-from-screenreader=\"true\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f012412147804a7e8c4bbcb205a7a48a045cd694","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.4ca11fe76.0","@material/rtl":"13.0.0-canary.4ca11fe76.0","@material/base":"13.0.0-canary.4ca11fe76.0","@material/shape":"13.0.0-canary.4ca11fe76.0","@material/theme":"13.0.0-canary.4ca11fe76.0","@material/animation":"13.0.0-canary.4ca11fe76.0","@material/elevation":"13.0.0-canary.4ca11fe76.0","@material/typography":"13.0.0-canary.4ca11fe76.0","@material/feature-targeting":"13.0.0-canary.4ca11fe76.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.4ca11fe76.0_1628269709916_0.94833905320495","host":"s3://npm-registry-packages"}},"13.0.0-canary.510cf90f2.0":{"name":"@material/tooltip","version":"13.0.0-canary.510cf90f2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.510cf90f2.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"84335e3864236db003dbeb380c0a51bc82f67f45","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.510cf90f2.0.tgz","fileCount":34,"integrity":"sha512-PWr8540pWiGwUlQ4MYyjPPf9VUGnf8J8kznAU1tC64N02RNXWt1onM+zpF05SkzwAJlrwK0nx+Gb8XdbhjP/UA==","signatures":[{"sig":"MEQCID99yJsJGo5KLBPWDM/TGEPJZLatlL8a9bDJrzUDLa1JAiAti2UHZ2XDV7N9HLIELDkNzzKbc4BowMQhjstxEKWIoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":792188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEWNhCRA9TVsSAnZWagAAt2UQAJQZ3fnqwS5cdWEvool/\nvBAjuu1GAp1a8C111AUSEICr1u2l1JO/Vzg/6GRM0Z6YHl0gVmX5arX5zTzn\nNcqpxCHnZ7Jv3qqgBaXhz3bivnpFdXqR8EFDKn9sqfWrrMVYGEftuFcXUZb4\nO9V5wadq5ngE/rF4YSypu/jNtiza4PXid89fObUhYx0k7fwbUYtchqxMFZJP\ntXUOshAksmJRWIcmggTGHgiWrMTrLSisDRy89Fci2GocUmdW/eVKZGusxaGQ\nszIuUxykIStzLtx8p7w5box8J2hOugG3jy1iIV1mXuCtDNW9CcpwYsoNhXiV\nJw6+0MIl0U7vYunMyRvhJP0J7iP9tl56zIu7VNjB46CY5ENvIEdBDAs9YIrY\nGoJ0k2hf/x4FbeHAQx55P36ExWzKKOkd0GBbwB2l/WQW3HOdQNZUshQf6MU/\nb9MSqbaciO2d2aJ51wH/Bx/MaJzObnQrUHjPYyTpVVOG49wXK1YS72vXSff8\nfgoJDcGZ0CK3a/q0ib1pxh6R4yTfOrRQXCLjzybS19pUm7kj+kDCsOeQ8U+e\nU3BZ8Qu2gjpDOZJbwGQWtnVKsAqCrOafIgt4t9vJjbQrZrNiSCrpAxlHYlGa\nkLWsR6H4I8sb0jYUxGxCeR2ruCOcQ/xSt9KHGlR/n91Mp0yQIDY2AsZWyK9/\nbycV\r\n=njvJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1e11d1f2c4c830419dc862b62700d4484604a3fd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.510cf90f2.0","@material/rtl":"13.0.0-canary.510cf90f2.0","@material/base":"13.0.0-canary.510cf90f2.0","@material/shape":"13.0.0-canary.510cf90f2.0","@material/theme":"13.0.0-canary.510cf90f2.0","@material/animation":"13.0.0-canary.510cf90f2.0","@material/elevation":"13.0.0-canary.510cf90f2.0","@material/typography":"13.0.0-canary.510cf90f2.0","@material/feature-targeting":"13.0.0-canary.510cf90f2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.510cf90f2.0_1628529505378_0.3489845654061514","host":"s3://npm-registry-packages"}},"13.0.0-canary.17580ebf7.0":{"name":"@material/tooltip","version":"13.0.0-canary.17580ebf7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.17580ebf7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bf4e15b1dfdf6bb4f6973066650ad1a377a27156","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.17580ebf7.0.tgz","fileCount":34,"integrity":"sha512-YQ2I3Ub/aK6+NuVKT50si9i/e05uQa5mucBd5itI8py9a2sTiMSV6qDddY30N03ojhBaBkJ7P0u3lHnivBterA==","signatures":[{"sig":"MEUCIQDpn4v8+6FP4AxevnuYCE02g5slwku54rDVgHATW0UPTQIgKPQVjTeUHXYeN1kSYbFGOkTN7bQnlk/q0mYmgxytEFI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":792188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEXGDCRA9TVsSAnZWagAAisgP/iof0w/h/Fdimk49gnnD\nPsbTIL2cfDnMETOZj4YUTyRuCekPVLsN53QDTD+h0rzulOLNzdJGAg56FvEe\nIlrxc6QYN1p3ZinK9fyFzox8/GxpoDRqVN+hwIWEE4o2ptdxeFyWAXt/DxKw\ntwXjhoCfFtw1MYvt2BZjpmr1zPggiwCWnVQXEgSA18/7EdXnH7pw4xb76aEz\ng3oymGUs/ZjzNSrckzaXOGV/EAJ9HEBtZCoxsDknMUSwpar72d51kfKc0G9j\n+/DMPVLOiyji3MjVhqt/dE/VE6gl3o+O7xSQuS0OPHPphQLdtjsUC+qABVVU\n+v4VC8Xs5Pr/4DIh5s4V6qZ7FNG/KHhufJ52IkSPsfGfMB9vBykLP1dyd0yH\nPzic6oWeZxNS7nGTBtqXNyO7KMVn+Lx6E3AL1C6jxJMOo3Z7bBdeiHAOxebQ\nXuVgoLCCnlJmw2SoagdWnWCwGlQsFhx7dR/6IZ3x2mVo0erknHUZl/ZNafws\nO2RdcxvkZ+mUpO1GNCO6c3VgRSx3g5/Q6Ukcqz1kHHdybV9bCzSy1s6cNxsU\n4v610+jm6vxhVzFzVYo4h/TxVx9jug4VfkRaen9APllSKqtw2HHkaaEPCUOo\nEImUo/bXMGD+o64VI7wXavmYdeYUxPxqr/B6N4NBkCREZoRBeq3U6EBeZclr\n3DD+\r\n=0qLq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5bde42052101fa1fdd48d89c3dde8b9e99bdd1b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.17580ebf7.0","@material/rtl":"13.0.0-canary.17580ebf7.0","@material/base":"13.0.0-canary.17580ebf7.0","@material/shape":"13.0.0-canary.17580ebf7.0","@material/theme":"13.0.0-canary.17580ebf7.0","@material/animation":"13.0.0-canary.17580ebf7.0","@material/elevation":"13.0.0-canary.17580ebf7.0","@material/typography":"13.0.0-canary.17580ebf7.0","@material/feature-targeting":"13.0.0-canary.17580ebf7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.17580ebf7.0_1628533122892_0.30968322241023016","host":"s3://npm-registry-packages"}},"13.0.0-canary.7249a3060.0":{"name":"@material/tooltip","version":"13.0.0-canary.7249a3060.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.7249a3060.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"47156706b45706c710025da5c072dffb588d63e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.7249a3060.0.tgz","fileCount":34,"integrity":"sha512-xGFkm8sxfjoioLgpj8bW8QQu5IGvN6LJPs553jLSvb7pow5iEuj8vxcSg3FJI4+Rvfm4npKXluCtBvkNpPTlpg==","signatures":[{"sig":"MEUCIDFEd6vhwdGXQbZbUNqOHNM90kxhG/8t6tXQJFj/0grrAiEA/wSKXSnNJlqwr8wiLtMEVJq/Qe2XPPjKKG827m3a/1Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":792188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEXJrCRA9TVsSAnZWagAAwNwP/ReA6mpJJD8zOowGprmS\ncwfkPchZ+2RgTKnQqRsKPX45/dXbKix/rLjBHY1mezK2SDKBoedzlUjuUAnJ\nXVBdrqyRzvD80XLDhAfgR3cjU7Q3dgrsMKdz35P+6C/QyoDCINdaf4z8pO69\nkx7WfgQMvOFjRVFCB23RTveax7W5IkyySy8wmG326XFf9sGF73o7wIW5bmMV\nGE/4PnzloyEr+P571phqVPFZEtEFO240iBkFq5CkN797fZt2DXEfQC4InYGQ\n+KoguIvi5yKDqxarXKOITVsOzrFybK1pF0O9d479cWb2VQW3iZwj1SzeMHCV\npzuh2jcFzmijn+RPyfoOilBgohCympmzra/oo+y8GHnYxMWPwg29PQ1Yrwui\nEIhr19UKM8Jb14HhlU6RC4M6JF/eq8I9D6HDdWPzA+YriHoasse5rq58Ivd6\n3Hqiex7S+4gXzkzdANAh/GNR24ZOI5sKFrCw6yk5MTEDxR1MJmmX8KjvY0xn\nBOlrTxeoSkrVk/02OXt/QlCv6M2SK0/o54m+PgflRgMkNqQ2sojZbuCLHBLu\nkgwlwT0LVcZVNCa57a5mtyzmJcBmMmKIxKdNsVv0BDclRRyG1dwQseUy3a9z\nGEB7aBHKvwuIu6rdRjUAs6uBxtLHIYglDNDFrmgF5gWT2AVbZ9PvGerUGZO7\nwOM0\r\n=U31j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3412ad644836acdf464e70d019c36080ab377321","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.7249a3060.0","@material/rtl":"13.0.0-canary.7249a3060.0","@material/base":"13.0.0-canary.7249a3060.0","@material/shape":"13.0.0-canary.7249a3060.0","@material/theme":"13.0.0-canary.7249a3060.0","@material/animation":"13.0.0-canary.7249a3060.0","@material/elevation":"13.0.0-canary.7249a3060.0","@material/typography":"13.0.0-canary.7249a3060.0","@material/feature-targeting":"13.0.0-canary.7249a3060.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.7249a3060.0_1628533355132_0.48086849824583977","host":"s3://npm-registry-packages"}},"13.0.0-canary.4c405863b.0":{"name":"@material/tooltip","version":"13.0.0-canary.4c405863b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.4c405863b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e0a64480983c64391593ed0ba85b7570d78efed","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.4c405863b.0.tgz","fileCount":34,"integrity":"sha512-lrrbWogNalerrEglcCuAa6MA8yzPlyypilVrjO7bA4n2Y2TG4tJwMAQK4u/jhApp21R3WPBTtVFG678ehsYd0w==","signatures":[{"sig":"MEYCIQCwQZnCE+cAWGXjBGohu0nyfYZqUyIbVXJRGJPhiDrtaAIhAOXhyNxSKUIdBbiApljQR2ZsTmxy9nK+Hkl3LTNQVHZf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":792188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhErplCRA9TVsSAnZWagAA+hUQAIQf4cuCYuY7cqjAe/xL\nkr/qw/Sgc/x+BA+F8enpMJVDaXecpxHxcbnyTTszSckguEsjU6fwHdJJnCph\nlIld8CgUfBS++3KqPkFAZfv3cVrcWXn4YOZw5L3GmYSUwIxBS6hZ/tOpMcnJ\nCiezSlQa+DQ+epkEn9Dte/lZJD2ExBWwB+ycuqlRMVOeoVA9nTIcqxD0zn2G\n7WeHr4cehKuyXTtf+2ItEppVCHYUMMlBEB7+j6B6YLLkuvG409rFB4F9XvL0\nd0Yf6CEUMFiVuPGe0HWxs/zUVixcdKfDXkx1Z8i9+yQEt3Lt1i1yX/Ksv+wL\nmUumfCma8YaziD+auDTQR5f+pe9P0HuyzPskPkSyPGqg3rhDjqmXZ28oj1Xb\ne3hFuklBwC+SDEImEodqVOA1hOCMYSwrIZFD2MvCwU16ngdRvvcnP43mZq+v\nK+a/hhrWlktR5ypGz9/m4mADbBaQujXbTBQ3iBe+A+1zrNPZ9T4K5xB/rJHl\n/6gyGsWWPPXgGeaUEjHoad6uTa3fkBxvr8HM/Q2lEQ6YuoD0Lc8LVKaG27NL\nBX+ht6tQHK6bmLzKRUcQteXhWvUmIP8Ogg7dhLYc1iMxaT16N8yvGFF1BgJb\nZkQB8vo/3zf9tDSuQsxp4ki2QYdMUsAYWMS430A3XgpBVHZ7p5Ffz4n/fOWF\nmdtN\r\n=DNzt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b3861554313a19a861a5f6850f9df33ae5bc42b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.4c405863b.0","@material/rtl":"13.0.0-canary.4c405863b.0","@material/base":"13.0.0-canary.4c405863b.0","@material/shape":"13.0.0-canary.4c405863b.0","@material/theme":"13.0.0-canary.4c405863b.0","@material/animation":"13.0.0-canary.4c405863b.0","@material/elevation":"13.0.0-canary.4c405863b.0","@material/typography":"13.0.0-canary.4c405863b.0","@material/feature-targeting":"13.0.0-canary.4c405863b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.4c405863b.0_1628617316805_0.6783827994267886","host":"s3://npm-registry-packages"}},"13.0.0-canary.f4241a42a.0":{"name":"@material/tooltip","version":"13.0.0-canary.f4241a42a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.f4241a42a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5a096a06fa4e71e5eb6a79f6ed48c49b2851f96e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.f4241a42a.0.tgz","fileCount":34,"integrity":"sha512-PZqf97aaEfM8sHllMwFd84jZedb+tNpAMTIl6og/vm/GbwvMuXPf3tB0wn9FJT02E4FfYwOsKnDBuxmQYyJdfQ==","signatures":[{"sig":"MEUCIFZZmI3Gj2yDAlx2sy6CP+0vr1VCjh71t5SqMn0e7KHVAiEApqoRBd1jWsAsSoaNfuvhEC3DqjMJJGuEHefXJNKm8+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":792188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFAI3CRA9TVsSAnZWagAAgzQP/1ff0Dnaoi9hlWOMtjwd\ngG6Xl6VE3JP0PyursIoWyRYwGAG01A5I3HfryNWypW9pjgdHdH1acT54o+Yv\nBqaz7I1qP08F4zztVRJbpo4Hq1oYCDPn5SPx1cAIyEtTJV2bZ9dTOp8Q099D\n4re8dhGqHM/r7AdO05Jm0wA6CwysCU4H/DGUO/NdWykJX/3xb72PahadbI1l\nlvKEZU5kqjpYiR9PhuMOOf5m9+GyvD8+C3x0+QwM3SRsz0YON7+Wm+WfAHhv\ndwEncBiLHNsvUDCTITRHH+9vCe6Ws5tGVn0+63KRUuP04ttEQJS6nL4P/o/E\nJlVon+gOVWytUe/Mcl8fILWY11NdSllNYuTRfApalDVSK1+XafbZHwAofMDv\nE6AsQPzWhEvH6BXN9FotD+bPM4Yzoc9pA6E0dGVj3QmpksKVA26R/K0Su3Sw\nEKBnIwU/qex4XIF26mfV0H0SPiWtQDFaySTYTX/QVopVc9QwlVo/QIBEuztG\n+nv7U9F1UxmQcxbtaFf3U983+TWEyq14gTSx07swFhX/bnBaCUbE7VqQSTkR\nrE2K28KN5N5Noc7ok5lnMdTJX3+fWkXPWCL0UyJLKqPum9ZA/SA+70jDaLIe\nfnAyoC8G+usAlHgiBW1T/1FVO+jmhBLvDo53G2qFxUoT2kmUpKjKX6mmRuvz\nSX+a\r\n=3Us2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"bd97e42dc6a97fb74d92a9cb04e919c5c8af4da6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.f4241a42a.0","@material/rtl":"13.0.0-canary.f4241a42a.0","@material/base":"13.0.0-canary.f4241a42a.0","@material/shape":"13.0.0-canary.f4241a42a.0","@material/theme":"13.0.0-canary.f4241a42a.0","@material/animation":"13.0.0-canary.f4241a42a.0","@material/elevation":"13.0.0-canary.f4241a42a.0","@material/typography":"13.0.0-canary.f4241a42a.0","@material/feature-targeting":"13.0.0-canary.f4241a42a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.f4241a42a.0_1628701238863_0.6513180061688673","host":"s3://npm-registry-packages"}},"13.0.0-canary.0ad12ed3c.0":{"name":"@material/tooltip","version":"13.0.0-canary.0ad12ed3c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.0ad12ed3c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0b3dff4f0708a8411ae32ae833a0efe8b1a3776b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.0ad12ed3c.0.tgz","fileCount":34,"integrity":"sha512-SL1NFUX3SBUFjVxVFGFOM2tqBAoiMA4tJirZRsVuWBLBpcTzoCiC7i3g1jwQN9NGlz7Gf7hjifQ7HnVD9ri40g==","signatures":[{"sig":"MEQCIBqPyJcWbCPIH3oDkOuwx2NN07XQ31YzUoPBRGsVXkK2AiB9vBeF/gzHDDueOycKIoipk/tC3YONVJ/Xpvi8HIXD6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":792188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFEFOCRA9TVsSAnZWagAAHYEP/2Ksh1grgNMo7dNGp/Mo\nCw0WIrllDVZAy4cQf226iBNA9QUqOiBZjwuBA/B++4y5Am0PuM0Wq7G8MM0a\ns4hxURRi1D82DfH8jPCWiwrg8uUXdwxkqXyy5UtI2APHiN66Oue5HDSXP7oQ\nMKBeUSVh4p2SmunuoXVxHngsZ1HyDDImjaIFs2wENhjf0ktIY1A/OzNp5Phb\nvupy0eeHYjwW6p65+bOD18ib61LC5dYhNVT2Q42hIcP5dmlWUMl7SyI076Wa\nAmgBlQEBy+xOQ6eVQK2YngDxezoSPUup/V2U480MeIMfbPFfLpQWKv3n705e\no7EldHUWkTB86eyXEQ3LTC7XXgbCzfuDLBFL+6gmdU7Hh9LssVlSccmk+3et\naOBPX0OIUmdEMTyVSnpvyBFcQxVCg28Ns3kwgMe7QWTp6DnM23msDsSOXmCD\n0qSaMBs0O4PTG1Oyf4/x6dn6hSqpJvmHp5bLymQn3lLVwemJ5wa6bUv3JjSF\n4x/ZszzzRbTs26X7B57pBF+rma8S3UH4Ud9Xgu+LqVH4aOu6d7LfntOTTmju\nu1NtzQJHYw83nSc1F6MVigQNOWWlEuJqGxnuM/rKO84cLgNdGGll/Dboz93Z\nc1eMjo2bvJ2KvtS40Kegk3ajfanGurzBVsFYTfpBz3xurWg9RePBM43wGjQz\n7jdP\r\n=6hA2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"db28e7f3596365b1d41f14b53d656a743eb28bf3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.0ad12ed3c.0","@material/rtl":"13.0.0-canary.0ad12ed3c.0","@material/base":"13.0.0-canary.0ad12ed3c.0","@material/shape":"13.0.0-canary.0ad12ed3c.0","@material/theme":"13.0.0-canary.0ad12ed3c.0","@material/animation":"13.0.0-canary.0ad12ed3c.0","@material/elevation":"13.0.0-canary.0ad12ed3c.0","@material/typography":"13.0.0-canary.0ad12ed3c.0","@material/feature-targeting":"13.0.0-canary.0ad12ed3c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.0ad12ed3c.0_1628717390375_0.38397502677780193","host":"s3://npm-registry-packages"}},"13.0.0-canary.077dcfcfe.0":{"name":"@material/tooltip","version":"13.0.0-canary.077dcfcfe.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.077dcfcfe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"119c1b2223219831ffa1c6657eaaf19be950740b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.077dcfcfe.0.tgz","fileCount":34,"integrity":"sha512-nSDHb5hxo/m/hjhMTt9zVAM++5wX0TKw9PYmEksbu2m3adFfZQEnmCsuwbhV2Ln7IpRdSwOwBZ+iJ2QR5MMamg==","signatures":[{"sig":"MEUCIFsvjlV3dRI5RfHZ+bT6cgf9C0nSZxjejRF+Q2gA2xwmAiEAza8igTa2ccUBhdBV8KzVGBTpVkDqJ4RGx3x5rOME3kk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":792188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFWDCCRA9TVsSAnZWagAAFwIP/1PwqnkOubTidzgRqj04\nK6Mihom722HIJm/71zFVg+y89qxakW832ShOpqGV8D1i/iZaN+327q1B989r\ngz21zqd47dgvr7Cxo+R6GoR9LWGwQjARmDRjAZDKxDJr9GLKjk8TRGDGL+Qe\naTb721deRSCYoJCDUvNyULHauU9kCO71So94ET6JEPB3FFfzKVusJNFfPPN4\npmHSWMk++cGaKWBiUZZ/oQhVUB6jEQ+7/VJyvWQsmOF1EKYpFZfcrM3bkfnd\nEFBIYng1I6XoiczvNSdjkiVj82IVNMSLLUTuYGWT+bzBjg44zfao9sc2TmbS\nf4kGHGK9EZbSQtLduV1zBRG9kvlxZ/hyz+m6aiIM8ik8GQpAlAZUE5GbK+gS\nB9uS76ZqTJ5o1JuBtcVJ9TQCuWTif0JztRIJaNa/wU7fzqhnZ6E+PUdd62fy\ny0y3nOSBWVeTtjDLOhaT1o4YCTT9fGEA1bH5fDc9M02re1OPGfbmegoXIUiF\nzS/6DpimwRQcmvv+NXMi5byUBgSrVaoyY3JGuoUQWW3fCiBeLZKwGvHjgKdQ\n9IfKivnaT0HOZROCWTLDwGOQVHt9C+Vvk2Q4sJqgf4/VLXjMmDUC7HYmRV5P\nj81SA/QWc6nw+6kS0BOwcGhl+qwSbP35c4RxS6xyZR0cFkhIwicBlTnVl7QD\ngfgB\r\n=060G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0ce840a62c702182bebe1a5f2ed037bc002472dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.077dcfcfe.0","@material/rtl":"13.0.0-canary.077dcfcfe.0","@material/base":"13.0.0-canary.077dcfcfe.0","@material/shape":"13.0.0-canary.077dcfcfe.0","@material/theme":"13.0.0-canary.077dcfcfe.0","@material/animation":"13.0.0-canary.077dcfcfe.0","@material/elevation":"13.0.0-canary.077dcfcfe.0","@material/typography":"13.0.0-canary.077dcfcfe.0","@material/feature-targeting":"13.0.0-canary.077dcfcfe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.077dcfcfe.0_1628790977921_0.564869450358968","host":"s3://npm-registry-packages"}},"13.0.0-canary.e3346766f.0":{"name":"@material/tooltip","version":"13.0.0-canary.e3346766f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.e3346766f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f63390352f4f06d41621a1ea5fd8fdd4765e25c4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.e3346766f.0.tgz","fileCount":34,"integrity":"sha512-VDU92+/9GxKSZC6jleMjqTPhyIHWXvZMzIc1Kpe4D922gI71ZAAhTWGjvfmFY8Ei1t6zx0BUS791eQSSX888EQ==","signatures":[{"sig":"MEYCIQDN7CYdPmRlrvqqwu3x81qA0QTo7mDT23vDLZJQ3TSNhAIhAJEGIw9mbBXfHKagkGRPku/g+wgvc7QsGcUjUcZRzacv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFswPCRA9TVsSAnZWagAA2u8P/R1yp8fy2rjdsYIbytbl\nOLytiLbEwEuyD21KQn/NV9R744UN7iVQW7EWW62EdXR3QsheSK2Vbfrp3rS2\nW8btqTF+r/USTMjoY4ERzDXFx42EYCzAKrWLFO9+7sxwpdz1lNNI8pQrZ76c\nCw9RjInELdBBK86nQy8mD/iwXCf3XD1wEW4BGC+3oA+DkLh7TDH5A+v7oz35\nuf4zTN903gEO8KyWUjgsMEtUUZGUTMqSSedj9DrDy/RDr+EsdkHZGSL6y7oA\ncdEbaHnYEW+6qJAg4uLQXqPOLr0ozQjDwlz1+AtLDmYznfFT8fR0Vf7+dxsq\nWKyhVr2LvuzYNY1/STmz7FeX+1c3M/ZDMdJOr4MdhLygKOGU9E23AKS9hoz1\nGYg1jXFCyT/7dNC9HpIAFMUNXPiXeSOm9AplstyQakziGGg8Wspiubrf3r/b\n7gbHfDr4MP9cCWHXMYpsaLmVlDhq9Lt1+XSLVlWT74dwf7m3M8uplMFHAql0\nH3OV4jf3lSGYLw3euakYsyHff6dtZKMwdtLIt0FBZEXDK0XvRktviAl5EzdZ\nhyxg5zg+Y9pq3ybArI1vrBgrov5yUg8h+Qy3Lh2E4baIvQvCj8wKaJYUPQmc\nEUlUKerR6VzLZ4NHTLsCl3SxsUha1wfHbkewTAllnm5yb/XEl+dSzBfext7V\n4Mek\r\n=oz5s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"03da616c76c8b7fab07a24f82209f171a2fec41c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e3346766f.0","@material/rtl":"13.0.0-canary.e3346766f.0","@material/base":"13.0.0-canary.e3346766f.0","@material/shape":"13.0.0-canary.e3346766f.0","@material/theme":"13.0.0-canary.e3346766f.0","@material/animation":"13.0.0-canary.e3346766f.0","@material/elevation":"13.0.0-canary.e3346766f.0","@material/typography":"13.0.0-canary.e3346766f.0","@material/feature-targeting":"13.0.0-canary.e3346766f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.e3346766f.0_1628883982931_0.12210791807771537","host":"s3://npm-registry-packages"}},"13.0.0-canary.2fb068fb0.0":{"name":"@material/tooltip","version":"13.0.0-canary.2fb068fb0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.2fb068fb0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"596ebddd046aff03366e3a609f66dac1f0cba5f1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.2fb068fb0.0.tgz","fileCount":34,"integrity":"sha512-eCI/IRXc3WCKcB59lzWb0KId5NvufuuFcsKt3J/3eZxjK9CKRtSlfVMFRnsw68c27RgGoApBpc8xm/Fk5mKasg==","signatures":[{"sig":"MEUCIQCqInejNoTBPUzPxux/+ZCCSm0Mv9NPfikxq4RZOkLpFwIge/VLLpYUpse1w1giLbFtaoMdoeW7xe6xHwNlGJuQSKs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFszNCRA9TVsSAnZWagAAppQP/1zGIv63bjGJvjs8w7uO\n0yMGhtjlh0z6m0/Qrnf4eUayVN3qmtn11nlk2OTzp/OFdshTsMzcYEPEQB1C\npWCgSFcagtLWxb2fj88kthce3nA8i8bl/TNEo9/w/UpDH7fcAx7Mi6D/cOEO\nY5OwpOXGz/87EJ174ftiKhOXkBn6Wbnp/SMKMN4O2h1+Srl+A7cxrcQGIKu0\nAcCiuKWQ4Bhz8A2TC07U/OsFzbXlgkMYd44qcM52rH8zc3Fs8a+lUyNbVXnj\nTMXGjLMvE/khmgtfGYjpclhIikyndPK2WKT2ys1cP/U+hv8OyNw42w899n/y\n8cye9jC8Y41IR+vQceIKo50yt6OYqPdX9gjaqLrBUFykHpwhOv5yRdMOTesN\nY7zDIeVdla2rsCaDW3buQldbOyQ2Ui/0/89k+lha+a4P45Wz52db2+1RY4DV\nzG3uf0uzNTj5IVPnuXKPV2Y8vhySroV/wctFpCAN4r8iHaJEJuiE671JegmY\n55vKMhaFR/jzSStVM2MdZkWb7YHpNglvC778CtdgAFXqhv5B/Fmxh5J8sTDz\ngoFhiJMyCXPx/wwdG6zfl1z8DHQVmolXPjHwrYHbWyntHu+EOucoOy7cENOZ\nFOFQjug9wcDNZ80b4GsT3+ZjQgFz7lYPeb/iVpwraL2ka2peE3IDN+fLiBGN\nn2xC\r\n=HvFC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cd1967c0a3a80639eef1dd76a8e579a4456fee90","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.2fb068fb0.0","@material/rtl":"13.0.0-canary.2fb068fb0.0","@material/base":"13.0.0-canary.2fb068fb0.0","@material/shape":"13.0.0-canary.2fb068fb0.0","@material/theme":"13.0.0-canary.2fb068fb0.0","@material/animation":"13.0.0-canary.2fb068fb0.0","@material/elevation":"13.0.0-canary.2fb068fb0.0","@material/typography":"13.0.0-canary.2fb068fb0.0","@material/feature-targeting":"13.0.0-canary.2fb068fb0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.2fb068fb0.0_1628884172893_0.05275814683068192","host":"s3://npm-registry-packages"}},"13.0.0-canary.fb76c5069.0":{"name":"@material/tooltip","version":"13.0.0-canary.fb76c5069.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.fb76c5069.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f8ca7aa56de5a08e007f6f65d45be6d82607ac84","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.fb76c5069.0.tgz","fileCount":34,"integrity":"sha512-Uaj1yvttFea+Nkfzq44Wj/fPyIotRcWb/9OmYcRLAZ7xyDliaYTSoV+aXN++q6t386rxjBORohXxU0ZBZ0yGhw==","signatures":[{"sig":"MEUCIHGIc6PslNLOQplQKtjSknHa8uwTf33UOEGDR821oKHlAiEA2Epq77K0T6C7V9mV3dM9VCgQyEO/Fte7pqs8MNp25o0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGsXnCRA9TVsSAnZWagAAFuYP/38gTWRUWS7YQw1uq23v\nfVq79x1RNwPHrWm2p94UYJtASjj5MNkzRqm5Isnb/KAkKKegXjAVDlFM/aN3\nGsXQ4GWJ7UtDG40XIB/M4KKA2fMYBiI11tM5wom+DjQToaM9Za/8ZoJiST8M\n9UtNQjB3BMLGPZKu2JOaXH8a+PlYg0YMI+50GhhZkBzIVCXwslIQMtUafBJ9\nYii8J+KP5cVqmoKT30sz7V4PkEzLORumTB6EympklUpf2BqpbGCEIEhlAOch\nRVik13v8aHf+4Lz0uyrcS0zVfAVkeemr9CduqQdLBoxpet617MnzMsY3TKIf\nI3LxaE/okvnNG1fRQ7/FanMrXL8rbiAsqEr9ZeKHXfbjgGOJExgmCfSIzJ78\nTc8bg74io7Pr+xWZRvT8a2yASyZRbX3srLggFVsCiRLJhjUwqmYO1OllGjza\nLLL30HmBxOCGjLmqRZCrhSf9o2A7vfa5P4QMG9y7TO6S0SwnVVvnuAZbbSC8\n9c1hpJRPd279ASo1nnArGqdzd3k1VwwwXVckzRl9n5XNHWhX29xG1MERXQv3\nJFOgw+q0+ZNFXnzZu5MAhJtXP0kFt2L2wRT0I6TJzPGnTlzsgRHK4c9hicdh\nH1I0UkBtBwMo+cGTnSUxyBTxgTlp88XAjbbbFjenGVy2R6PXR9FjffpcCPJS\nw1Bg\r\n=G5HJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8a969624431e3c1b8d80c2e2a37e5ea5af6bea4f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.fb76c5069.0","@material/rtl":"13.0.0-canary.fb76c5069.0","@material/base":"13.0.0-canary.fb76c5069.0","@material/shape":"13.0.0-canary.fb76c5069.0","@material/theme":"13.0.0-canary.fb76c5069.0","@material/animation":"13.0.0-canary.fb76c5069.0","@material/elevation":"13.0.0-canary.fb76c5069.0","@material/typography":"13.0.0-canary.fb76c5069.0","@material/feature-targeting":"13.0.0-canary.fb76c5069.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.fb76c5069.0_1629144551415_0.6494163283655978","host":"s3://npm-registry-packages"}},"13.0.0-canary.457d89aad.0":{"name":"@material/tooltip","version":"13.0.0-canary.457d89aad.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.457d89aad.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d3487aa3796439ee26e507987a5b590fa2856cc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.457d89aad.0.tgz","fileCount":34,"integrity":"sha512-oW3Q/y+j/rpeqcpsVqVPGbnlaII2Us/12X1L38Fh45iLiJFbe5wdfiPC18fX+1RBuCsvr+zchOZT0AfKtJb43w==","signatures":[{"sig":"MEUCICVvbgxOWhcv14enmxzrE9qpQfgp+6dCCHQmjGPk4E8SAiEAn4p+WLoGsjsFOGsw+xZ+A3MWh+nlOYn9AsjpiMiMI/A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG9RRCRA9TVsSAnZWagAAiLIP/2HJ4PEQyhK3uUGCGL/t\nknSqpMWNwfycmaxxSv6myy964uTVP7r4FTrsA5gdCRP0b3dIpLxymEG3ZnRY\nqRcPNNKoHuRkcjQvjDaB/IRfbn3KNvA+XvPSYt0A8tsGlda04BdjDNSfioEW\nUM50WaXdFdqt+LUCFauNA56GWNF6iARTFGd9hidUvvV7kHifot4WwOJX/qsK\n4ew2iZ8UtC5SovcrG82XBvHY6EQwhwQHY/vYbp4xlVWSG4khVrlyvhkX3uEr\nSLYopn5Jw/s02ePfknOT3M/VbA3MQeDS3f2vNeQSAhBWgzCRV5wkK7AEh+z1\n8UOfNfYBEtCtjpmsVZSjj9lgm0ex/TC5U4KMG7VYsc4NfSzhF5ShkFj3/wv4\nSEswwBICv7j/IBu3bar3dNlXMUlx1JgQbjO34TWsKkKm+1EXIIivVuyE7e5L\nz13E/Fpw9IhOtDaScfVCJGe2Xlz7X3+hiMfICjY//+kp8ua80wfCvV9BBam3\n3nqXQkgpFJoOR0Q/jJ46a/BQkl7RUmCaXM71aEQT50K2kb0w/WbUYmlZ6SFA\nlEz7NoNOEGiyTXy9CJHq1bqIbjPbMTURcuSicKtmFWYRKs2g7U0JA2S1pzXE\n/Z2DeLxbC+Dn3nj6r4N1htA2yAFiBZR3fPpcst9Rlz3cgiWciTomqTTizvma\n/heJ\r\n=fyLs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e1aeb9efe0d3f4d8670a6ce174d17d7528b34438","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.457d89aad.0","@material/rtl":"13.0.0-canary.457d89aad.0","@material/base":"13.0.0-canary.457d89aad.0","@material/shape":"13.0.0-canary.457d89aad.0","@material/theme":"13.0.0-canary.457d89aad.0","@material/animation":"13.0.0-canary.457d89aad.0","@material/elevation":"13.0.0-canary.457d89aad.0","@material/typography":"13.0.0-canary.457d89aad.0","@material/feature-targeting":"13.0.0-canary.457d89aad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.457d89aad.0_1629213776981_0.9667196008893773","host":"s3://npm-registry-packages"}},"13.0.0-canary.0de2f2edc.0":{"name":"@material/tooltip","version":"13.0.0-canary.0de2f2edc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.0de2f2edc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fb8c73ec675286afa23e7d1e2e88a88709904f0b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.0de2f2edc.0.tgz","fileCount":34,"integrity":"sha512-CdGLsWVLGohkP2xt266TroDYiyE5hu6ru2koQGBBpK3i9/BkFGyafmCM1VUz7m2c65XrdxF2WoT8KTHsm4cvBw==","signatures":[{"sig":"MEUCICpekcudh3DDVvulwN7G+N+fPKuNQXUmNvlWaGVRJZ/EAiEA04hfx4LduF3YHvJAhNRBKvq+iGpov+6wy6z98HIP7tg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":793690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHCIzCRA9TVsSAnZWagAAxYgQAIDS+pH8RKmK5hEmze+G\nQ1qxHBYZI8j51Ehh/YupvUYtG6W/df1518Zjpq1AB87mSvx6Nj0FV23Vj9S+\nRKxsxq7dI6dd6BlXnNJq9fV93gnx6nWo3XL14bRyjonUPbl3v8/RnxKfoZ8J\nNI1x/wlEbJYqUXsPuvj7UMZqYCJ6c59Usl3cY9vU8T2Ii7YYjAdUN49UobFm\nYOWNkdlJVKUpKhsVbu2Y4b9y0iH5oTOK07epJJvbSq2eoH6MaBfT6QuMP1Zh\nR064jNXHtSZPK4oJ+AbrZFtSa+fjpQen4xIFu1CfjcVULDJ0YsRScFlIPPD4\nsssPdsIxAAFPIrdfJNTlukqgcOltQXNXpI9Mt2gO9N1+VDCKksRA9I96UOSM\n2YKMYO6t4E5vt2y80WevXxiRvrO4PZAkyQFVHAk/dukoTAbLEeVcGvYp/Qst\nWusiAknLexLcKH+nj9SajUq5jGYrzygle1WUDrZ17XUuWF2ExdCxuMx3ncj9\nqo/w1iaU+J0uIpjJpE0jpZyuli1j10psqL1Ks+yhDtACoYSMcq3e60Ka1sXd\nRrGiLiDHBkW9OvyxwZpWamtMfxo1BA9N7pkavxHHElp+VjUF3czR47FJAY3C\nszpJD+6VLl9JMgIzqRVkS+Wh12mkLhjC+b2B97BXw53HNQaXMcH6W6b8um8/\neWkV\r\n=OV2L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ecc5e8dc0157f612d4cbc7b03507e3779919d5d3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.0de2f2edc.0","@material/rtl":"13.0.0-canary.0de2f2edc.0","@material/base":"13.0.0-canary.0de2f2edc.0","@material/shape":"13.0.0-canary.0de2f2edc.0","@material/theme":"13.0.0-canary.0de2f2edc.0","@material/animation":"13.0.0-canary.0de2f2edc.0","@material/elevation":"13.0.0-canary.0de2f2edc.0","@material/typography":"13.0.0-canary.0de2f2edc.0","@material/feature-targeting":"13.0.0-canary.0de2f2edc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.0de2f2edc.0_1629233715586_0.17111309915503936","host":"s3://npm-registry-packages"}},"13.0.0-canary.1f9259b9d.0":{"name":"@material/tooltip","version":"13.0.0-canary.1f9259b9d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.1f9259b9d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"115f00e37e88fdca3a3dd7dd869c3b799212c1ca","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.1f9259b9d.0.tgz","fileCount":34,"integrity":"sha512-A8Bvzc1jfEjwSreF2uqdpyXtomT+5FlRgexa6kmiETCoIxmXtwO71Mg6+y2ISSKVbRs/TfLZVsKBngzBCC1oIg==","signatures":[{"sig":"MEQCIF75o2jS5ItuC60lSvnlypXLaPO24NrscWwL+KiYLU4OAiAbUCECUJRnbtS1k7NT3EQqCoPIFgVK82cZ0xGnL+yihQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHDT0CRA9TVsSAnZWagAAO4kP+QHErBfKaFML58W36f+y\n/I3OpS9AD7YnFqe6ah/X/rND3PquIiyG79mwJM15i8hJN4rxtUBxoHgMUQ9a\nOosaGYcnAi8OWhs0kZRKKKn+XY4Zqq4urNO6uO7NkOMkQqw53n67CUKHvK2Z\nk0Rnq1TAr8OC8/CxIJiTjWMjrvjJj7Y5LYPi987fluK52jtgozq/9fGunpXs\nK/VscL8zLRAh0jP2dk5SHrbCc/zRF8FkE+b+n1vdL2IoGQQzCkgUVbB5vuoC\nqhrSSi35L8vWP1vFzAbqlaSeNYfN574IRd1COWagzquQySw6U2XWwP0UaKUN\n2JZpAnyEeNPcic54ANwQ48rvW3hBIeuw4PnwOA6gWxFr3NQh9em7fYzariT1\nYy2/Qt1L2okUnDMYEzkfjjPKofYwJudrAIUEK/LmxEhTpHKAn7y4jNOorn6+\nq5KdFPSqRhXNqvSS21nQk1RGwZlBmmcEl230j4jZPIF/rUagjMRR8uyqF3F/\nJ/EfaIDY1NgypD3JHtz35vSiLC27DsA52NFDohAJAtoxY4/GuYU/s0h6h6SB\nQcOnxq2UTJqtThD4mkAhhD02pQyLLs2ahqC00GsEPDFufi1WGqXgzwdNxQqv\n4wxIqzPkfPgxABvU4qRG0ScbGDspUkuoOYu2MYM1RPKyBgnDt9UAal3UWWAZ\nD8qb\r\n=07/T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4c2c9aa7510a4854abb7f568046a44631dfe3e7e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.1f9259b9d.0","@material/rtl":"13.0.0-canary.1f9259b9d.0","@material/base":"13.0.0-canary.1f9259b9d.0","@material/shape":"13.0.0-canary.1f9259b9d.0","@material/theme":"13.0.0-canary.1f9259b9d.0","@material/animation":"13.0.0-canary.1f9259b9d.0","@material/elevation":"13.0.0-canary.1f9259b9d.0","@material/typography":"13.0.0-canary.1f9259b9d.0","@material/feature-targeting":"13.0.0-canary.1f9259b9d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.1f9259b9d.0_1629238516691_0.588098150506523","host":"s3://npm-registry-packages"}},"13.0.0-canary.3b9290351.0":{"name":"@material/tooltip","version":"13.0.0-canary.3b9290351.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.3b9290351.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3bcccf69581273fe52d85d277760ecac5101593d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.3b9290351.0.tgz","fileCount":34,"integrity":"sha512-pW4YClMSGAjT7gd98mm0ge0M1MKrwqjwXoXEFWFXV8MR57NJW2K4YGGhbHoL2Hd9+OZWHchVFmHhMTA+nm3E5w==","signatures":[{"sig":"MEYCIQDRiDksTsYEYt6HhSYJlztlGeHWMfdF7+/t8HN2AwQ26gIhALMa+z4jXLQZMRf0r8MloQmBHJoU7PoO6Cu3JLpNju6h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHJm1CRA9TVsSAnZWagAAWWkP/0nsCakFHrN7PJiqmhH6\nQdSdps6M+bl/AdWo/9W03x7b3XHAdE5JZptxkcFyxihtKTVFWO8DQgXS7KaE\nqs5Pdp7IYPLlj/LFtAMHuPt+4wPJT5VuwgMpflVy7WxFhgSsFd9TrIIVSEqz\nBLaNvfOkLILyJ4pQ/dzw2VmXnFHeaOjKaVNVJrvLVkiyJ1KaJnAYhhvQMjne\n2r9lRbRMLQ92WA2RhuoCHIMKQqDKpYF8N7oM9gKFpiFnCobH+MHKlfsFcYTb\nUoj57tiwMu+9qzF7mM5IkpV2lv9xHlsIuiHj9VfqQ2aAgm4sG7JYCcB1gWpf\nMxhIxB3xz0VV/wmeDaCyMd+hKlzsRlcbTPQUj2eT9MQOSEJonCppw+sz8/83\nBPoNIdzt/YvUJrX8TthHjnSIiSAw4Ri0p9nTtD9dW38cQHLElA7Y4n7DABPZ\nlv7JUJ8pg6nR/TncCWKQAXH7R3hqTVVcVioZEn+ZDv+Zb69+MI/xMmRTTynZ\nDiuebVtDyxKvFit8DIcLuZ+3LQmuHx+9RFNjSa5sZK9CBJuQveeesVEpnRqD\nxFr0Mkb0SJ+WxRndTlhzBcWay5VbNmTYCLcA7dLcL37o2Nqmy+MnPEzljVFp\nCtGt55zcTX8wRwAVrruIFqAIBKpiYXSEmycO96L2vd+ukWwfXk3oNmu8MQd2\n+mGs\r\n=j+cM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"15fe006947f65208dd0e450f8cad53d361b2930b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.3b9290351.0","@material/rtl":"13.0.0-canary.3b9290351.0","@material/base":"13.0.0-canary.3b9290351.0","@material/shape":"13.0.0-canary.3b9290351.0","@material/theme":"13.0.0-canary.3b9290351.0","@material/animation":"13.0.0-canary.3b9290351.0","@material/elevation":"13.0.0-canary.3b9290351.0","@material/typography":"13.0.0-canary.3b9290351.0","@material/feature-targeting":"13.0.0-canary.3b9290351.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.3b9290351.0_1629264309527_0.1336141798749313","host":"s3://npm-registry-packages"}},"13.0.0-canary.43d2eed2a.0":{"name":"@material/tooltip","version":"13.0.0-canary.43d2eed2a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.43d2eed2a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4134535c3c3145c613b1f1c4c375223b3f23d5c1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.43d2eed2a.0.tgz","fileCount":34,"integrity":"sha512-VRYxcgIkgzkvr95A3zyJ1lX93ZpwAGUXOdNp4tm3HloDwVha70H6svKLHvNmYJgiIRPcy+tY/Bcv5anHcHCJtQ==","signatures":[{"sig":"MEUCIHkZRehr9duavvGoiEadFGXZGDSgZp0JrKQsVvar0gDhAiEAtLEbSa7fMwhtANTHVhb2zg/QhEcLw0RgPNwJwSklkkE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHS9GCRA9TVsSAnZWagAAcLgP/0FdUKDfI2DW/FukgCwf\nRsTnaVLMFtE+1jHVZXsE1lCgIZg/flcfI+tf4p8AXfTeeowVtuuVew+M8pzZ\nbhDk8nYjWgZ5Wi4tDF2SPKfP1D0/Sh/FvAxUh1JhImunFIznPTjNqVAlOKze\n6HgUJHJcYED2jphaMPIH/bD9kNKRrak4HoZhk9KxSAxo6p5/ykvkSiH01EZI\nBaHaFuF7dWCKREcKomqbwC50NgVayjiW1gzNA2725H4NJiKrVe7oAfYmt7Jx\nE2+3KJnDChtNRWkdmHHl3yZCAaXt0v5EZnCA6sZ9NkKoSpbq9GzZDnNYwf+c\numEwkrgSQmTEuMRedffBzAiuBlEc4/yy8OMFJ07jJ3IGjKuYvQDUiZdg7ch+\nec8zzDR7itrNrwuVrrj7ZO1ZDqF8NNfVCkILFkDnt++jLWuxuseZSE3uDUnH\nlWpTfaY3X6r4Fmva6bF82KbXzFyi05wjr7hyR7s4HC7KK6o8lFQM1AARpi7A\n25ZKrVxIhdepzUWxdYGPxg3m9iT6aGvffOIEZIxzDgGWuHgeuxE//wN9nU16\nsAgSqWkjNPaKTt6unf0qAggzSC7GrIdDpVY76EvzNpLPsSXJYODRcK6s8evn\nb+iHl43nJjWn0uZQr0LPVgwB4R4CgzPq/qehk9rqlgFUrQzbzN7QoHEgB9Bl\nxVOF\r\n=nWua\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"687e2389ae76da9a31b26968c0cdd837208d3359","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.43d2eed2a.0","@material/rtl":"13.0.0-canary.43d2eed2a.0","@material/base":"13.0.0-canary.43d2eed2a.0","@material/shape":"13.0.0-canary.43d2eed2a.0","@material/theme":"13.0.0-canary.43d2eed2a.0","@material/animation":"13.0.0-canary.43d2eed2a.0","@material/elevation":"13.0.0-canary.43d2eed2a.0","@material/typography":"13.0.0-canary.43d2eed2a.0","@material/feature-targeting":"13.0.0-canary.43d2eed2a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.43d2eed2a.0_1629302598139_0.7176717905277679","host":"s3://npm-registry-packages"}},"13.0.0-canary.0a9069300.0":{"name":"@material/tooltip","version":"13.0.0-canary.0a9069300.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.0a9069300.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a47308192dc53fbccb2f1f82d836c4a227ced83c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.0a9069300.0.tgz","fileCount":34,"integrity":"sha512-DHSFte9aBSetVgNX7TATSo0hmdH9AkTCWh7s+/+MkzkPD4X3rAPMbcOaUIMte/N4W1yG1lLaaxceGAesSBGtng==","signatures":[{"sig":"MEQCIAJTuivdEs4nQW347cTp23UmZwlHDLiICJQpNsmLE+OtAiAHt90h1VWbh966OYnhuSBKyzCzGT1kidCTXcXDBlVWWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHoRpCRA9TVsSAnZWagAA250P/A976Cv/YQFUYhXDX59e\nTi887MT+g1dIOgozMG1uyV6ihdsnscb3wN5FqPrDcSNyPK7x/pUyktJJq6Go\nL27myvU+LIq+RqJRTqKZq+QnwYfB1lF2c1B+7jyFauSkiWYjeBjeeNC2F1gH\ndW7fLIZYQOYKjwZcX/MVK4pLk1Je9QQiCbo3D2vvm9sOBH2PUlbiSXTdZICf\n9Potn4zomFtCe/sAvuDyR/tMYC3HGAbTLWWvZ7VcMrLNMkIgwr4XDKSnrVon\n2SDeVKLD0vYwvVin5kHNu6PPV6IkVTpEWIWmWNUHlkuTS5j8Atw42ls01lgZ\nnlaFQIq1IUKROU05y+k2oVQGw6jxBERP6LRCWOkDHKbAdGSkOpsU+oZSlOyw\n+O1sh5YCcpSuQVV9ApV5xpjJHDQkDnQv1zfdTM6t2clCEg9GqqForMfmjeGA\njdlk/eF6gZ9IBzYdEoHTHpjXC9PfTeMvnEqzil360AHFUEZQQ4Gkid4MZTKA\n0juvwNUgvFBiVuAntav2pcNDs6sVUPBtrdta7jUdUnarmpUZEgcqxC156mZu\nl/tHOgrU0TMHwmKi2yWPtPxNsiG45HXzQ6YuX0tWxvDOiimfS01RhVdWe1+L\n+HdaPrpIoestdq+xr7zOmy1CxmFdEefSXKtg0hp1TpDamF1gmAxhqfC0JoFL\nxTdA\r\n=A72N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a7249c6c2dd2d786b2134e129bbe3b4ca596fee1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.0a9069300.0","@material/rtl":"13.0.0-canary.0a9069300.0","@material/base":"13.0.0-canary.0a9069300.0","@material/shape":"13.0.0-canary.0a9069300.0","@material/theme":"13.0.0-canary.0a9069300.0","@material/animation":"13.0.0-canary.0a9069300.0","@material/elevation":"13.0.0-canary.0a9069300.0","@material/typography":"13.0.0-canary.0a9069300.0","@material/feature-targeting":"13.0.0-canary.0a9069300.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.0a9069300.0_1629389929720_0.4445190272102395","host":"s3://npm-registry-packages"}},"13.0.0-canary.7da413ed8.0":{"name":"@material/tooltip","version":"13.0.0-canary.7da413ed8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.7da413ed8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8f87d17f0f3dad45cdb86604293a2d4f2c39f60c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.7da413ed8.0.tgz","fileCount":34,"integrity":"sha512-bnv2ALvmU1m0tbEIUaVzhxkr8WJD9o6/aFmR8461Xz7Wg60pFsj/cNoUKt17VtNchbQZagKgSvWlSOkeif1cFQ==","signatures":[{"sig":"MEYCIQCuG7jdgaJ3ie9ZdnOLp8lD7qMrKOPm1PZ9gEMtAB0OxgIhALU5s110CDbIHGG1r1nIdId78YEOlVu2QNgrrpaiAfOy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH88lCRA9TVsSAnZWagAA0m8P/ROqncX/b32YRuiSvTGY\nJoq/EKAfcsO+0mZLenfFeJn40yCjuf+Ew8BAU3QIcbF5mG+tXklprYqwZnDN\nEvXHqRZAtmlRw5kGkNuot00v7KwRr1Y0bWcOjGGhtjPLcfDFm+mMSZ7vequZ\nbCOmfgupMBt5USyX7RUfh++zp57s9DklskHGM63A2csLH1xwO3vlyKGw1XFb\nzblT8HgIYjeRKHk/0BGDCotOv00gcLfchoflFe9u88S8XfTeblOt60AZ0rzq\n+hva9EWTjQbkNGhYAw2tNjpbBgxjG95bPXyYAG9IoHOG0DaYHEWXqB3A0S3S\n3BIlHKl2ypniKPJy3MB+iNyZ/+1QlhLlpc0g2uuPPGfZHytOaVqHRvfKU48m\nyPBPdT/KKZG4z581JdYgXV1mpxW0XrmvXgXE95XE1JUe2qynjpF46qZ/LMIA\nNesVMbyBiDkee8JskTF3TJm+SGE3wjj2UTGJ0UkAr9xWkczLDKGeeSQKwms/\nPwBmlPRC36P9RWtaQOA4iBDAG2dxGnOqOgpiX4s2DFlkv6fHP/R6vHBPj5Pg\nv6E1z32VL94IPC8j7PNJxi/M3W8VL0Fl/uXiLeutGqKAfAJS73+9AfN4CCZy\nP3WGmyLKlEDxclOH8+O30uZfUhz/vVQxDfGA5chE/UVp6FIk8JZhqxyMCRBF\n7Jw3\r\n=yy8H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"66fc8a91fb533a43e898483e7c4e1fac92aa0b7c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.7da413ed8.0","@material/rtl":"13.0.0-canary.7da413ed8.0","@material/base":"13.0.0-canary.7da413ed8.0","@material/shape":"13.0.0-canary.7da413ed8.0","@material/theme":"13.0.0-canary.7da413ed8.0","@material/animation":"13.0.0-canary.7da413ed8.0","@material/elevation":"13.0.0-canary.7da413ed8.0","@material/typography":"13.0.0-canary.7da413ed8.0","@material/feature-targeting":"13.0.0-canary.7da413ed8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.7da413ed8.0_1629474597436_0.9375748121261034","host":"s3://npm-registry-packages"}},"13.0.0-canary.e1e69fd8e.0":{"name":"@material/tooltip","version":"13.0.0-canary.e1e69fd8e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.e1e69fd8e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1ac5afbb81b5da00553585d987f9660d6618d883","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.e1e69fd8e.0.tgz","fileCount":34,"integrity":"sha512-F/XmaU48aAPpkqbXOwWyanXKKHgzaeHWtaGcAanMmzK+CIpGtrmph7gkUrnMZnTYiWeUlT8DovXw1wrMGxtOCw==","signatures":[{"sig":"MEYCIQCVFWLsvDFsmVuqtjLxVxaAYBES5/Sn12peggxmRuNaLAIhAOZPzeb8IjzF8kXs/Jwe0U3BL06US7UWtOm+rGEUUs/O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhIAN/CRA9TVsSAnZWagAAdIUP/3qiQfvH+jAa8QYROBp3\nKsBd+782KCRtY3+OB/ZjFW2S2/0ziG+QomtGe2aumkPKeQlMbl43y6Vg1KAZ\nxd6/a378vZv/58bEme0vfh75INoNnfvRaWjyzkfcyVxf1723vQhpwRqzZz7z\nmDQ+t41QVCXwDaRx1a20RTQ0OS+auXNEmL3lWFk7Rte8jgOpqbXBTo1vCQ0U\nRgjE7aSwSEeipBvXlTJ9MqGfktUoKHQEnBmfbS/6GCh5tcuez/EhotOj/abo\nUB0v1keX/FbL6Is170+bBv8gh4HHfMry9dKJQXbghPkwzW3LflCFBQtA5wr7\nltFTgRxDD9i5FWk2J9fIA1mJTAbsDe6FUQXr1cHmtQb8ecSGKhjIF93LvSUc\n+BevbAyAGgpLsi3CzI28D1JxKyYKh9B69UkYd5F2E2Wi3yY4b9IRyo1EPkRl\nykHRDo9SAze3yj5r18cESJ+OH3UcnnM1SiZkCBxHAdHgTsmusCKR75mhnUNH\neIzceuC/it64mO8t4HYxehobdC+qKpxz0F6TfcO7WrO/SA+3QPXdWvTs46rS\nztHVqe3X5m8h0O/6+3FqiYgfMsoQODXS8m/Qgv41IoqvA9F7igIeaJu/TSgD\njrETKzKnxXHlhxHn00DIrHC7AH9gSaFc3Z8Kf/OqBkQFXiiBIA9FbzZvjOgT\nF5Uj\r\n=IuGh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e400b9052366c6e1d6e27533a72ad00199b6313e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e1e69fd8e.0","@material/rtl":"13.0.0-canary.e1e69fd8e.0","@material/base":"13.0.0-canary.e1e69fd8e.0","@material/shape":"13.0.0-canary.e1e69fd8e.0","@material/theme":"13.0.0-canary.e1e69fd8e.0","@material/animation":"13.0.0-canary.e1e69fd8e.0","@material/elevation":"13.0.0-canary.e1e69fd8e.0","@material/typography":"13.0.0-canary.e1e69fd8e.0","@material/feature-targeting":"13.0.0-canary.e1e69fd8e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.e1e69fd8e.0_1629487999666_0.4877957531498438","host":"s3://npm-registry-packages"}},"13.0.0-canary.f5afc16df.0":{"name":"@material/tooltip","version":"13.0.0-canary.f5afc16df.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.f5afc16df.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f816fc6803bcb5e2287abfbf6b433a5b5de14c73","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.f5afc16df.0.tgz","fileCount":34,"integrity":"sha512-4MlNEBhWXJHWbZANv6cz80He/00wcQuF/AdPu4lZOs3RYY+D5s9lZ23Pm3pbAbnQh9L7iNhHlT+LdFkbK/LFiQ==","signatures":[{"sig":"MEUCIQDQ/YcE0hVtquQpp6iST6qK8qP0VQOPLDPq/wDvUWET8AIgbMA7stzbkoStTzlPVWm2izRdE6X/Mf45YaA5fpQCSS8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhIBA+CRA9TVsSAnZWagAABwcP/2fidmEFiATnZGQm4WiY\nOdc36WVYNIr5cL1xHbLE6U+6CWyJMY1bBxpEWJzBoBqYSYW6hWjiCVDoAwY0\n1G+og1k2Hr3gXpEKUJjTMH5/OGfJogCXZ3osC6vB+cNcdl9nLIQA7P64FsVp\n11oukVSZjIsj4GAoAELKvcby1a8iISqN5pgdmHTg/+GTlL7Z1eCLdGPCHwiO\n5uGaSOVW3KXNRmoWjaxJMU1STamU3AVjdoGXGYyYKVs1PrpqGesKV2cvuguM\nFWINoyQSMhqeKP4/onYC4jdwk5OXrAGXHTFXH8OFsfzIz56cPE/+Eik6TmHq\n9Gsq5k7YTUJJhadf0OiZLi3bqmOFQes4KkggAIxq2J3F/Md6prdobIl39P9C\nVY7aTyM+lFP9AuVCbFjMAyZhlWZis6UJdgvOVaFxGM2AI6+6sTo6VjdE0cBH\nu3kbne+OJlOYJa4X4OcqJyvnKEUlUzWzXUR55qihaOHmvZ0AFLHNmRD37i4D\nQwvb5eGiv2BxIat7VWCFKLLOb8ofDNTzpfcQPvIBXUWi20pvHKxwaq3M507m\ncbo8xLlw2HuHYsKeOR8m5Hzd/0AkRwgdA/UpXLDgoJkrYf91KXfLCxnpVny/\n5M9wEfED1QbmHub+HtY32FhhoH/+ysEL8rtYPpLYHyqEgoYEjWbIzOpyZ13A\ny3qm\r\n=p5+0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9a5934ef5d223f46f61452bee68b0b45a21e20d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.f5afc16df.0","@material/rtl":"13.0.0-canary.f5afc16df.0","@material/base":"13.0.0-canary.f5afc16df.0","@material/shape":"13.0.0-canary.f5afc16df.0","@material/theme":"13.0.0-canary.f5afc16df.0","@material/animation":"13.0.0-canary.f5afc16df.0","@material/elevation":"13.0.0-canary.f5afc16df.0","@material/typography":"13.0.0-canary.f5afc16df.0","@material/feature-targeting":"13.0.0-canary.f5afc16df.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.f5afc16df.0_1629491262276_0.841782425436566","host":"s3://npm-registry-packages"}},"13.0.0-canary.28d0d75bb.0":{"name":"@material/tooltip","version":"13.0.0-canary.28d0d75bb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.28d0d75bb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c047b3128cda362a22a940841579b76746fdc382","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.28d0d75bb.0.tgz","fileCount":34,"integrity":"sha512-6rVBoZR1j23EmM8QGEv0xqYj2cy3G7QJUtf8vPXN3meJonbCCaLaFPWztGxiCkRx7LdJQYBdfEjc88AE16WJKg==","signatures":[{"sig":"MEUCIQDUvvKCPAJr/mjPCQnw38vjUTaKti2j/HlDXO3Ed/SvBAIgF8vbdJHo50w8Vl6Shpmm7TLQA1mKtTLUvwdJWRiB5pw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhICrhCRA9TVsSAnZWagAA2HgQAKL61wmZZipVh+2DjeHB\ncA5nzWxNjRf+dqUH3Ovn9fcEnBDAlI6KCTI2byqayoPybq3hXOG9vbioCbcq\nvlQgVV1zyPOpGxbzX9fjWNRn6vm3TKjeZ3MNpU0ikdyHm5QtcCjelT/DW6jh\nwu2xQwuBQVOYWsJR/nNMLJqI1DWqBWpnepvN834cmvDhFe2iouFIA/42gUcV\nzvKuPmB/8WiKlcEOQpik5ZN6g8ye2XFfFm9lGV0r5LCUsnaupcViyqnxvUTi\nTLZfWqiD6zzKvWtY6c9N3JItJwmeiTJF9gczgLpKorMN1IrBQzGEv7mJ71jo\n7QAZPVcprAJ7Bcg+Lg4ZnZlubR+P4Iwa9wwos2uH9WvHZE8e81z7gNjCUB9y\nVGZMwA8GqK607uHa31b3INPqXiiD9e0a28Z8UPRZhPe0ahux0UaINhgWLWw+\ntdmdebgHekziSDyEAeZTFu7zwcwpPIKeZuYgRIhNBPdVHK6HDNn2JSXA+YP/\nrki8kr19oIII3UMdvdwTTNYojG74NuxYCdSb/IO9LBFk+1NqNI5YC2GP83bp\ncmZfFsPo+PVZaWBy67WdC+YNd5cxvZG8YTfaESfwJSwCJmJu/4ioX1N4DrYO\nyBq/R1E2kr7h9kYDkd8cKdycAAnQ8NQvDYa1jqZf0oPaEQCMEhw6iWCySHpD\nRmEu\r\n=40tn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4becb1aca9e878d432cf8308ec0f14cc50e9699b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.28d0d75bb.0","@material/rtl":"13.0.0-canary.28d0d75bb.0","@material/base":"13.0.0-canary.28d0d75bb.0","@material/shape":"13.0.0-canary.28d0d75bb.0","@material/theme":"13.0.0-canary.28d0d75bb.0","@material/animation":"13.0.0-canary.28d0d75bb.0","@material/elevation":"13.0.0-canary.28d0d75bb.0","@material/typography":"13.0.0-canary.28d0d75bb.0","@material/feature-targeting":"13.0.0-canary.28d0d75bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.28d0d75bb.0_1629498081220_0.777531611598357","host":"s3://npm-registry-packages"}},"13.0.0-canary.21ece5360.0":{"name":"@material/tooltip","version":"13.0.0-canary.21ece5360.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.21ece5360.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0a2e35958383be6ffd67adada7dfb2e4b8434264","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.21ece5360.0.tgz","fileCount":34,"integrity":"sha512-aJZMHg/fb/rNUcmnO89+Ftr6aVzrNGnuqacJVbGaRYLXP7ho3qTyRjd4J45fQqqT+6ZBqo2axYVnLPo04Pr6Cw==","signatures":[{"sig":"MEQCIGrECnQqv90TNKmvyXwcbHpOF+KYMAsrREsqcIS/ft2nAiArwYLlhpAc6fbMTWo2XVprsRuMtHKO/AwRPlTBofSEXA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhID6QCRA9TVsSAnZWagAAKSIP/3FkSP3i4vsbczPSNSse\nA0K2o9Vc7ibSuUXCQOYX6v5lQBMeTbRhwyOY+sdiQriscF/3goTjLX48GxYt\nDtf/EoxLpx/c+8Q2Txky1SwViRRSsoYnAu9f6apOCUpt64zpK4Gw4YhaWotv\nBBAvDsDBTBy1Nucu+Blxg2Z6xBHvOdyoty2iCiCUthDX+6bDZm/n4p8oFg6L\niCeH2PZiaU1esCRIYzLA901/qHsaQqFknyrVfO7X4UwGBKw1tYBHC6i7Irjm\nqJbgeZqvvqAEeTCc17UQrKyXLj6hXc3IkyVRSbG+Zhofq9w2RDWQ5RzWD3VD\nUHMb5m+6yDWWBIrfQEnbx+U/A+g8Ye79tlvMushBPLSMgPsH/87ydbaCiHar\nTjvi23UslOV/SZFQlvDTW8EVParq94I6F6pWkLagjCmmvmcmCrp5folnNWNw\n+IngD82OEyqRv8SVt75Q/dWgz8y6z6/nj+fyIANNUSleQHKFiRxQWTGs5tF7\nLXZf0HX0m9s+Nxw0fXHwVS2PqCO7md+fMJ+l9b96xckG9Cq9f+b6SH7gshgq\n2XIzrmhz8lMxBp/tYPabU9R++nwlrx5zqdqwwpE6SC1dM/pnKG72oBLO9T05\n1YUw6EI7XjXq2P6g73G4UMVvnyZod7N9TL02WU5XntX2NfGxp5xV0RbOrjBJ\nN/6P\r\n=QVSD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9625caffe59fe4a84aea358993c2811ffcf33e74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.21ece5360.0","@material/rtl":"13.0.0-canary.21ece5360.0","@material/base":"13.0.0-canary.21ece5360.0","@material/shape":"13.0.0-canary.21ece5360.0","@material/theme":"13.0.0-canary.21ece5360.0","@material/animation":"13.0.0-canary.21ece5360.0","@material/elevation":"13.0.0-canary.21ece5360.0","@material/typography":"13.0.0-canary.21ece5360.0","@material/feature-targeting":"13.0.0-canary.21ece5360.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.21ece5360.0_1629503120810_0.4144413360252568","host":"s3://npm-registry-packages"}},"13.0.0-canary.8de07c02a.0":{"name":"@material/tooltip","version":"13.0.0-canary.8de07c02a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.8de07c02a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"55cd4feb8f21220defa26ca1dfe57dbe809de229","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.8de07c02a.0.tgz","fileCount":34,"integrity":"sha512-HqYSGCxa/aVo5lHI7jDFGLH1kYLlbK5YDz4+7ZXy7dEgJ+JNrfJgEsv3dHj9GNgN8TARMn80VUIi5IDFqXVtIA==","signatures":[{"sig":"MEQCIEIcrKvwNEq/7pScHb67slCYJ9t+LvTVbHelZ4cKtBlfAiAV4Y8H0ZlpE7VUx+L1lIuZWA4pIPZhne9QGjOruk1y9w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhI75uCRA9TVsSAnZWagAAPLoP/iKOouI8OEDgiqD+yTJh\nhFe9DWztJ4PBuwvwIfzUkX7ZkOE+I1lrQtXcin4WTvSysvF5x0gj05Z2sDg/\nPXvNkyZNmTTKaBvvxsK2FHbrIH7iTLxS1T0HZdC+VKMNv1bF8yzUrg4MI6U3\nmYABrJeZWG2bKNlHRRJeXwK1Wpp+5QbQWwnGb13OsC6Mc09biqWBrGFjC4yj\nNg31bPoPhg2fSOLf/y9FvgENxiSVjPh8YifnaAvfGt5eBu3TJrKIRtTuYdch\nihZ/sxcMtULMX2+z03XhqcwkHEgXFt7TLzhrb1oTqAL1wsabako9Ch9Ya7vQ\nJcaAryUdcc3rAH7RjzZeDAsM0CT6/xdhcMswIaKnUQ56pBy/S+e9h1tze1FQ\nS8POC/iEg1paTKa6t7S8t9QzG+f77uFYmhat2xq/yqlxC/fw01X+oDr4ISQX\nPHRQtBYkvuv9bH06o47XJp7SM1mjVG/k4a1ENcEp6Xl4Hjbhu0xjp/6hnZtw\n/0iC9TrDq/6hA5+hMv9Ui5aFJRu/kCpCMNCFHvzAfAJXz1y7FOGFZjQrBJY5\nCgfX4C8ec3n+HCUnb6BjMInE58UCCfw+45HhQRDc0AbYy9q0V8fCIjDBaoc0\nm+4tarGw+PpxSJRLNPCOyj5p7tt2YO6HtI+D8WnV9D5KyTsob66KQV/r3qJj\ng1MC\r\n=tFDr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e55081eb44f85de06afceb7c0d189f0d358ad60c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.8de07c02a.0","@material/rtl":"13.0.0-canary.8de07c02a.0","@material/base":"13.0.0-canary.8de07c02a.0","@material/shape":"13.0.0-canary.8de07c02a.0","@material/theme":"13.0.0-canary.8de07c02a.0","@material/animation":"13.0.0-canary.8de07c02a.0","@material/elevation":"13.0.0-canary.8de07c02a.0","@material/typography":"13.0.0-canary.8de07c02a.0","@material/feature-targeting":"13.0.0-canary.8de07c02a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.8de07c02a.0_1629732462423_0.6103021778972642","host":"s3://npm-registry-packages"}},"13.0.0-canary.65aa63b0c.0":{"name":"@material/tooltip","version":"13.0.0-canary.65aa63b0c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.65aa63b0c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e86d467a3bdfdbe1ee1a269a9e722b7a3251a447","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.65aa63b0c.0.tgz","fileCount":34,"integrity":"sha512-R5ZGCnmpL/09Ejzsz8JF+BsHhaufHeFOC/6B2C02rE2gnrKG6KhrLfHagtEVjqy21SlqIYGhOzSlsBYCyZEWQg==","signatures":[{"sig":"MEUCIAzFs2M/zxrtGx5lWcAZezA7WtVdaQ0drqEQxykbx4blAiEA7CFOPcT8hiyIxhRG1iUMC6Uh0mu6MSq2VRC8wPBTlxM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJRBrCRA9TVsSAnZWagAAQ3sQAIq61vVr3EKfXcbY98qO\nLy8kGU3cvBsJwHZQJhiRyXu3nEdATcO0Nt1Pkm/gF1mmDh033XtH6ONr3MvS\nQ+rLqnv4MRqii7y6vMlduwdGO8F2CPtORB60kzJSA8i6G+QD/S9f7qfoMyRL\n5ns66/XDP2hGd6DUzCbS5j66/DLBafwJ1FyDBQjUB1Jj6O84tz6fRMZZHaHS\ni9wcefavS1fNHofHrPO7B/ICVo07Ovq7VD28Iq7tDY69EZR0IAFhQyOTNNiC\nzZuk1RFahEaBYodprKlZiFzjpJW4wsO4tw+iG/+hHIFO0qIQtqGt/8baw4li\nOHNl7rFHFjO5s9YcxYm3JkY2gdxXRWy4o/D+NBmA+88Y6HMEXxtGFsNZlBxl\nTGYRSjTQm6/29o7SsqMNIH9Uxkw6MNb/0tkl7sCJDBat7xhs8Sr+186DnX1R\nqjgV66guC0M7W31cvzevYArWmf2CNhHP020M0ppiz1UsCWT9tvuFpZduzf92\n8J4gG83zoXBuDjc8t+aAAg7YcFTl4chQA6rA9sjjU7j160kpFtsL+KEFTm52\n2Y2auGzNZ9sVEg6GjW8tzMOJ2MnY33Ac6I2K7/W+W96ckTkT2pCGP+Gbsk9u\nUB44jo71WsnliYDgGG7JiJL/rFv3o/uMTvOHvMV2vohge+bspIwpZcGjt5Rl\n22Ys\r\n=ch8D\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0ac2dcf03064da43ca7eb352045fd4da0af02200","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.65aa63b0c.0","@material/rtl":"13.0.0-canary.65aa63b0c.0","@material/base":"13.0.0-canary.65aa63b0c.0","@material/shape":"13.0.0-canary.65aa63b0c.0","@material/theme":"13.0.0-canary.65aa63b0c.0","@material/animation":"13.0.0-canary.65aa63b0c.0","@material/elevation":"13.0.0-canary.65aa63b0c.0","@material/typography":"13.0.0-canary.65aa63b0c.0","@material/feature-targeting":"13.0.0-canary.65aa63b0c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.65aa63b0c.0_1629818987429_0.43198532748396956","host":"s3://npm-registry-packages"}},"13.0.0-canary.15981e9d9.0":{"name":"@material/tooltip","version":"13.0.0-canary.15981e9d9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.15981e9d9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"465c350918df19f98044b159de4f898587f11e4c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.15981e9d9.0.tgz","fileCount":34,"integrity":"sha512-siaGPKrylIALz1dSyzfwoEHGUhYAXyZYVXMGgDkZ57abg4OMzjDctcVHkdHE+kzMXRxjst8n0OTUKxIF31jDzg==","signatures":[{"sig":"MEUCIQColJzd7V8vVQe+aAterjYm4jJErLxJ679UdZekCLfGsAIgTc/hPYGeJZ7PREV/TwfC/oTT4AJzR2cJ3foMrkZSpH4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJRvDCRA9TVsSAnZWagAAX18P/AgAwwfodsXprqB0Fsvz\nmbHAGPv8HDsj9nb/xIAL9USF6wYjbUsf+ucFJMp+K+xbi7n22p0Iqk4OdPf/\nvFmPhjZn75Gq4bZ03hifZoERLJpPZ+8yKpABR2GElIawwa+A98zBqoSH2EnP\nsjNO3PSXtJJEZgCI6uI19vCqTZmYAKGW130P3jw5M1WHk7o/g9zsppm0y1la\nccOvPCrzQNzlINNegfnJY4dVVRBLqjpJ4DR727MO42uTo2KgjHs34rlqXl94\nFChOn9y8d3HpdDODexhInC3phX+1Dp01CMQ08RjaZS4w1EbKZMWOIQA/DBaI\n9ojXlnP3Rfo9UuE3jJUO62Hqy/mZk8RpsoMOADSoGKBrUbUusXpwWKUxDJaE\nc/vTT4VttsbxeiY4ISUghtLfUfKxQ4ZUmYh9YAhTqN/eQyY2cWmXwByMW/Nq\nKHYies7AYcmH5HtPlFo0M46gUghXrhd53GMA3sU098fIIP7Ur6lDd79Gi4Xk\nf3uZGZ2uwQCJfwQv0dR/SauIlKPLq7T7BHXsTS5QLYEdxpQ1IaTCNdEakxM+\nq9IAgakWKkvnXiWUwReX8lSJMZ44wzCxmUzCOhmR28hJ6jLCluSSBBK4biKc\nDVNTzj7T5HDIh2yq95xmApJPajw5BAvEKzvnYBw0VlRE4zNGgcnoyhfpWV6A\nJzlC\r\n=c4uH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"93acc5a9963b30cedb03f35eefb49cd35c93656b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.15981e9d9.0","@material/rtl":"13.0.0-canary.15981e9d9.0","@material/base":"13.0.0-canary.15981e9d9.0","@material/shape":"13.0.0-canary.15981e9d9.0","@material/theme":"13.0.0-canary.15981e9d9.0","@material/animation":"13.0.0-canary.15981e9d9.0","@material/elevation":"13.0.0-canary.15981e9d9.0","@material/typography":"13.0.0-canary.15981e9d9.0","@material/feature-targeting":"13.0.0-canary.15981e9d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.15981e9d9.0_1629821890975_0.9638791339066322","host":"s3://npm-registry-packages"}},"13.0.0-canary.fa7520f62.0":{"name":"@material/tooltip","version":"13.0.0-canary.fa7520f62.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.fa7520f62.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dcba4cffd9139e4973df819cc64360d64ec92391","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.fa7520f62.0.tgz","fileCount":34,"integrity":"sha512-T4QxBtLsSHzHzy4wvCF8xHp0eAiKjivSOQguUT0M+1C3rvuZGHzLyThivS+caxC3aI4asV07m7TcQuPV8mh0qw==","signatures":[{"sig":"MEQCIGZYHBKXKSenJ8Q8srCmLpmSsgK6ayq/Asvy6Ngn5tuiAiB2aYUBl1XEgY0ireJwBPVLo7Yq27y1tZvpok2SRFagzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJXKpCRA9TVsSAnZWagAAub8P/iEm4jzQ2X1ITkXhhlok\nVYMK8CGvvQ0Ehqs3Jxn5m45SA+JoL/iFcmw+txtt/F37BtiaGWMTnxB3rLV8\nIU6NXGBx8kpVBkUwbwA7nqXWhhvovqbTvACwODFcLdpy7osX+or40BmYE2As\n2lfAwxew9aGdmMhoDKvUYaYOuDlQejmHDWCSqpSOPJmsHA9ij3TfXsTxgX7d\ngZ3kS0mFvrOsxhpkqei9RfieljLNI2pXWsfkSoJkDJHgv7F0gvlI9Ids+q8D\nsTvMInNenXLnbSbyZ7ivvVJOZG05RPSF6cxjQc0K9ZjBCqRUmxtJSKUjPgl5\n3rSw4zHlXAFwVguUgC3fDxR3L/70iGA1TMTPd2/yIcevp8gVsOcBqalHdLgZ\nnmYzwOL8PQQ+CJhPqyy48N2moy/tKwfRcN2cdOnSdIluvlQt+gFd7lWnI4ZO\nAWW1xEHBTOixQLCPwKoickMBYuCJJI9OXDNOrNqRjB3XZobw4/F2Yw1Bh4a7\nWx4dtYsLV0LLYlrQ1u0vl7XwP2O0J3LBDLjd23LArCg8bJLO3q+eyLCzcyqY\niS3zXSty14kmojsc7YqmVu4xAkHyCgp4/0aKpVW3kMNx4nC7K4oRrIbyrKA4\nQTeWtczQzD3FG3ZeBEubuOu93Cr/4rj7Kke2Cx0cyd8Lk0hrE677TUK+0DVX\nKYrk\r\n=BQkU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ded8a7ce355618969092a7bffde0da813aeec162","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.fa7520f62.0","@material/rtl":"13.0.0-canary.fa7520f62.0","@material/base":"13.0.0-canary.fa7520f62.0","@material/shape":"13.0.0-canary.fa7520f62.0","@material/theme":"13.0.0-canary.fa7520f62.0","@material/animation":"13.0.0-canary.fa7520f62.0","@material/elevation":"13.0.0-canary.fa7520f62.0","@material/typography":"13.0.0-canary.fa7520f62.0","@material/feature-targeting":"13.0.0-canary.fa7520f62.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.fa7520f62.0_1629844137459_0.35209696265763046","host":"s3://npm-registry-packages"}},"13.0.0-canary.ce25bc3ec.0":{"name":"@material/tooltip","version":"13.0.0-canary.ce25bc3ec.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.ce25bc3ec.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ca3ea389e7b9b5dae198fa34a0fd306bda78651b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.ce25bc3ec.0.tgz","fileCount":34,"integrity":"sha512-xsCO3GfYhnT3VXi5sU8DSS8L4p9/cHgTlf3lMKa/s/lkuoTukPhY7qyL+Xmh9M6kr4MNKtOPxyVUqDMB+nX4TA==","signatures":[{"sig":"MEQCIEBFDENtAEowDenjNpQf5v4OIbILhpNEhE/+wXhA7QxBAiBmwL9dTKuEgqjSVpNmufoCh3QXDrbYzOZJDP1jRpqV4A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJXd8CRA9TVsSAnZWagAAyiQQAJPoxEuBnwBTOih3DnK4\n2DWkVd4X3HPyTarAQQOGtWxpSrj5fH/lI1OdLej15TlRcDJPCo46R8QxgBDm\n+/h/XtydVH2iyK2w4aCyH9MTtTzHC3rxMk+ii8QXFp6bB2FFXUGFXsRaYYC8\nXfV+NIuUfVmh5OeSiK0okECMKosRhux/K3s77qq22UnAZa7IOeAhUsmG4doR\nF5OEcJUoFxHOKzcuaWbtFLhwkoiDdp+BMgvI342mn5zuQWDObpp0rbOzKxfB\nXZeQysWz3Ct2Gf4t0IqQEYrmPCDbw9uCsv43wgq9QyOqFhOcavWp6qEZixrB\ndb3EcTX601DzjDZe05FBgw41TkBbSqDW+7rpdmimjUyGwWrHNvY4lOi+VwFk\n9ON1EvUcrxALBAnRv6+AN2aEUHW+H7mFMvwThyTCESnynhjUYkICEhmKE8wS\nf20L4oeziYY4q83Np6jMpswtECri2CTlZ1cxHVgnc9WPEGeMPaoAmE4SD4nX\n3sfVdfTyFmu6Lu/xWryGubIIWFVKki3cRNPL+XzH6pW335h7tBQhwHWICtM9\n/7/D0oZv4jCGq9KMkU/ihH2PyCqhWnMgoY3koP47cS+0ebSpth+av4ohOdZl\nAcJATL9vSVsLOP0iCvkoyQZGpWE7u08WOLhvJSRl93YBEs+/Pv9Dx+QjbdW/\n8TVC\r\n=IcKM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5296a1abf91023fbe0806f06b5b5fce528c40509","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.ce25bc3ec.0","@material/rtl":"13.0.0-canary.ce25bc3ec.0","@material/base":"13.0.0-canary.ce25bc3ec.0","@material/shape":"13.0.0-canary.ce25bc3ec.0","@material/theme":"13.0.0-canary.ce25bc3ec.0","@material/animation":"13.0.0-canary.ce25bc3ec.0","@material/elevation":"13.0.0-canary.ce25bc3ec.0","@material/typography":"13.0.0-canary.ce25bc3ec.0","@material/feature-targeting":"13.0.0-canary.ce25bc3ec.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.ce25bc3ec.0_1629845371978_0.5677297651406226","host":"s3://npm-registry-packages"}},"13.0.0-canary.12f5622e1.0":{"name":"@material/tooltip","version":"13.0.0-canary.12f5622e1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.12f5622e1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f8a0621e388d04056cdc0029e44bb95d50a35aa7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.12f5622e1.0.tgz","fileCount":34,"integrity":"sha512-TR69a9MZpTCvV7COuj8JZEiSyxax31z0Be9c3l0R1NtuddSoT1Qg1A5z6fm2uNpk/OjyW0Aahvs359Mgi34CKA==","signatures":[{"sig":"MEUCIHo8yY1NsWTQf9V/nogxsWo2nRmxUmRgz7UUNqjHd2lGAiEAsuasnRd5DODJac8uNN1ei0a56oHTEnpETCLEF1bk3iM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJX5wCRA9TVsSAnZWagAAqk8QAJYuaHt9DiN3cjJ/xdLp\nKxp/bNKFf7TdbMlq+EqqTr4McI7HPHIulnTzowIaYZ+g6vV6LvAm2IKsaowc\n2YftzNRJoYLcGaG6slebvYTWzqQyKvIhAGbNfmvJrAZvUEMTFUzbt5wwlwQ0\nVWSGOc8eNE0zdqnqm8aTcP0hW7ZxJGJd+uVdVaBYugu+1F4jEDBj0ODR+P/4\nS0eA9azuyahlyxAeIx/f49UjtTK2OPZ0f5y0MjUTn4EaaiMuZJclzTcdoblO\nlDbZt8fPyEO2lVI90s/fnDDAxKgzripNhQeiqFjQA8j4coCMRePIF0X/by5G\nB/PZ9FJMWEjNcQivxfKUSn6t0nX6OdvwxDRo6EBeDICebHGBsbC8+H3SXqbq\nm5AZiQOEv1lwH1NlPw0BiRMSxDqsz23RHZBQdQY7hxqRVroR1Mrnm8cf1liN\nGw2890p9fI7matpH4TaS1VH38drGDNPwaYQSJtygoyDnnsrLc1iBb6GwdW+J\nQviWVl8ypBF/vsU4+9KRKK/hyVKrEb+DNewTVcO5YGNuofb2l3CyCX+5Cxph\nqxZO5+AMHozjtMqNCxX84oWWGivKT2mDnxYif8DmjzxlBLJkPi+N4hZDn1+n\nJKBHNz4b/iShughqBw92kTD/jkZMYRaSpWUQiHxMOcNF8y+yq0ZdcvzuhnVr\nvwRT\r\n=bXly\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2cfeb72e6002a5f3cf296794da5216b3114fbbc8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.12f5622e1.0","@material/rtl":"13.0.0-canary.12f5622e1.0","@material/base":"13.0.0-canary.12f5622e1.0","@material/shape":"13.0.0-canary.12f5622e1.0","@material/theme":"13.0.0-canary.12f5622e1.0","@material/animation":"13.0.0-canary.12f5622e1.0","@material/elevation":"13.0.0-canary.12f5622e1.0","@material/typography":"13.0.0-canary.12f5622e1.0","@material/feature-targeting":"13.0.0-canary.12f5622e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.12f5622e1.0_1629847152770_0.11411070645283994","host":"s3://npm-registry-packages"}},"13.0.0-canary.d97f8f133.0":{"name":"@material/tooltip","version":"13.0.0-canary.d97f8f133.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.d97f8f133.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12e7152f07605c04cfc129c5b9d13d03fda7e1ab","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.d97f8f133.0.tgz","fileCount":34,"integrity":"sha512-yoKo7qckA3ps8Uis4OdhRRsivZV+VpzStzPqApiyaWgKWEyS9c/n4N8Nm8Sbg5f13zQgA3cj1lOrll7hLvMR3g==","signatures":[{"sig":"MEUCIHBtznAGa+CyvncEFV5Ik+gCb2Dmtu7J7ZdWSKF6H9snAiEA56AkUtFZjOzgZWQ1DBhPLJzwZ4Be80fuVjxZcyVfBOg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJo0nCRA9TVsSAnZWagAAMNkP/j5RcS0xp7GILD0hwygQ\nOUgEh72VtXctpt57gheKVTuL1UnmF8w9CVG/7Ay6kCJ5uU6bjm/NyEhUREDN\nyrdmVSUaksi83yGhv4iR9Yx7rHHHNBSpvNzNyDECf52VVRxvv4Z093rT9+cA\nC01hMgx/eq3Zi2VRCb2d3natz4mKciljVAf9owdYxXM7IxW0m8vRWsUu+WB/\nmsh2mKHgwJuk2sLaitDmtBNkCAeuQPg3awWTQHB3zMO6Pinn0+ojktd9w6SV\nuWLgljLL7vIstOYoPShzjrh8jSiIHX/ivd3FBJ7GmZOdHCJ6ZqUE7HcnxPTN\nnvy3QLlfMPar8wkG7pBZ3/CKUYK+91yBc5tVdFDTW72vbyznbCErEmKpBqf6\njEYmf2/E06bgjYo4OWfGLUR7056u74WLwiEK3+ekqWAgUGaJx2up1p+ZXDit\ndAGDhmEYKHtcWsuSkbSytcK0GSraVkeiICElMfPzvBBXL1uoIC7rEGsVlYfZ\ntjnqGjaFREPmwcifG13QoBbcb/jci2uuBlXxy0k7VTpqJB+7lUFeToEieyKZ\nUQUgFQtJW+Q7uSA0Z65/zJ22OsdTUpX7PmEVbc5xkJTj/vOzKWGR/nc77xzo\nVodyi1krXayaUNghwNhKgPnJDnOazWNqRtrmQnlp099+yAe/L9mBUn9Mg2H6\nVPkP\r\n=77az\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e7295f4786bb26bbc05939b4d6e3e42f011cc033","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d97f8f133.0","@material/rtl":"13.0.0-canary.d97f8f133.0","@material/base":"13.0.0-canary.d97f8f133.0","@material/shape":"13.0.0-canary.d97f8f133.0","@material/theme":"13.0.0-canary.d97f8f133.0","@material/animation":"13.0.0-canary.d97f8f133.0","@material/elevation":"13.0.0-canary.d97f8f133.0","@material/typography":"13.0.0-canary.d97f8f133.0","@material/feature-targeting":"13.0.0-canary.d97f8f133.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.d97f8f133.0_1629916455537_0.6654611189435202","host":"s3://npm-registry-packages"}},"13.0.0-canary.d86fb6fac.0":{"name":"@material/tooltip","version":"13.0.0-canary.d86fb6fac.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.d86fb6fac.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ba80d524419eeb313cd9d3166d01d005545abb4c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.d86fb6fac.0.tgz","fileCount":34,"integrity":"sha512-/uQutACSLdT9F+6gVSbALegwhrxsAxKbmIGPbC6HyYyy2jGmqeeigxb4MvavYPgD26t3rhmjWet1p2+7IdXg7Q==","signatures":[{"sig":"MEYCIQDa8Yl9HrIiWsXRtJqZ5W2mQzszI4es0UqGysVLvbf1FwIhAI25mqOVPEMrR9oLBbd4oJPKRQ42SgnU9KVVtNgbZJ+o","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJpH6CRA9TVsSAnZWagAAYYQP/0ak+mvVwOTUlI2UOqfD\n6D7y1OmokfABbTYYI/wK/cnj8GO5w0+WuT52n4pMOFuG9xPAr9J80e9yb/IJ\n82A7InNovDxeMpMNQelTKVs9P21hE01sLU3AJg9/MX+AA2q2FATxzSZbQQ+F\nB1Vk7gxFp/RubZFw3vG9w32VO+uFqfOp5X6JMtvYy7H33ydw/r7E3NO3Y/DR\nr6vqpqzRkWkpufVqQtxSCcUlqMQJHnUrfydfBaF8cG7GIuGUAgv1nEYPnGzs\nsJfnrk1TQRxk3NHtY1dp42QlA4SPRotOkzxcUL7nqXtgMGXguWfWUAFKoFZ7\nQJHgUZ/Zhts53HiovRxu6IYigmXbU/Ezgmed0zXQhZPkaa/pMw2gaFnhuPC8\nxXH02c6ero/1+IF38sjBZ8PcEBQZvvZPTjk1tFGI0qQaedgpKg17lf8E6O1/\n8ABEfiKkKMzK9BDlgXv2+FYvAPiHg0NdDPdQW9d6SSdeKMlTPX+2DdSbsA0L\nIliCfAdaEHIH6YBhc5KO64etJQvN+FIq5+BS7OWwNZWMTMRCOZTc8H6uqPiz\nk+W4zCDxOjUlzPTY5yhIYy0krrVdFaOR40qGDMSndmNVJtavUffU0Rdq2SOL\nBhA2LAcOjLXKN8NpD1AUKCW0PmMGnKvOYzC+wAcVjMIh43ta+GWl0umKGhnO\nRq4j\r\n=Zk93\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"35d13d1a20fe14c295e8589fe5960bc9b4da1925","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d86fb6fac.0","@material/rtl":"13.0.0-canary.d86fb6fac.0","@material/base":"13.0.0-canary.d86fb6fac.0","@material/shape":"13.0.0-canary.d86fb6fac.0","@material/theme":"13.0.0-canary.d86fb6fac.0","@material/animation":"13.0.0-canary.d86fb6fac.0","@material/elevation":"13.0.0-canary.d86fb6fac.0","@material/typography":"13.0.0-canary.d86fb6fac.0","@material/feature-targeting":"13.0.0-canary.d86fb6fac.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.d86fb6fac.0_1629917690495_0.8444388489561501","host":"s3://npm-registry-packages"}},"13.0.0-canary.e8554dbbf.0":{"name":"@material/tooltip","version":"13.0.0-canary.e8554dbbf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.e8554dbbf.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ee3841aaa815cd72e1c236cd3c75cff36908ded","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.e8554dbbf.0.tgz","fileCount":34,"integrity":"sha512-ctELq9WUWofuGvV+HpV3pvGLGc/lnvGW8P+NeN6SfkzfLmbnp3KfBMCZHTAaCwmbhFc8kJ21WDntqr8beShwGg==","signatures":[{"sig":"MEUCICirwUyaYL0RKXuDtl6Xgy03WF1/g6BAB3cCavV3eOcmAiEAmNRkl78OgJFxueW50JoECtiiNAX9jtgEtUcaKho/6bc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJr17CRA9TVsSAnZWagAA9gYP/Re+o7ebJZhyeYGMeQLz\nn9rldJGp61pNAI5LhPZRu96zbngcsQnRFo9FS2xn+KetXIwkongqx8UCjxm4\nPuKaMCekfqp2MUBWPcnu4rJfzg6J6OdjpkPMkU53ElOa6MJ+qB4eAhG3ST5K\nAlCF0hCpZfbqBz2gSCDOxOFqJ0/75ydW+Ia00sVSPBKqzlKYvYeciFB6/bBA\nZ2ITzp10FWc/TEauD1XTimmn1a0ZLbxISR1GREXuzhIQ1YByUY+8MvfMhM0T\ns25M/A8bunSkPB1+A8zh0LNvv6t8pbfqCjNJ/TteCbKnES+GiI2xGn1QfOFO\n+ehK8Vb6VzEOTvXKUylwjpNo/7LXRLVQ2g+TzNLFE76hAzBW+HHLgmOk56vL\n2ifsJEgwFs+GvR+rvvJzw7kA5/13U5G7cFZQAP6ren40Jc7U/Y6BRn3Us/7e\nuwfbMmTgBy/6DRsIVOnKlsVUa8s7Z77M/AMYUtYe83g7V9Aya+DtosIzALcL\ntoqSmL62G2XBu7T7hp8Pb5ThxTlaMNRWLAEvu0u/Zx29JvJL44z3eacxS7cB\nMvaPNbvILyFg3KMjqCJBu4w2u/bSnvgym9omY9iD4n08ck/C/Aa/82NJyxXS\nB3WZ4owloeqres/CvoRhJoChoRP97Y+4FYImYYoGIkK5OunqgEy0x5Fy1GvI\n1JiN\r\n=Bnin\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"da636a8d32198c6289df3bcef39340bf76cf8265","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e8554dbbf.0","@material/rtl":"13.0.0-canary.e8554dbbf.0","@material/base":"13.0.0-canary.e8554dbbf.0","@material/shape":"13.0.0-canary.e8554dbbf.0","@material/theme":"13.0.0-canary.e8554dbbf.0","@material/animation":"13.0.0-canary.e8554dbbf.0","@material/elevation":"13.0.0-canary.e8554dbbf.0","@material/typography":"13.0.0-canary.e8554dbbf.0","@material/feature-targeting":"13.0.0-canary.e8554dbbf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.e8554dbbf.0_1629928827125_0.04607166424316489","host":"s3://npm-registry-packages"}},"13.0.0-canary.877e3fb0d.0":{"name":"@material/tooltip","version":"13.0.0-canary.877e3fb0d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.877e3fb0d.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce40688fc898957af14f44ac83090bde99afb22d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.877e3fb0d.0.tgz","fileCount":34,"integrity":"sha512-qJ735fMrEnj96Q+irmtUr3tAzltyU+VANDvSJAULcUvuAt3S4s//ZUcB9PmSU85ofpB8jyWKrm3m0EmE8MUjrw==","signatures":[{"sig":"MEQCIG1B14uL4MXu19Uco6hWXgMFiRGh3HyS6Vnj4YUcoaLZAiAbxxRcM0P3yGN9ZRpACGQhp/jAJWfyx7spUP5JWhvkRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ7WoCRA9TVsSAnZWagAAbZ8P/RJjG/j9wAFtSRzEUbUF\n7/jITvGsSUxIPzoITBTv/cNDbQP7xxu1ueEPG+2k18W4zJ0i9+BinNMNv8xo\nB5TuH1tgz07HJbJB/I0cz6++PfnbfPQaNpm8kbtSwFVCUp8mMnFCWHjEip/r\ncNDHlnFR7JRERnaTovkvBOFNPF0T+s//euRSAnzsa/oMmkTo5e5D/xc605QR\nX3bv+HCq9zdrTQuvk6O53ipjZxrQTo3D7eyBBUXuOF4cNXUlepCO5BHFSVP2\nuGH/qvZN193IGlo4pFVBEVs6FHxBmQ0ZR2Hx2Ya/ekJYWq2gaoON8CwF3kJ/\nnjiDajQyOYxR0EyM+3VnfxEEilia2U7nTKRyDtO+UjhfDmi6sSvGESTLjd9r\n0fszlep9NvOh4Z9N9C5OdFY/ggRlmP68zzeC0ZmaeNu/UBrm+dQkuo7YFYju\nZCJhJI6nAIjIjMq9qfVTVfdzrp5qVaEU3snN+D1lFlTxiqIqGOA5rx6PaUJm\n+yqrtqYqDtWZWbd0ajY8G1VsSE8i2ZUlY7QhvYqH68KyznTG8FLGVir/xaSc\nAWzvShbgJkkw9dFky+SM1r1+GCW4cROOuPW2CbRySLeqFD1ZuLbzYbFCWWG7\n9CWtg4lMeKqvQyiid25QpW4S+TgZHFWn7YkAT+WbYOsjCZMs+7e2OrRB+rpu\nUR5o\r\n=8UCm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"849a956f7ad3e0da0840469b917eb66537c875ff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.877e3fb0d.0","@material/rtl":"13.0.0-canary.877e3fb0d.0","@material/base":"13.0.0-canary.877e3fb0d.0","@material/shape":"13.0.0-canary.877e3fb0d.0","@material/theme":"13.0.0-canary.877e3fb0d.0","@material/animation":"13.0.0-canary.877e3fb0d.0","@material/elevation":"13.0.0-canary.877e3fb0d.0","@material/typography":"13.0.0-canary.877e3fb0d.0","@material/feature-targeting":"13.0.0-canary.877e3fb0d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.877e3fb0d.0_1629992360277_0.39180814084770654","host":"s3://npm-registry-packages"}},"13.0.0-canary.6236f3576.0":{"name":"@material/tooltip","version":"13.0.0-canary.6236f3576.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.6236f3576.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3a13fb9c6d7924c4ab1c9aba72907edcc74da607","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.6236f3576.0.tgz","fileCount":34,"integrity":"sha512-UzO54M0KpPLV8LeC3d2MLpyk740GdE7Q0mpRFGWZxYH8YbXNBmvHG1rDRQWXzLB2H1l/97SrngtwS1r0wJ5RZA==","signatures":[{"sig":"MEUCIQDHIAGBLQr14JYYyZyVaAQaH5UXj0RH6MIzd47QmQt5LwIgSSXM/ex6jOPWx5Br8PF16AidlvNxOuhKH02SWMwivGw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":795436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ7wmCRA9TVsSAnZWagAA1mIQAKMZNC1qXPOIn1E9UkoO\n/A37FVi5vS7j3pO6cJLbEaDnSDmCidHmFxwFFllJvIR7ZuWxjTWWgHRBmCTQ\nIfgJLfE8P2TUuisO3QP4laJ9bWLnM2myRb5Y1j7GxY+ctLdDrfdFPHIp1TR7\nfIGd737TFyjtLKPO24qUhVn5JboSxnZL8IkbVAV6kLYFA77Mt68Ue1UYe3w1\nNIMBXxUoV5OODUqO/dm8aTWpDiqZBhw3L3UAbuRtT2TKzCjc+8525QFYmHqN\nt2e8xZZjEfJWHyIfb4bhcNgWOw1RJoWXmXr46AkmUNegKvRE0VHXw32mcPNs\nA8aPCxDxb2l1uzHfNR+WdhnvdcngWo73AliH375ZAJlf6ysWhFh2yivtuH+M\nlECFFkO3loAMhSXWQ67uC648cSmnLiqxbge/+vb3d7HTcGaDBh7HbhXmNckI\n7e4kIKMbcYqorTtfWilvL4giH1ipV6wI5kVe3PfORggr/Lb4BXb/BNzVRZrI\nDrWzcTGrfUGuAZA7K7mhmWqo+c6T/eLkzqAduMFI3thUXfn14uneryHHeq1y\nZoqrVUFCr3aVBWmOE1CxiroEzTeuFeoWjlTBAr9DorkXCRjVjcDm4bQi70M2\nfpuAw65/ihiPvE0FVyJRQS4FGw65Pr6fu1Zt6tEAb3Scy++i1R1NEfrsEaY9\naqPO\r\n=SO+5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"27220fe16ebbbdcba193340cb99388e30976a2d7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.6236f3576.0","@material/rtl":"13.0.0-canary.6236f3576.0","@material/base":"13.0.0-canary.6236f3576.0","@material/shape":"13.0.0-canary.6236f3576.0","@material/theme":"13.0.0-canary.6236f3576.0","@material/animation":"13.0.0-canary.6236f3576.0","@material/elevation":"13.0.0-canary.6236f3576.0","@material/typography":"13.0.0-canary.6236f3576.0","@material/feature-targeting":"13.0.0-canary.6236f3576.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.6236f3576.0_1629994022243_0.7596232576049957","host":"s3://npm-registry-packages"}},"13.0.0-canary.1d19158a1.0":{"name":"@material/tooltip","version":"13.0.0-canary.1d19158a1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.1d19158a1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"78f8a6c285eeb212e88da5397dd2c9012a787d9b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.1d19158a1.0.tgz","fileCount":34,"integrity":"sha512-ui8Hq+yJKvHGPVvALLd1EOy4rxCo28dZZuG+NlnU4AlZoTbxXlwMG3ZCI4diQCv3m7AxDS9qa44QmVLmxSNZXQ==","signatures":[{"sig":"MEYCIQD2OY8mkcdYudDlvRRCTBBkdjt3IjNH1wGQAewhWz/REgIhAL7dvXWpGhcbW1qlAYU5vKsajGSRJ3IM470++HOutFV9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":796211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ8r6CRA9TVsSAnZWagAA7MYP/0nOSn3dLXChPljlYcCk\nO0VRUR/GGi5bqCZufcOtu8dirYUr0t6kztedEjh65bZLL7aHh2adQ3Eou3qr\nQeH+t3KHqvlgra1oR7K6C1ceyL7Tz9siZhvXUx4In4ZkLUmYQgXQGbb3jHcy\nLSwVyd0zlNNwYPoKfdqJPRlMXYkipjJkU5wTGB7iuw5TWPlbe9atugeD5wRv\nVR18giHgIGnlCSp5nuekNv98j6REPJRBk8ZJfqJJaQrgtw7Wwtlm/FHf4E1p\nqFAqPlDkCgkmhPu7UpeL718E3UvsUZoD07v9w/x7RQVvClpeDxji01Feokcr\nY5fmJkbx8BNQ6fmkS2T0I4TtR52w0r86ROkVlzwd24DUdqbjVBEOP80EtXHb\nnMCMlztxWQBFck+0AWWSOdhKSV501pC5W5aEhOE4/updoJZXKULDJVs4sL7i\nO8Gd+zHX80Aw8ZQgAlB+lYhs0NY86XK8ZSYfCcvJLAUJJXaxxGj7KnnV5Sz5\nod6rsXIx+iAYf7UMFlY7tKs0iDPpnOehOPvctNkl738GLGCRpbsnCUjYLK0E\nI90mo19iCrGjEaIsdXgkOdrIdy1zrFBsN6dXt3Z2fI8grzbDUCCRGtK4aVC5\nWzdFikIgjAB6h6bcyAbO8S1SVsqk04VzNFHNZo7b7Pblv7+5scYCDDxjwqUQ\nqcHe\r\n=6POp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"451d11fe02e89db73e3ac79cab01741c3da63ab6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.1d19158a1.0","@material/rtl":"13.0.0-canary.1d19158a1.0","@material/base":"13.0.0-canary.1d19158a1.0","@material/shape":"13.0.0-canary.1d19158a1.0","@material/theme":"13.0.0-canary.1d19158a1.0","@material/animation":"13.0.0-canary.1d19158a1.0","@material/elevation":"13.0.0-canary.1d19158a1.0","@material/typography":"13.0.0-canary.1d19158a1.0","@material/feature-targeting":"13.0.0-canary.1d19158a1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.1d19158a1.0_1629997818668_0.16860683392166487","host":"s3://npm-registry-packages"}},"13.0.0-canary.6adc9e83f.0":{"name":"@material/tooltip","version":"13.0.0-canary.6adc9e83f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.6adc9e83f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"df9f8b6232dbcaab555875028f892fdba0377832","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.6adc9e83f.0.tgz","fileCount":34,"integrity":"sha512-NZ3B5Z1nbZBv7kqAL4lSf3zrkGcq2ryi4/Hbr0u6ZlKwupS+9a+yKg1T8ViNtvX8D7ZZ+D7sLVGKmLacdC6ixw==","signatures":[{"sig":"MEYCIQCWwhf8HFGYBXREh/iu5f+hcaEPYRvCGgxjV0y0BDk4MQIhAKJ4kb/AQseEjycZnhNli4zj3BgnjU9iO7vjs2LEH5Xm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794991,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLV+ECRA9TVsSAnZWagAAnf0P/3vwav24ypK/320O1tXX\njpmoNikOTjAR30qfzmqPEmRBce4pmInKNSZ1TOEL2oCyzyn9NTeXyl6Vqeoa\neY8QsY053Lrd3DeWAwzQJyLiEfDPeOb7WGdB5FsD+06C7XEb+vpQdzVTA4cK\njkxVL/zwnq0svT13futQGyY7zqbwMbGAKjB3aI4I/wMGMN8Px0I0UF9+XMx5\nCFERo83q1wKwwXiq95VrlZ24ng3d9EMAffFkdGHXUHfkFrcRKwPtDYN6lFW+\nezEG4tQ0X58bQKZorTN0TXK4Neb80xnTvmouT+ybQWoiAJXxD7RONhUez4wD\nVCY1m6APa9wyUV4/CvMprWbb4l7Z1Z/yyLqWWChqvk+6n1uJFpblqJJQ4oZd\nqCIbreGtsjcAUV5jRxCRQvN6NnV/Eeioejdm+I34NunBIuQeYdknmlvA76u0\n1i5IcDpMRs1SInIFQ1vVmpxf7Plej3efcnLlnEyACxe5E80gawuT+QA/QIN3\nL+PlXlxe2f4+MpsTxAMnaEHAybcwSl3u3c0J7S71Uw6hb/AHivJ3BkQrIEkt\nqUdF9Ray9lzk9+zkV/9C9POHi/qWBD9OSEIt/K99hKTkta31UhZPFYQP1UmV\npAkrTzl8y1HwWQ0MV4Z1m4exXhjZZyMK9n9XRwYQdY48ZT1N/9dt/o42+BI1\nTIdg\r\n=MhbN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d3d9f017c96584c46d77544b9f0dcb6e22eeeede","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.6adc9e83f.0","@material/rtl":"13.0.0-canary.6adc9e83f.0","@material/base":"13.0.0-canary.6adc9e83f.0","@material/shape":"13.0.0-canary.6adc9e83f.0","@material/theme":"13.0.0-canary.6adc9e83f.0","@material/animation":"13.0.0-canary.6adc9e83f.0","@material/elevation":"13.0.0-canary.6adc9e83f.0","@material/typography":"13.0.0-canary.6adc9e83f.0","@material/feature-targeting":"13.0.0-canary.6adc9e83f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.6adc9e83f.0_1630363524570_0.5837010574301986","host":"s3://npm-registry-packages"}},"13.0.0-canary.d082790f0.0":{"name":"@material/tooltip","version":"13.0.0-canary.d082790f0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.d082790f0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3865fec7ebad5d9c482704a7f340bdb85eb0bbfe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.d082790f0.0.tgz","fileCount":34,"integrity":"sha512-c9PUNz8fKhIRmY1/de37KepF+slWHjxPjnou6RDeNbxwrp+JrkJH/BFTfOw1XTDyE965wdaFIcOPWt9gBSutjw==","signatures":[{"sig":"MEUCIQDmggLsN1JmxAFT6+cKzgbcBgIY+Fb3rUu9fDA38xwzhwIgDowypZk2Td0aD4qa4d/ihmDIhkopNLHrzRleObbkZ/s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":794991,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhL/bKCRA9TVsSAnZWagAAu5cP/REJdjipXd2OA+vJmoE9\nULiN2LKci7JeFLSD+Ih1Wy+WLr3sqsRgdBubzqpp3MWW4WqNmlZzs61U9U4X\nTDcgEr3qrOj3ObzGOwka/OudLDKkPdeHNdr6CsmW3Il1/J3j1+4tAvOgFmSe\nH7WNU8+lqkMCjnO1Gd1z/aj9hUsS65pmopwhhFTlx2RaPeFDUSgaXhJGb/OU\nxReftm0rLTzMzi/luIs48xpYJynjbIpyGep8mJhHla7Alis/L+OJ4ih07bZm\nPAiwYaTOf1c+JOH/JconjNQ95sGT6r7FXDGd0rGG7nf89n+itSv2DhdWhoeZ\ntwCkkd7jSo7Ksy2ghakNlFNFSxiXrX7aqvqCEd5gjhs1rBtzb+q2zBbowpjn\nz52lc2Gfjmp6IMl9CxwjTur8xEWGvbv+140+9AvI9iXB5HM+sQL8fcCB3jST\nrKucSrOht9znEvIP4FjlZamQDJh+eILfAW+1BXF7NUozD2kpJ1ZXi5rq16ah\nzVEcUU2ICsD9mCtcDOxfsXvfBzHf0LzkVIWOg9nvB27HrELOE0Vh11+gA7/q\nfCQClFDK85q1vXpT1HYVSPGZsJvII187VgmGpCqWPKXObFqx4fqFkyESrBy8\nl51e04iSOxqb0SSrsIwjT11G9fBggYWE8MhRaz4rkH9NsZtND85LVrTvxPCv\n5gxP\r\n=cyvA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"77212852cf39af4379f15c0daae076eb8b562c15","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d082790f0.0","@material/rtl":"13.0.0-canary.d082790f0.0","@material/base":"13.0.0-canary.d082790f0.0","@material/shape":"13.0.0-canary.d082790f0.0","@material/theme":"13.0.0-canary.d082790f0.0","@material/animation":"13.0.0-canary.d082790f0.0","@material/elevation":"13.0.0-canary.d082790f0.0","@material/typography":"13.0.0-canary.d082790f0.0","@material/feature-targeting":"13.0.0-canary.d082790f0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.d082790f0.0_1630533322341_0.49952927422795335","host":"s3://npm-registry-packages"}},"13.0.0-canary.e2c4f0196.0":{"name":"@material/tooltip","version":"13.0.0-canary.e2c4f0196.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.e2c4f0196.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"19ab04c3a6cf89988e077d4e878c8f658da8bf7e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.e2c4f0196.0.tgz","fileCount":34,"integrity":"sha512-fRHvX+n72Pn9CNvu8lVbt8nsK8ryaCNPLRsuFJXYQV0j/zDX5LYEQr9x7eYW7ZTJUjD2VtC+FDgKZFokGRZcUA==","signatures":[{"sig":"MEUCIQDhVG2gkD+bbO4QCeCk/5ek4go/WGQ3AOWuTXRiA91hLAIgRivSOSNzlvFIOiCTqMyrgSrj4KqEto4IqxleYneAL7g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMDMMCRA9TVsSAnZWagAARp8P/2odZFpLbq9PLSpjXQFQ\nBwDmSroM0H77+NQef5iIq6oGCImbQxG6nkaHXbA4ZNW6YcTquYdWz130Gu1Y\ncY1W8nRf42LbDnk74bFKqQn9ZN4/Q6jb31p+oj+sXzJtNMPKLHd1CCwVTzKI\nFb2AifJKHMAsBki4RZyjozOCAXvwr+otCtouDhdI/0rIQ58GYRb78+c+1v4y\naBq/kRtm+YSl1XUes3i6ktHxffN11GMuABgt6S5JXGdjAdqN1EMZ16aAWHBd\nsf5K1wwESrt5C5sP6xmSJOp4VyzrEzIkwsgRH7MRihrxkIeMf7Uu3KhO/0CJ\niZQz6+yqwfWVCP1nu7Npgcru02bR40JpsFJ3I0czCEnYCrbbcXWnGgRlWhRm\nsOPlLgxVPKmZpj6RgYnrQ2Dq1dJyBeDsiPj57IHr5QV5/dHEk30ga+m26iHy\nvnpsijYEHKMX9ZcKj3Rb+JRtr6YaETIXjBm/3j/iCC2ZTNK7+Z2XTnRKj2kl\n3gNyTEvSScjQ4Kk8cotBrOpaIBCPiDLshx2utUpQpIYIV2GgC4WxDJxIQoF4\nlfwLjaGqE4IuD+1yNwsD2/cn8iinExaWLPmLhJY2Qt9pnCpkiPQPHGnS8Qua\nU+gH1vXa6p6K1TQ9dxM48lPZo97Adfm+lBeqM5+7ccJodfJQRZRef+j4hGRA\nvdp+\r\n=26W+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2100e21debb7fbebda0966c953fb24e1964c19fa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e2c4f0196.0","@material/rtl":"13.0.0-canary.e2c4f0196.0","@material/base":"13.0.0-canary.e2c4f0196.0","@material/shape":"13.0.0-canary.e2c4f0196.0","@material/theme":"13.0.0-canary.e2c4f0196.0","@material/animation":"13.0.0-canary.e2c4f0196.0","@material/elevation":"13.0.0-canary.e2c4f0196.0","@material/typography":"13.0.0-canary.e2c4f0196.0","@material/feature-targeting":"13.0.0-canary.e2c4f0196.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.e2c4f0196.0_1630548748490_0.9193941571069595","host":"s3://npm-registry-packages"}},"13.0.0-canary.611db508e.0":{"name":"@material/tooltip","version":"13.0.0-canary.611db508e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.611db508e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"33c85742d7e2a0b2764643f609676cb3e5812275","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.611db508e.0.tgz","fileCount":34,"integrity":"sha512-9q0OY465WoBt7iHwCO/fcpHMQJe5WjITXWyHEw5Q4YKy/opMy+rr1vq0+hF83hh7FaB7IlMZ/BNREeZAyRcbIQ==","signatures":[{"sig":"MEUCIEsUZZaR3unksM+f1YoO0WLyaFptW/wbWuCagXxju63CAiEA1VHPM24H30MSI6W613l2T3BDFp4LSNc97X9rdAtg33E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMEIFCRA9TVsSAnZWagAALWwP/3LzoIW2/ArXQbhfll0+\npDM3qBlRrSLsiDE+UQbj+AZgieircG6R9BFof5LJIpyKc0eFMgqJQEs4bKar\nrDuJRrBLdkGQQyxliXRgDXA4uvaU6oc4Lujv4YPy1MlgkkHX283XSttdKyG5\nUTZd7N6rory0szZ26iXYvWKFZN7NKPt7yXKPbq3elFneD784EAq80URYEsaL\nT4BgvmJ4d+yXRrMX4rjcyoABolnsJzTE7lOeBVNuUKVofdT1go58RgDke8p+\n8GdAf5B8tttYLC+dBgpOCx3wyqvbLoE3WIQhVIWTTX6TJj/VKGAzmM+lAjPw\nSZ0EEUxH34JWkdEJ8ywVo0qONZ7KUiDagsuF25RM7LWc/i0lNvq5t/dJAx3w\nUqDDEa8aTSY0A2gpIClQjfFLzYnFySlETWNw4ENG+gojOqOzG5dEoW2MlRxa\n0qjrEu0rbR+9yooLGOSJ8tub9ZBqkWO4jQEsUoiAfbEMXa4+fcHAYfuQVOUR\nPnS1UwvxU0rKqBuXtkoF3Yar+JQFh0z990NaKrPVVo4EXzqyn1j5r+J1psa1\nwHusA99N7LPGPKq34+nSKjKuKbUJqnBqLYLdEUBYVJ+gAKdlGRP6nQRbC/aa\nkSTL89eX5GkKvZTO8QWsyH2tzsq26X3y4yQmX2xj4ayCPRnFJoqPrWJOSCh8\npquc\r\n=9vkG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5d75be4b0e067fa5d6477869a053c630a67cd643","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.611db508e.0","@material/rtl":"13.0.0-canary.611db508e.0","@material/base":"13.0.0-canary.611db508e.0","@material/shape":"13.0.0-canary.611db508e.0","@material/theme":"13.0.0-canary.611db508e.0","@material/animation":"13.0.0-canary.611db508e.0","@material/elevation":"13.0.0-canary.611db508e.0","@material/typography":"13.0.0-canary.611db508e.0","@material/feature-targeting":"13.0.0-canary.611db508e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.611db508e.0_1630552581383_0.1907147374935576","host":"s3://npm-registry-packages"}},"13.0.0-canary.d4706933f.0":{"name":"@material/tooltip","version":"13.0.0-canary.d4706933f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.d4706933f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"99a69684be5f8ddc67371ece833c32e4aeb06994","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.d4706933f.0.tgz","fileCount":34,"integrity":"sha512-jLWEdqGw3rEtZDyNPwQyAYuH8XejjSc1UTngRcmnUYRBe4ufTClxnlA9trmk+2zPASYv8pnDdZ9/NgtvMPSdrw==","signatures":[{"sig":"MEQCIG9+oyQNR4VBhpuZVsc3uKWiUIqKr8wCc6a4kg7r3WcmAiAzd8oheDhCpo9Ut6oUCPZb0eSr3phoU1MhIclHXvcD5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMPAJCRA9TVsSAnZWagAAl0AQAIInydhb/jnq6F7hZdVg\n0EaCxVMoKKKSUhCCqTjZoJidDS+fAc+w/g3apRtX3UPYZm8uP2Qw9vyA6Pse\nDCkeNz1Emdjy5lRcxkKoaP2r5kEuPJy0G+CTNYY6A791Dl4HsltCYvQ93e54\nGoBmUCxA13rDpWW0dllSk0wVxebxFX6RTu/BKDGzaj5+/YakRcHJWFINDPMy\n90fhAuPDZixfwshX0VzfUCxBjlEkszQ7ETGWg68q5ucKjC3FqN8oU2b2t4eC\n3PyxOedvVNmUpVTMvPTl5M7gNBlZhP1wiwspGWu3VrBEtPaplvBEVDLKiPAT\nq4+1Uz31npDz5KkQ0sgTxwGSaJjwNfsoHCb4+c/pQhPv5uMRbagTkPzZP3zC\npxCxMTdAK3oxFQD42AHviki9vQejxYqkTORbs9aJkeApWD9okI+ToOMpjOSO\n7Rbn2JSJsnRr8sdPGz4CpS2FuYiz/Y67bJBdfUi0+xwfi63ocmOH3g6XonwE\noFfMXM12uLM0k8hxKDzFpVw0OtQRx1sgHhx7wo1sm42GPRT3RbBzXjk1zwzk\nAWFfCCOZkKeub8AVeUPrUfwNtb/oy+6MKh3WHGEfm20RZrYPojNtQ5hNkpzn\nFUCO1zAEmdjCxdOnuEyDQUQo0M6/jLljcxbaLzMq/ZYgVBzEEslPTt9QezIs\nX9nI\r\n=N8QK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9e7edb1e0621060d55bf2765cadc8f2ffcfa0f30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d4706933f.0","@material/rtl":"13.0.0-canary.d4706933f.0","@material/base":"13.0.0-canary.d4706933f.0","@material/shape":"13.0.0-canary.d4706933f.0","@material/theme":"13.0.0-canary.d4706933f.0","@material/animation":"13.0.0-canary.d4706933f.0","@material/elevation":"13.0.0-canary.d4706933f.0","@material/typography":"13.0.0-canary.d4706933f.0","@material/feature-targeting":"13.0.0-canary.d4706933f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.d4706933f.0_1630597129447_0.920877089042482","host":"s3://npm-registry-packages"}},"13.0.0-canary.c16fe03ce.0":{"name":"@material/tooltip","version":"13.0.0-canary.c16fe03ce.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.c16fe03ce.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8d23537ee04e127e4e89132a01b7150dfe0464d8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.c16fe03ce.0.tgz","fileCount":34,"integrity":"sha512-Ofky/oEiO/YRfPhjvROtnavVY/+IvUnXuD+SWRhS3jr9PvMzU+AoBrSmmkqSAEOpwe4iZzssg8eEWFHsHuXckw==","signatures":[{"sig":"MEUCIQCluQHPNbR82DzVllA4/fE4CnnVBIUa1K4uKanywPBLcgIgdAQTOlNqijSpK/gu6bkpm4W/mvn7vCTLyWYbI96dcKA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":804692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMQ3OCRA9TVsSAnZWagAAthkP/3+jwIax11GURNJ6JeUa\nCjGuo8QsvKVmJXzuNo5VI1X8j/ROYc+tq8IrqiqNk80l6FvcCQpnE4uvorLo\n9vCHo5B8u8aWWVQiL9iNcXb//Ahs2OC2T32pE5gAME6x6L60aT94W7lJDFqE\naKBlZRitfxFKO6v+4FYwEL98xzbR6dKOB1VhDC9AcqIr0EXa140QSYx/mTne\nNFx/vModJJ5efozcMYGOrJZBFuy/TNQTBxpd7Shu0VZPn1jgdFvpY3XCWeWQ\nqCO/acSl6sYWUpNEL+AtFuUZkSztTonsrIkBo7OCLVuc+apYLX5mxlFQIEup\nq3NKiF/c9RUdqBZAxq4LNp+xHOMUhOD1xaZz986f4i8Rwcu6hCZJGyjB/vom\n4HuRKSo1wlGqkc/Z2G73PW/WJ5FFvD6lFuA/2k/PEtYLCiCDBL3xgZrphKHn\nvzsHeBqq79094r4oRB7ZddCYdjdSlChnvZcq1YGelTp5laNfRZhQHY+Dv27w\nISlMi7tR86VjIqEIegGuNLT9JsaixjjsVx1VXc1mAIVNf1VpnOGawS/SoDj9\npTAcCkm68lPUtP1lNHdXf/hvilS8lzhcuhmJvWxvSOM8oUjSPEz9CGdOOlOl\nLZiKpLSMovCBAH7zlUF2tNjzLG/b/yCMBvIdRd/gPSV0We9yXPAeZpn1IDlG\ndlBQ\r\n=W42L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"28281c91b41ff8002401a21d1210e0fc629d55ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.c16fe03ce.0","@material/rtl":"13.0.0-canary.c16fe03ce.0","@material/base":"13.0.0-canary.c16fe03ce.0","@material/shape":"13.0.0-canary.c16fe03ce.0","@material/theme":"13.0.0-canary.c16fe03ce.0","@material/animation":"13.0.0-canary.c16fe03ce.0","@material/elevation":"13.0.0-canary.c16fe03ce.0","@material/typography":"13.0.0-canary.c16fe03ce.0","@material/feature-targeting":"13.0.0-canary.c16fe03ce.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.c16fe03ce.0_1630604750503_0.8299699473247062","host":"s3://npm-registry-packages"}},"13.0.0-canary.9203a958a.0":{"name":"@material/tooltip","version":"13.0.0-canary.9203a958a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.9203a958a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"075a3df80e9f2d3bee1c22cfb84a4a20c91d00e8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.9203a958a.0.tgz","fileCount":34,"integrity":"sha512-D6miAv9o2hcMKQjFdmb1P2pmmKfpG3IWwGlMMcYMZ3b0ecO6cni5EfeJhD3s/tEj1e3zu7ZRmkt9THONVn4CZw==","signatures":[{"sig":"MEUCIBgTaVSnqqsPmK/TKA47KnkkHqhcI51Qw5N027wSdiCvAiEAkYttceWN56Xvoe3VAJN3TU4bCWvQxfyCiQFZjP+Zvv4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMWJ1CRA9TVsSAnZWagAAoMQP+QGpufu9x4XHTOA2lEZm\nUjkrw0rxzqo0Iqb+xWOHcGLMbItBM+0svP6rzu8rGQjZx++FsGqPIFdQ/Nyn\n1UlyxMX94F2zKVXx99PZp+kLNJN7PwT7eGZn08XQ3BHSHcQi/HArJXokZudP\ngLcT4hIqoT48T3aDNb0TQzQnnzrgPXp7AlAnpAD2vFdIU9W24MgdgBOI2pNw\nY9ylqyOVX505649ZtFVjhfEbrTTjDOZKXVKOCEFlOZVzjHi5JKNfUbctQ5Zf\nC0OAt4hvsHbjRQoLmxh0GVopRm68esXwZpapkSMdC7nJtbPkZLftW9Ic4sON\nEUzf35RR+FC8PqZcsxUV+j/zXbr/g8VCHx1qxuTemF8Gs95mpMHjJlN09ZK6\nv6lEi3tOsvXO/RUmUTo8AHyktvdrk2fT7u4TKdke/HplJXYPMelsCCvhzW/v\nKshrYqiXD49i4DPHN3kp78a/t5OkBmxTGR2dRyHB+85Q/77hY9S5cJ4Fci8f\nMCrGkdlMt4TJTE1U2UREW0YlOaaXO1EpQUTxED/0N73kFMDdHjehJynaW6wb\nLInxYSKoALZT/A7qMKN9e2Fb7plSssU2k/3gRVP97xgrKib0B8lfaHsspu1g\nECfs68jmTH1Exj25bwZJNF0SJY73kiCvQmHAKD0uyR1luLo7ub0gPiqPncYW\nc3Iu\r\n=PG7n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2e0f9de34d700b0d1eabd5186c5b5cf8080eaf74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.9203a958a.0","@material/rtl":"13.0.0-canary.9203a958a.0","@material/base":"13.0.0-canary.9203a958a.0","@material/shape":"13.0.0-canary.9203a958a.0","@material/theme":"13.0.0-canary.9203a958a.0","@material/animation":"13.0.0-canary.9203a958a.0","@material/elevation":"13.0.0-canary.9203a958a.0","@material/typography":"13.0.0-canary.9203a958a.0","@material/feature-targeting":"13.0.0-canary.9203a958a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.9203a958a.0_1630626421316_0.13152739702563032","host":"s3://npm-registry-packages"}},"13.0.0-canary.fddd5ae93.0":{"name":"@material/tooltip","version":"13.0.0-canary.fddd5ae93.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.fddd5ae93.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e2f693ca7e8cf93e54a8961b5c4c1c1ed6227b9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.fddd5ae93.0.tgz","fileCount":34,"integrity":"sha512-G3ohwSKmqqNCl4jrcxQvU6LxVUmDMRLp1UTuk/zBw2AicGO0iDn0uwyoeG2V4JU8hf1S0EQOcIJkcQz56IzHEw==","signatures":[{"sig":"MEUCIQD9FQjeUCyHJNPqfU6+vT5aQYCon8Un/pj+DJt9n2eFygIgD9w453mg+UvFZc3hLeWdstyQbIcW5m3eECnY587N5BE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMc8eCRA9TVsSAnZWagAAkL0P/AsWlKn3LcJQ3eJ5a5Wk\nlFjyD7y4+TDmUED++DqHnqPhXL4CEVJBsU61HC1j6sArLnbUWiiFbicP4/YX\nBCasFA98BqHQDvJ87n/3PHCN8mR3LeGp+Jhigc8gq64hZgvn20ayTTq+U8QR\nHASss9nU7i5HsABo4jmeAxjm3FbY1Xyr1Wu0cQAVjU/5mOa94nh8IdJjgWUl\n9SFUkmpiSVcJgGEZrwl5v3WGgTJ2H1/EewxxwDAYS9TQRygXS1JR/D14i2Wb\nk8FhKlu5L7j2MnPZQXjTjTCBA2q8cWZXoEF5OgngGr9T26urk1y9JzhDQ5Q9\n5OC8yWhH+5qW23qfQZhrP35GxG/zvOgUObR6t7gJWWY/8H4PXdi8Nzirm19p\nKFoXuKS1pqu4iA3Z4NRB1HsiO/Yc3HTG8kGDHjJ0exueheGZmGQOIlletbzd\nLUdNFf5keMeMMStqTXQRXOa0yby00o8poyeqdKFKGupPghmfypYXu0TzWxv9\nI65kXIUKI7BuIFcOgVqdYhmcCoR/Drr1ecm4aQMRkh2bNk7SBiwdJBAFQnAi\nQwWe8ynbSFwZlPEAMSooLbG9vdu05w6ktMrRdxdQpQiqnGKS+ZrX65DzcI2Y\nD3ZLQVCg2SziDKOB4LTFD+XhiyBnCO6IyBFTcrRmS+cPM2bFRPoEKZJ2F9Tv\ncVz3\r\n=5Iog\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b5407901afd7b18f851e64db0350e0c38797ae29","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.fddd5ae93.0","@material/rtl":"13.0.0-canary.fddd5ae93.0","@material/base":"13.0.0-canary.fddd5ae93.0","@material/shape":"13.0.0-canary.fddd5ae93.0","@material/theme":"13.0.0-canary.fddd5ae93.0","@material/animation":"13.0.0-canary.fddd5ae93.0","@material/elevation":"13.0.0-canary.fddd5ae93.0","@material/typography":"13.0.0-canary.fddd5ae93.0","@material/feature-targeting":"13.0.0-canary.fddd5ae93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.fddd5ae93.0_1630654238446_0.24259213393041734","host":"s3://npm-registry-packages"}},"13.0.0-canary.117599a8b.0":{"name":"@material/tooltip","version":"13.0.0-canary.117599a8b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.117599a8b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e454736d764328575e791bcbe5f0c8149c23a188","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.117599a8b.0.tgz","fileCount":34,"integrity":"sha512-SOG0J48wfU91KYfyCYMjjbgmeAstcXJx50oscs9ZAQ1A28I+BwKuLR5Qt8NplZ2YaES9n34CRWU+mIpBGxsywA==","signatures":[{"sig":"MEUCIQDrO53bGqUbUWaTR5ns1pGYeZ8wEgM/MirGVUwQPaUfqAIgaG31r6ujZsoDGPEgreHblnzYqF+awdtAv10XOhnOsmg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMc9+CRA9TVsSAnZWagAA+C8QAJ4UKgNBzatLHArB8EMc\nKeFanzZNAlaLxlwzLZ5mmjxfncNb/vI5lvAH4K6K/zLTveze88UgWFImCqJA\nel6yq6s2uTMniFEZVePIwP+itPYijvaVjuX7vUgD2st1J02DytReJuK4yp21\nppDhhrqFrMczIHkpl9n1r8lCyZbdOyrBn8RVLU3M7xNbt55VlQiR5ThGbJ2C\n5mJSyURjJ7okqUP3vJ4BOv1/0nDsxXD3zhJGWPnHu4xwVkeZoKMMNRz/q+C9\n7w6noD73C37smZVIUV+yn75lNyKuIZKWiasgd7S1hCMCF7EOIRn+8Sqt9PnH\nqfXyqN8xtKnaJIjdCkVKcs3QPoOW36Qf30opd4e2kOQLi9TVCLwwqEWkRPtq\nEZZQ+mqM+X9k1RexQkxZVVCx42K1r/5HNLUEB4MCktcD+1RV3moGWWXhKZ56\nwAxOHHVM5eme1vu0dtb00K3wJaEbrKuLYaRnCqwpPS35VNtTSJc8XKEEmQVN\n8fvaGtifM8zzdh0lHi0U51XvdXEkuXF7A86I4AncnoVwCVEm9mH7/5fnMrKg\nQrpl0q8sB5DV7ZWFfV9wMG+JltU6xv+ahGHgpomGRcWQUcgYEtzIbHrPH+sl\nDaBWT3DXte2kHtaYye7wQipAJdmnz9B1znX3ExpaTe9KkkwHZMuBzCx3YJro\nG6/t\r\n=Lp4W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3dd17eaeb796b36aeda593de120f16c60ff06a0f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.117599a8b.0","@material/rtl":"13.0.0-canary.117599a8b.0","@material/base":"13.0.0-canary.117599a8b.0","@material/shape":"13.0.0-canary.117599a8b.0","@material/theme":"13.0.0-canary.117599a8b.0","@material/animation":"13.0.0-canary.117599a8b.0","@material/elevation":"13.0.0-canary.117599a8b.0","@material/typography":"13.0.0-canary.117599a8b.0","@material/feature-targeting":"13.0.0-canary.117599a8b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.117599a8b.0_1630654334731_0.05092057397978267","host":"s3://npm-registry-packages"}},"13.0.0-canary.e4180d07b.0":{"name":"@material/tooltip","version":"13.0.0-canary.e4180d07b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.e4180d07b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7980abfc74d2d7963270f4945e9db9a3a96b27c2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.e4180d07b.0.tgz","fileCount":34,"integrity":"sha512-91JwuLqnXx7EQwo+Lk4uddtiWrUxM0DMwmQW5KDkeWRrBVngEl1r2ogtIc6McmlWsgrFwqrlgmQmcNzfWZbsTg==","signatures":[{"sig":"MEQCIBHtUSxVovl7HVWIzX1a863xt8mHKYS+L65m2kNGB0PQAiBcd34zJV63fZEb6Fvg/5M7JsjrU8ht6Mtq9w4rhCFeTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMc+dCRA9TVsSAnZWagAAZ0sP/0DYmBSgfZfkjyz9uWHN\n2m/wec+/TpWT2vWRUTqqUwXoDYLNVWrnAypj43ZSw6XJjd5gxSFSg3y4S+Q9\nZdDdj4SlLsJRcLl69tHxg/aOh0FnDiDISC35OVrhE/v0/zVYffyVRa9Q7Qcy\nXgrDd7QhZwiKxsv74oQFGurjn2hTT1ZibC6Q5SJMpaN2NP+q2aM8UJUfP5Gy\n/Mk534o1bXAac/MU24A/oZ9HpPsktVKutlm/l2E/JvlJtGk139waiziUts4i\nTkVgT9Ym7GPDYzsCEhQGmwXOTgScNnf60CMzx7PunX/5ukAoQrFDIwYDVSPn\nSKEmfr4YTSCM8d4C0RThFJdm7zJIYqBHG4nZLlj2bx0/Wyo1PPiH+C0RiiV9\n1Z2dUxeXF7IYFCnS+bbK6KXnR9rydlxYCKZLrCYf7FCFnze5fJ4u8CgK+MLq\nfkheR/AEiu8lBGXqg/qIQhOXXPNvIsMk6dKQ+v6I88HGTfd2zg+Tk2YMEn2z\nOuxvq65fAb0wlLiy4yyhj7renrNyHS+CXIOhox7il5/l2hSl9myXwmtJn+2P\nmchk6ZsSWuC3fMzQ1yqvObsfJyHonY+o4VRucQPLbmqafeJvpjXsAR+74lhR\nuL8IcUrr3SgwR2KMTxc8XGWCszrD47WM0U93k1OjEi39oMZNPuNHy/pyoukK\nD4ZM\r\n=ew5g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3b94d02f75df256cd0543dbdf5062823ee527d4f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e4180d07b.0","@material/rtl":"13.0.0-canary.e4180d07b.0","@material/base":"13.0.0-canary.e4180d07b.0","@material/shape":"13.0.0-canary.e4180d07b.0","@material/theme":"13.0.0-canary.e4180d07b.0","@material/animation":"13.0.0-canary.e4180d07b.0","@material/elevation":"13.0.0-canary.e4180d07b.0","@material/typography":"13.0.0-canary.e4180d07b.0","@material/feature-targeting":"13.0.0-canary.e4180d07b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.e4180d07b.0_1630654365053_0.7694033617507052","host":"s3://npm-registry-packages"}},"13.0.0-canary.42d175efc.0":{"name":"@material/tooltip","version":"13.0.0-canary.42d175efc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.42d175efc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6333ef2c7be61563dac05514fada2c3d8fafc927","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.42d175efc.0.tgz","fileCount":34,"integrity":"sha512-4yfYFqN+/9+MWMvMP3hj6lnR41VK8iSG2+jWopYHDPAmdcJiGsjHZUoRn1igCwxKWEwZ++JlwCZy33T7a1D13g==","signatures":[{"sig":"MEUCIAaraFxdHfbb4FxDyzgChnPl1lZuceP1b17K3nlIbAt5AiEAq4gWOtFSOuX+dmp605u10RcIUGs3UID/JBBVEYeYNzY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMkKhCRA9TVsSAnZWagAA4jgP/jGds3z56UQBMlfAAEtl\ncn8PzWAdk6P7JPaopw5BvfKbkdbKW8WOMy5D9amwQmJneFbecvVIhC3nkzcu\nWD5dUErpakTfdse1Pm8egm1O0unTTVnKUFIEg3VRoUURpAeQRoUR4nz/TBOU\nrBmgVNjQUsrPGQE82mvAbGNrF543i9oxmd5i5IhX+M6fuyJwZnGjWP9BCCeZ\n/S9ZirfIymtZ/7BQ/3G2GCyVvtM2Ho3LnAynrcYfuppr6IC/AGL4jIBLJKhr\n3is/wx0xNqXhAI5it2aTkwQt6Nsd1uGUX7pIGQZVaONig2dZh5G0SKUy3pq5\nXmd/JSI9PovSjiMyNmgCTxlnRZHOKL8ekfEcr6msnbMJdYPgNbh97BuV38RG\nguKTUF8dPfOJjg3+TvKpfeBlIxKA+ZhfnRzV9viTY5AX/1JOkpuQlz1WgUXS\n1QJRG7A5laiVFXpzVBXLxcL2Tacrq011b4Jw1aYSWsn3Z2nPyiMcgPCdGZXJ\nqC4C3LQKeFY52rTLkhvXO5UQ1dJ7vVPqfnLUzrRGCX2i8MwoHWjNio36xe9Z\n7EOhhE3v5QLBD+fGcq1/brxntpcAuQ8TQYUru8zBE9uiQyTsumVFxs1OiIxf\n4bD2WYNkroppe6B1nc5Y4ZXgwF7ATjv3fSrMtJUBZQL8FY7Hy7ybVKWP5IFo\n27w6\r\n=Wal9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"64e749d9e76a60e5559d8b19e4b57da1f44ebf0d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.42d175efc.0","@material/rtl":"13.0.0-canary.42d175efc.0","@material/base":"13.0.0-canary.42d175efc.0","@material/shape":"13.0.0-canary.42d175efc.0","@material/theme":"13.0.0-canary.42d175efc.0","@material/animation":"13.0.0-canary.42d175efc.0","@material/elevation":"13.0.0-canary.42d175efc.0","@material/typography":"13.0.0-canary.42d175efc.0","@material/feature-targeting":"13.0.0-canary.42d175efc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.42d175efc.0_1630683809057_0.6522616174053975","host":"s3://npm-registry-packages"}},"13.0.0-canary.72464476c.0":{"name":"@material/tooltip","version":"13.0.0-canary.72464476c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.72464476c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6b8ec1110a5f7b9119ab15f675ee94975bc76b72","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.72464476c.0.tgz","fileCount":34,"integrity":"sha512-G6j9M+u+Q7IDER/PUj7b6UI8O107hO6CTya1bDCnIHTY/RomMswdSC46G04szjYfG9aOta/tLYycsRKFKNQMgw==","signatures":[{"sig":"MEUCIQDZlauQL5B1h71S2ptL/Zq6sxKiFaoUcStE3w9lmOUPXAIgY9+e19GEVLLNvTpFWLKTbW0pNoaJEayaxN6lPuk4bXc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhN4abCRA9TVsSAnZWagAAN60P/3aHNstAIHRwuYolda2y\nishODQR3j6NEG72rJOfux9JYEcSCXz8576kmT0VAVyHMhpXLpt2/ju/e1/Py\nIZ/4AAe9dZnXzVZruwMTt/g9V3V9qYmKN6LOaDOkvl+nccekH8os+clwmgCm\nATNR2KYehHjgMgkbLYoY6qBsZlIQMg3XPfT39idwEDZ9CQvyTdBXvG38fGS1\n/8Rxn19uqhu5MzCIhkZ36/hrpuBXXzegjoU6AnjWVvCseiM3EmVTgLmoX+pK\nUH0Eum/FOH2O4wOfzt2aU4qZVz4Lp6IXvywicVheLZiPfoQu6Ma+lbVDDw+0\nyioEthIS8vzjEMkCIRJFKIWbM2DLFHZfb4n7yiow41LtWRpO6rZzAKzpbrcG\nwsFQMp0l+HRihePVA7xmeqHyza2WunI2chc7EtJWKEZh2SSZrwT6Lys7RCFQ\nMRG9kFFn6Sgs2I2xXaT6zVWJkC0Hv3FyeZ4sXX/XkHKWKdvlerbuN69lJDA9\nHR0dVsfDGhvWsIf7GJsCGom7K45qgLkcvQYEc7O+Yx6z9jPX042lig5JGaXD\ndMObgdAFk/8Dht+7kedVkWL7uPBYk1OQxYvgJNvxbvzwE5oPwzTHiFES0zVz\nfn3MiN+fNOapbeS3ISWquJ/kP4d5tkRe21mfNjShyA/qmdch8j85H7MsPA3f\nXIGd\r\n=k44O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4c409a18f3ef0a7ee6f9b223a514471c0515b639","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.72464476c.0","@material/rtl":"13.0.0-canary.72464476c.0","@material/base":"13.0.0-canary.72464476c.0","@material/shape":"13.0.0-canary.72464476c.0","@material/theme":"13.0.0-canary.72464476c.0","@material/animation":"13.0.0-canary.72464476c.0","@material/elevation":"13.0.0-canary.72464476c.0","@material/typography":"13.0.0-canary.72464476c.0","@material/feature-targeting":"13.0.0-canary.72464476c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.72464476c.0_1631028890884_0.699062581758825","host":"s3://npm-registry-packages"}},"13.0.0-canary.37d4db866.0":{"name":"@material/tooltip","version":"13.0.0-canary.37d4db866.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.37d4db866.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d03f1ddc8d9cf991889cb35cf846361c35fb06a6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.37d4db866.0.tgz","fileCount":34,"integrity":"sha512-2sk57lDYtA5ZKSPszEB6HtbbRGJW/9M/SHGqwiRkGzr3NeW6uWchicNEVm82G7U6UzDG/wYz5EfLyChU5MOu7Q==","signatures":[{"sig":"MEYCIQDuptiQztRlI1lK2XQx/CjMD40Rjvuq7/cqHEByJVmUGgIhAKM4lB5RvTcyOEq7XWue4hzlWcOH7dtu1e08kYPmmIeR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOhtgCRA9TVsSAnZWagAAeMgP/2O/qZ9RWx+uYBSFd2jI\nKeakfVv12s+XHuZ3MbxUPO4+VEXxqUHRBFRaZfbVgFjlzVMEMdQV3rX3WOLw\nkfj1kE2orRLsrB4XasoCSBZp7CzMOPd66XeM7yB6DhvvCyi2LaNS7nirS1vh\noCrR2IujAwhbGMvT0JggP2N3AjiQzpuZtkInhSVKD3qKdPGE94QvGwh/LWK+\n7gGamGZUocWMMS0GVZ0Y8r3e4Tu8wbB+GoWKG8SVF2VI4+NiDuSQnFLmxlX0\na5NqcvzJVCgNGhlvO81CK4KTbFD2w59r+mZRW8t9q6LqsPd/WQQfXOH1otO7\nvDl2B/qwfYzZovnYm6V00JJmsC3lxmXRvWQ6CLoADNTuwdKyZ9y1Oh3ONFOF\nmxTtMg1ZYwUKOMZ/fUyaxykXHIjNrFTl00QyYbuVUaqOlgbObBkdMGLs8HCe\nB15MR3HkP5v71lsYEmy3ADbWBuU1e6Jy5AF+V1eupT4SOLKMGy4Z5ftlweHS\nQSLDohfxYwOArjefCMsVSQi3MJmCFDXJf44eePtSZ3DuzH6ET8U3EDR+1chn\n9bPjjnhAtk+bHvcV6cS7wnMOR2wmXRAB+tUVfJIwkbibUDGglca62r2P0nch\ngRcMlLcWi1iclPgD+QnDYPKl5eqG4bLh/eWVivzTTerivLri8B51rwAFelhH\niZdb\r\n=qphJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"25270b452713f831fa1adf302fa3f2c357ba759a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.37d4db866.0","@material/rtl":"13.0.0-canary.37d4db866.0","@material/base":"13.0.0-canary.37d4db866.0","@material/shape":"13.0.0-canary.37d4db866.0","@material/theme":"13.0.0-canary.37d4db866.0","@material/animation":"13.0.0-canary.37d4db866.0","@material/elevation":"13.0.0-canary.37d4db866.0","@material/typography":"13.0.0-canary.37d4db866.0","@material/feature-targeting":"13.0.0-canary.37d4db866.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.37d4db866.0_1631198047807_0.7867683336883102","host":"s3://npm-registry-packages"}},"13.0.0-canary.6df682e74.0":{"name":"@material/tooltip","version":"13.0.0-canary.6df682e74.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.6df682e74.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1fe7e92c9abe9ac6326ae63232cf32cdcb7b511a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.6df682e74.0.tgz","fileCount":34,"integrity":"sha512-MS77dFS0eWw+/+sgq6xhSGMFKZ63qh+gCMJOTdtHG9Zrv6uQO+7tCzDyTuQ8b99Bvmz+r8wk0bjHD+u1ImPUEA==","signatures":[{"sig":"MEUCIQDtG18zbyV3hZOBGjHC4XYxIgrKNq7lbgCHQNjMlyX+DQIgd/gR14YzNR+PUDmrsFYVs0y1NqGf6SYLaTROxHyr0wo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOiu0CRA9TVsSAnZWagAAS7sP/RgJDtSRfLc/xdohPfxD\nMfBS+vfJVEJb2haP2CYicf5NQGo4zFM7QPokMdPb7j7qwmezQqJfaO52OCwl\n9ODNasuK6nbosLSsiA1iuIJF8B+29+kpiaFplJdrJwikrLzlPqAxgsTZvBSh\nCvZ5Zw0BwT1PW/JeI9u8nOX/BTi41Qdy1TfNp1zDSg6pNE3VMn38D8oYXGlF\nWF/9QWXg/Wyf2e2zIB5wT/F1isd1VM6inpkYBGT6WmeJr8WY4QVOj9GktEXg\nXPA2vrVIoos1IiUXigpS3ZqfQzNJk+z2g/8B+ejYcsu8fRwwsshdDjyvoyQN\ngeIv75FZO6EuutC6RUXkyJdD8Qu0r46PlP89tT+lPUQ/QcHPx0wgXo2moRc1\nXFJswnjIs88AiyXbvlcFDCsODouB1dam+IzlhjGfjQppcw5B+A0g00mb0MJg\nGosXmUSAPo5lzvFTEgDKGX186Dfzvo9K8Q23eERX2YLvR6aBirN28Lkgogjz\neVrLXgcNrbx5L1i64f0ZYff6xjMROnksY3BQRV0rSbid90oAPI2cKkLJevjE\nvbMN7GI8wX3ONX3UzgcUQvubikzUXeOjuU4grYY6bkqoLa9Pt9HZIbNzl8iP\n/46QkO5EZ9JMsj0d2GzNeELKeP0cAv1/eKEFW9bK64in6RSDgVbRcMENBfQt\nUt9z\r\n=FzWq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f8640926b088e6e6fd8688e2bf177fbb60e83f2f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.6df682e74.0","@material/rtl":"13.0.0-canary.6df682e74.0","@material/base":"13.0.0-canary.6df682e74.0","@material/shape":"13.0.0-canary.6df682e74.0","@material/theme":"13.0.0-canary.6df682e74.0","@material/animation":"13.0.0-canary.6df682e74.0","@material/elevation":"13.0.0-canary.6df682e74.0","@material/typography":"13.0.0-canary.6df682e74.0","@material/feature-targeting":"13.0.0-canary.6df682e74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.6df682e74.0_1631202228521_0.019226106592763914","host":"s3://npm-registry-packages"}},"13.0.0-canary.b49359c35.0":{"name":"@material/tooltip","version":"13.0.0-canary.b49359c35.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.b49359c35.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bc118e9701dc837590afe9dff4e1100581a0a8a6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.b49359c35.0.tgz","fileCount":34,"integrity":"sha512-npB1z1xRjbIcGRfmcjMwxcdE0HDc2twkOSUgIP8cKWXd3kfY+bprvCz7q3LjrRf27udfxiEdEuXDjeVicncCpw==","signatures":[{"sig":"MEUCIQCecG55t5PwU74p4g1fWCJjyqtEPTt0hn+/8zcLApfFkgIgal0zERpU2odku2Drg0ZWIJXKlEYiMU7yrHElKu0nCY8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOkYGCRA9TVsSAnZWagAAR6YP/iPYTHAow5bvsUR1EDkw\nTjpdUk/LxsdBGt2psISwtGr8ogG+ILIt2E+KMQj7B4MyBNY7lDg87Bt0KkKI\nmUx04q44eu1/vsJ9/IhRS3zCqFGinAcRx6LvU2sBjDm3qKniP/B3A7wM5G+H\nvn/xFpzD7HrGSuLHVcp6GU5NKUUM0KZKf8YniNFoWgD7ldxjCa7V5/SGeOmL\n3UoxgFbMczsrnWv55v05vIslO9mO4/3ENpnyowPFhavH2C3DgiIHZQWUthYh\nJbYt0bJEAy2aDU9VLSQlvu52OODNJeaPMFFbETY/riB/fOL/tRxaZ0cqJwAt\noxI7TCQOixvaVCDzhpf6Lkv36mivDRYy+6QqUPIK6bbAfP9qRjvcHQXWp7M4\nQell2Bvr7c29UcL08iaSzn/oIVnQvCn9ixzQONRNyVKDRxfRhw1ue4Mer/TJ\nGCoBXq5+bavaz+bkf2VQajrSIHq60raFP40q/hSsI8Hv9Y5cYuCGDbPX8rTQ\nBsdYbOysvmNKlLPyOMr0wEk0XXkjtZQ8kChBCpJPD0LMqDi6yilBhEnyAn3B\nJNQuOgSbTl14N5QyRsN7mvGY8Y28yj/NyPYzmqJX3wnmZkxlaK/FsotA8Fsw\ng9Tl/SPtN4VVo/G8vGpO9Gtr0GoMuxXVwPwOwXb1JMZHS+0U3tXluhw4nyB3\nsWuy\r\n=3GPI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"817b18da85c93007b9b038927a1ae036f98f686e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.b49359c35.0","@material/rtl":"13.0.0-canary.b49359c35.0","@material/base":"13.0.0-canary.b49359c35.0","@material/shape":"13.0.0-canary.b49359c35.0","@material/theme":"13.0.0-canary.b49359c35.0","@material/animation":"13.0.0-canary.b49359c35.0","@material/elevation":"13.0.0-canary.b49359c35.0","@material/typography":"13.0.0-canary.b49359c35.0","@material/feature-targeting":"13.0.0-canary.b49359c35.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.b49359c35.0_1631208966210_0.6668684192855714","host":"s3://npm-registry-packages"}},"13.0.0-canary.470bd34e8.0":{"name":"@material/tooltip","version":"13.0.0-canary.470bd34e8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.470bd34e8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce4f4dc941b6bd3f8c219a10d09cd7909e5891e2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.470bd34e8.0.tgz","fileCount":34,"integrity":"sha512-GIhJ/cf9lgkd4KpUeDn6dGZZxYAsH7g2HqwEH+HXmExWfRdqUdyr6pP1Lu66QIht9UcA7vkpPWrPan/IamTJeA==","signatures":[{"sig":"MEUCIQCY0OOg25LMCZmyqsNrBaxmdYW1gtW84g96s7jH9mH0sAIgDukCggixMoL5mgUxG2OcMq8AxP2F6e9gveFkk+ZKeF8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOkv0CRA9TVsSAnZWagAAJMUP/0i3JEjLyZa/H51zbpg6\nfxwSrzFLgsbN1Yf/KcGqNTC2MV2W3F2p33kLK1KDNSZqlRVws1XnwlSe/K1z\nUFQuFyVHWMcC1uAEbubrMpff3ZByQh6D1bCCQpOKTqpYYSPgLCIHOpuLYzx3\nHufz5ZCtobgPmtir0dc9GvBlFbg5FypYmtYvV/XOJW3Wbkmcirg95ny93KyD\nfQNoYjo2HjrgaaoCRF3lpbSzMDrH54s9vTMcjQAdbMkJdTfiD/2b9tBWGFH9\nO15pdMTVKOauWJ70u6loIun1jhx88P2mOV7it5/D9R6CyK5/aYX/g8fnZFWh\nTwkle1narvouxPn8RhrvxeZIeX8IhNSlB7Mwgq5IWDcErWKp08aR1qIMw4Wj\nUPqiJX4z8AdW9STrv6lTwNEzUSbCAWCKo4IsDbleWdKT8Y00ka+hhMA51+NY\nHNJ8nMCOmDbKKbtkccpCKE3e9dVN3KcKOV3zFd4OxGrUYsnZxpjFsyp7d/zL\nVLi36IN9gdROR7UJDxOTwB+fcamlybjdwZqwzAEiH9IfOlBvd5iBDhgJ+j0r\n4tgIMk6gQALHkEzok4/+cw6hOKGILMcE0eK50yi9W4rww6HmQ3md2CcTZgsk\nMiTIIFmOAQbI1ItBTLp0HePHk81GYzxICZqngx4mUDEZ1uYv0pWFtDipwjl+\ngblj\r\n=2JwL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f249b00e3cc067fbfdf722d71dd85392d031ca0c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.470bd34e8.0","@material/rtl":"13.0.0-canary.470bd34e8.0","@material/base":"13.0.0-canary.470bd34e8.0","@material/shape":"13.0.0-canary.470bd34e8.0","@material/theme":"13.0.0-canary.470bd34e8.0","@material/animation":"13.0.0-canary.470bd34e8.0","@material/elevation":"13.0.0-canary.470bd34e8.0","@material/typography":"13.0.0-canary.470bd34e8.0","@material/feature-targeting":"13.0.0-canary.470bd34e8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.470bd34e8.0_1631210483916_0.9046200817237933","host":"s3://npm-registry-packages"}},"13.0.0-canary.d48a01771.0":{"name":"@material/tooltip","version":"13.0.0-canary.d48a01771.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.d48a01771.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"34d22f1cabd67cf3205636c52f09cb7528bbdddf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.d48a01771.0.tgz","fileCount":34,"integrity":"sha512-Zydwd+1lSiIPPzlU1UOU5ck+8yNHUZFuD5mBu60uIPxeC3K6X86+AHdBgr0qZWHX8awRPp5RYbKDrUJiXxDO3Q==","signatures":[{"sig":"MEUCIQCG8U072baqvsC+dsBgCk6eG1NDmxe2F7pFVmUHv1UN3QIgTSj7U8WCZDp7zOea+/DrYwELUjVT9R67ynO8xfxtRb4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOk4yCRA9TVsSAnZWagAANVMP/0I04m3yZXuZxSz+rNLv\nRQ4As+iMq+VDqoGy86OazfLCm2+zfc+DSXPGcu1hd31ntOmBwyBFa9JPoTi0\npAc66xEJlW3lq5GcG6SuWLjESLBPloGfVuN/uqKcfzkZ8Kmb0f+iLoRi7XMc\nM2tkfchbCvR7+epXP3/gvomFlQyfgbOfD21OgXvyhYfcKS7/Jg5GcLrJv09E\nejrbZZh/kHKSvMkbyAZz6NlFKwqEzRbyc6IdHxKYhK4uvALi2M5igw8O4DO6\nppH739wagp3IlnyY3xz7kFSCWzYGEdMPxOrkisu43qK3/iculd00znpEs6hX\nkaQ+GwLS7vIScokIKKh7lblhX0Dsy8rukmSEQoEzljIxjOU2dRIfpV0lVQAD\nipuxsi0Zl4GIl0LyMJ1Z/LlFTCNHauxPSFVCAGNWmRSCneOwxSDiIeJ2bHYd\n7Jxt8rPbWFpFCJsVlmYGitmzvLPzjMebs8ydfvMDu2/nzP/C9g5QGRK+kP/l\nufm9vOAqMmQkjJCcp1oflXGT4RyJbAMFlcB4za8g52nhrrdIIbUh3T758pLk\n7X6JKamuE16tdzB5/13S5v9rT+HqY3APQ4obvgqY9zD/2/qJOdnnaA5sRKGn\nzzhDX/SGwXaouFuATqqjOpf1TOPUhFfcVHEd/NHl00wyY42wANdPKbaMcn/7\nNpmD\r\n=Ty1c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6796441e86b583e99919b207640bd02efef6fdeb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d48a01771.0","@material/rtl":"13.0.0-canary.d48a01771.0","@material/base":"13.0.0-canary.d48a01771.0","@material/shape":"13.0.0-canary.d48a01771.0","@material/theme":"13.0.0-canary.d48a01771.0","@material/animation":"13.0.0-canary.d48a01771.0","@material/elevation":"13.0.0-canary.d48a01771.0","@material/typography":"13.0.0-canary.d48a01771.0","@material/feature-targeting":"13.0.0-canary.d48a01771.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.d48a01771.0_1631211058135_0.6726331925065017","host":"s3://npm-registry-packages"}},"13.0.0-canary.13db34b34.0":{"name":"@material/tooltip","version":"13.0.0-canary.13db34b34.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.13db34b34.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"313675172b86e8e99136d083da13bab8aa57227a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.13db34b34.0.tgz","fileCount":34,"integrity":"sha512-ifk5GxU4HJgPLYdBKjmjyCic08G2c26s0aBD3/TYe+oRMdpxZMfN2BWWvZ3qGrAJJbMAqdMOVFzwpo5/Nr0NxA==","signatures":[{"sig":"MEUCIEiB6QsU7HfaO/P7vY+kP4S8LpNs4mrimjyHZG+VqYygAiEAvVYTx50MRPrwwpRDHCxNcMWfnZcvICxDKQAA+tvjiO8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOlG3CRA9TVsSAnZWagAACPYP/jxDXFeR335XpJxdy8wu\naWW4QKDBX+J0s1kwMpi+pbED6XZvRB9h0mZDxnV8XgP406U7HgBJYnwkE751\nUr+oviXJ6YHbSQ54VVMJ2jkMWx/o6JY4VSQlvaU3LPuEPDJY0a67HG99Eu0m\nAm7lVq1OUTcdHgYK/PtrFZui4XukECRae+Q1fPNdhw0YmZCSoHaWyDH/72xB\nt1BlFL+tkOLamsL67rG9RqQtbmWZa8JM1iVGkIGc7ymcblF2/ZYXlHcoN79l\nDzHPRT8NWxrfjUkedzOmRQ4MYbFbqLQQH6rkowxednSjUCxdKmwFm72YyNV5\n/H2mLuzrnpFAxgad989DZBKpXXLLEa/H6hD92cW6Dj2+e7s7LSBXk5ZNwUAQ\njQymDcoEdGscoAEEC+/hiSuHS0MaHrK0FVv5c0el2zmrBrQ9hlYEDQjbyyfp\nVgHd/qrnLwuXhP1/u3pTngmWgDlx8vm9iB1tSG4gdu+4pHh6H8BVLVIgp/qv\nFtBSkQJA7yHsC7AE7VybL7loZ8ZNGkeH5dmI4cYaHw5zqC48U081xUAKa6bt\nQExsw48wTFaTHNEuv0smIqCn/KU7rzsirriikWyjF35lLJYzsObLo7ybObNH\nOS7brRhKelBrApMrfYiom9dyzjkRQipvcr2UQbjapv3rRG4bVyF0En49FRTv\nrkes\r\n=Hpow\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7883b32c9c6a3280e801925b874df667e1055809","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.13db34b34.0","@material/rtl":"13.0.0-canary.13db34b34.0","@material/base":"13.0.0-canary.13db34b34.0","@material/shape":"13.0.0-canary.13db34b34.0","@material/theme":"13.0.0-canary.13db34b34.0","@material/animation":"13.0.0-canary.13db34b34.0","@material/elevation":"13.0.0-canary.13db34b34.0","@material/typography":"13.0.0-canary.13db34b34.0","@material/feature-targeting":"13.0.0-canary.13db34b34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.13db34b34.0_1631211959269_0.825453065434044","host":"s3://npm-registry-packages"}},"13.0.0-canary.864798678.0":{"name":"@material/tooltip","version":"13.0.0-canary.864798678.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.864798678.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db81f8ca451a1767391d2a6d683251b34610b56e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.864798678.0.tgz","fileCount":34,"integrity":"sha512-9/mT0vv3bi85LU5awd5SW5tLUcL45hcVrvsKkiAfRBdSwO1F2T8FCXPj2FXgb9tDN6hTbkMoIQSYt81DmF1QKQ==","signatures":[{"sig":"MEUCIQDVYEabd4Ux2FlPWrC8YT+LnTZ3yP+LkbOR0uoLsZqeUAIgUwFyMssGK6hYZq8KthCi7nlIuRh6rhXxLBiL3Dc8gDg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":805809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOlRmCRA9TVsSAnZWagAAw4gP/iIbpPKrSJOFp5OAAG5C\ny5ry7gDYs+zSX8Q1Qtmj2gr2DbCYl2UCgWB8F2w8twHkDlSQwsnWAz5mbxgl\nA06UTspZCyk0789Otq4KZy12SbXq6nu62rdCYdtHiWczQoAFOeQFiuv7Dci9\ns36IJ8YxwAXWXPAtLX1aP7zIqGTbHOF3K/06PDJ5BOZSTsC+sRjDpxyM+me6\nFtgoMpJblOYowOC2CbmRovnu+r5ZK+mWkITBKAATxCBe1vODAnwIz4s2QE2G\ngVasA0SF3AxpDqt5GCiDkG/0U+ZtVEkMOZLDNIk5aYm2eqzXmbeEJvHJ9Z8Q\nP6YI5hUH8SzagvrYNXBZVFIA643nuqQSIHyhZAvATZWTNy1catmGIrTZwqlv\nTudLAZu7boi8ki6d3/8+VuMolhiNbzOVx46Atyf0E7BJgCdmTGrsFc45/mvk\nMGrArLpNvs7iQLni6ElwCY1mzFIBk8cApzY8Z8bT6boQn6nxFeLrodLA21By\ny4lj1bi2FV1uWo6LpCfgBUPneTPsmBQKKhT1ETABtnvmAqIXjDBqiPXoQAFy\nyHlvQCC3j+cJAue3AvUdjtc5SElraTcaMNmHfqQUPjuWgNKYdGzHLSYHiLdH\n4RrlDwVOKgJBnvlABGJuvFidqW9W5yHsfOBslq46dU9VT0Inj9yh3wl2Trx5\nG45h\r\n=10fX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"08d2ae683a56b5e86f7a54eaf5a2090fd4288df1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.864798678.0","@material/rtl":"13.0.0-canary.864798678.0","@material/base":"13.0.0-canary.864798678.0","@material/shape":"13.0.0-canary.864798678.0","@material/theme":"13.0.0-canary.864798678.0","@material/animation":"13.0.0-canary.864798678.0","@material/elevation":"13.0.0-canary.864798678.0","@material/typography":"13.0.0-canary.864798678.0","@material/feature-targeting":"13.0.0-canary.864798678.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.864798678.0_1631212646580_0.8545406850490898","host":"s3://npm-registry-packages"}},"13.0.0-canary.d04bda3fb.0":{"name":"@material/tooltip","version":"13.0.0-canary.d04bda3fb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.d04bda3fb.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a954f614cb2d65c5de86ff870b992b34bb6c1a50","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.d04bda3fb.0.tgz","fileCount":34,"integrity":"sha512-wX+tmD/7Oxe8iMryoFw0wXI9tDLNPoD5Hq4jGH/cYeBMi4F+sVF3wN0zJwEVVkYriGTGydC+qg2N3e92OcKgSA==","signatures":[{"sig":"MEUCIQCHfacvXWCQcnJL1iMJdnkmWKaDFRr9nYMFUpJbv7iP9QIgEuKQBGelhBmB9ZMknIOqbTKcOpTqh4oVBEhWoOD9Ddc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhO3gpCRA9TVsSAnZWagAAoCEP/AvJqIhQelHEqhjjYbDj\nRI9XcEuoeUhc/dEUEllTeD2+AVCVN1kAtMkR7yn97NYr7pgoxdYBp0YucflT\nFFUU4Zk2GzUcAOVir/e46U0/95PFkcncGxzhQvia/q8Ff9LOI8c00nm3SrJ0\ngciVbmwwre5PifgsuCMGzX0RnBTzAiaji9YAG+zKj1rnsTXhGVWMJtaVfE9m\naQoQy9m8NoQU8Sr+R1Swxnl5gQFuBaDE634wm1qim1uS250Wm9UdUmuecPId\nXW15BjTRA4FJ/oIoGJZMfGb40oQMj2inDxGghkZ44AtGA2JLzUaUFtaYLbQR\nHjeAHOEsQoWVoi2tuVaFL5fWsZJl9gp6WfM8HjgzPF4hgFnTyn8NrY6WqWDP\nf2dTyH40D11fJFqwydm2PTwaff0uywVtB5MHymognpNOGCvkabFKOkFWdxed\n+F4V37ZpqkwTlopz9QWynWcs/RYc9R1GJXbhMHWbHsPTUlBaWMufb4HjvSmW\nkA73NP6BOAIvk4EWFY796mYOB3ka0jeTJeEHvpVquZLExcWnnGl2TnpTegM8\nChVXv7KPn/eArcLGYQBa3hs02uxeRgovjlJ1vO48LUFMfmXGWGYxf7GyIFTQ\nJ9L64eKBdrNxVfAvQ7DFZUOPFGmB2QN28qkQ6Pbh3ipR8oXJfBdxhrTwdikV\nKdM4\r\n=HdjZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7dcba6a47b77f0011a1f0e22b3540e2a70b285cd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d04bda3fb.0","@material/rtl":"13.0.0-canary.d04bda3fb.0","@material/base":"13.0.0-canary.d04bda3fb.0","@material/shape":"13.0.0-canary.d04bda3fb.0","@material/theme":"13.0.0-canary.d04bda3fb.0","@material/animation":"13.0.0-canary.d04bda3fb.0","@material/elevation":"13.0.0-canary.d04bda3fb.0","@material/typography":"13.0.0-canary.d04bda3fb.0","@material/feature-targeting":"13.0.0-canary.d04bda3fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.d04bda3fb.0_1631287337769_0.9402674519218603","host":"s3://npm-registry-packages"}},"13.0.0-canary.5533f73d3.0":{"name":"@material/tooltip","version":"13.0.0-canary.5533f73d3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.5533f73d3.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4b9d8b77ddd0a9db58379ded57aead4b2bae3b2e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.5533f73d3.0.tgz","fileCount":34,"integrity":"sha512-vtu9S099X7lkk11FSRY2rRghp4XTfUs/pSO/NCtzMm56i2EDmzoNOl8zi5lSAtbmR6bonL8ctqiQxNJ2n4k7xg==","signatures":[{"sig":"MEYCIQDc+F15lzmomGcIrzc1+X22AQwuUX0u5czPFqmAXozkWQIhAIAco++RCnG3pwdAWnwj8lBYK9aMOqyrjxO07KVKIYy1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP9jvCRA9TVsSAnZWagAAwAMP+wXxMX+RYzU0MjOugbal\nVWb6j4QViVQhyDti0yHNPFKY8X/d4ZVjioN6OGRHorp32NGE1PP+hEps6GwV\nn3rZfP3oetY0zvqvTyHM8at+R2b1bQSo8anXzG3mDGuWOVlL5C0qo6d9N0vj\n5BwN/J6U4ui4DYQJJu6OY20sCRAbbHj/AFPWJ0lOPl4gjjc68h4fp/3KaBiS\nUS99jdw5c5dmKdUuxjE69UeQIolCTcoHCuUzEt9VfSpK7TXv0QyMyrIMauKI\nTiDKRu1wKxFoz1uAD0YFhFL0xOfmACuYHvtvutbaOjJCVLX5spDojWorBZuN\nKIGHzJzE7pjY/SXjpFcCpnx5C1Wf5F2XSe3uBvyXSXY6/ijHUGDPrT/R08IJ\nhNcIrvg+JS2Pfa0chWd4unHswyYHJuuFGKe/YvPKE5p4Rr9gFkdL4l4r595t\nahBxB/xzP7pNxEhfaEXqB/ZjivRE1n/pvZOyiYr0Lv9zmuJc0PINpWgScqag\nSpjpndbK1SAZ/loxNs/CStvANpARGgEy/yTkPB8gEJ0CV/zKzKXP2vyDFhM5\n10eGbIdwyZqv9wT3swxkCsMpOj2WiehjJFgs6x0b98FFlVyDrMtQW5PATyQE\noFRoDQroG/lYNqTgmVVBiitPGPtzcVWnxRut/8DZ679mXWoIDjPG4JHxodMU\n6oOL\r\n=fS2O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"20bf1d151f241eb77dfa3233eb61f4e35d5b2838","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.5533f73d3.0","@material/rtl":"13.0.0-canary.5533f73d3.0","@material/base":"13.0.0-canary.5533f73d3.0","@material/shape":"13.0.0-canary.5533f73d3.0","@material/theme":"13.0.0-canary.5533f73d3.0","@material/animation":"13.0.0-canary.5533f73d3.0","@material/elevation":"13.0.0-canary.5533f73d3.0","@material/typography":"13.0.0-canary.5533f73d3.0","@material/feature-targeting":"13.0.0-canary.5533f73d3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.5533f73d3.0_1631574254668_0.7935597705738335","host":"s3://npm-registry-packages"}},"13.0.0-canary.08398f880.0":{"name":"@material/tooltip","version":"13.0.0-canary.08398f880.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.08398f880.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dbffae8ddac89a9fa4d43c8697ac6bdfbcf19783","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.08398f880.0.tgz","fileCount":34,"integrity":"sha512-qvi2w4XGMhPnL1A2BrLGHfZk3t1oRQCHeb2iRZIOzVUxIBcr9dPQjnPb6KEd9jyd0IiD1f9KmxIteS5rlcHQzw==","signatures":[{"sig":"MEUCIGSLQYEiBuDfBwW8o0QKXhd8Jg28GBApg1GEMSZ8F0CNAiEAx/OJWV4vPQ7ETT2c7Rutj3Q8jDGQiD3qvOt6dpM59sA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP+AfCRA9TVsSAnZWagAA+34P/34yVtZVgwKLqqcFIRvZ\nnPoNesagaxA3+hhP1+6UNkz1HrdiO/SqbUQlOSXxuLgOU6UdVKT/yM/ZrNyf\n7oAtZs6Sv0k6Af81chpQSMFuIa1Iji+sEUWuJYzshwDA7qyyF4wYqvGaTHgl\nSu+7yKJQkjgwYvta1Q3YthSdDAZQ8hfMGBz9d1NqYfPKKTY3F6vrCpUbDgdK\nkzc3hLuyj7oWV97sQCPLiTKJvM35dUDwZUYXYMplK6XEqRWywwUoGa9hjmir\nwOYHXf85F+XLCsVa9gtog9kyBeUjr0lnmZoGKmlO69Xv/6eEoTjhNV7ZiYtE\n1IVrd0VRwhVgYesOosjfsNQ7GW5x0PAXdMWmsuazYPItrtZ1vz+8TWs59OsT\nCbb6vfDATmw+VvvFIkHW6YBOzLoIbI59+SxvzYHHXuMQkD/jPBXGksr3zmCV\nHfvs6HKECTN4htKe7R/oGOD1eeR7mVqUvLbOm2Reg3Hznnx2gL15ffDNfT5G\n2UXMTpBTRZo840hJTNZl/bTe4cB/z7sMXf7LKBlR4TiFnjtX88+CL60Jf52n\nWykb4/l99UdByP2jr7e7l+bPAf1L+TPfNEaALRUAlcTNvhXSyUB3e98ItlyR\njcwx3lblS2PsQrkhsEaTwiqxYvfpof4+97uoO96zuk2/iJ3TEQBPD2dyc26l\ngSwE\r\n=/Bk3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1a993a7d6bd4a018cc4ae230bf1cc3fecfc16d1b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.08398f880.0","@material/rtl":"13.0.0-canary.08398f880.0","@material/base":"13.0.0-canary.08398f880.0","@material/shape":"13.0.0-canary.08398f880.0","@material/theme":"13.0.0-canary.08398f880.0","@material/animation":"13.0.0-canary.08398f880.0","@material/elevation":"13.0.0-canary.08398f880.0","@material/typography":"13.0.0-canary.08398f880.0","@material/feature-targeting":"13.0.0-canary.08398f880.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.08398f880.0_1631576095205_0.49176478414736335","host":"s3://npm-registry-packages"}},"13.0.0-canary.818f4ee93.0":{"name":"@material/tooltip","version":"13.0.0-canary.818f4ee93.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.818f4ee93.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3c48791ee0b55889966212a491c01a8531d7a6e0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.818f4ee93.0.tgz","fileCount":34,"integrity":"sha512-GZ59D/C02Smj5aXGRKZPhW4pXK8qzFOXRy9tKQVtaG/VRwZpKWnyoslLFxKdOWTSqVMbN3FnpYA7jNhVO+96Dw==","signatures":[{"sig":"MEQCIClrdRpl7UuJMpjiSwN3ypbYYS4bO68/b8ohtPqGybUgAiBEfA6YaCgqVsifKU5wE/sGyxnfqxT79H6LoRuayZrbgg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQjJ/CRA9TVsSAnZWagAAkoQP/26t88EbNVbuDLlc/GSo\nWCBT8iaXc05Bww3cg4UhOqSJ9hESHTx1QQqOwMo+VBb2ekCFtfcdwbvAMFt6\n3UpFVPaCGI9rMtDBSpJPI5Swyw4UD7C5Gr+UuSOYV8GFp4xjzogbPoSpYKDt\nUSIqgB42sFiaFF7LP6KHDb6qS++xl8QQsh5vGCDeeOCGOLjbfzKlnDacRiOp\nnX5hUCRGkD4uIs5oZnSGmIlfCbhC1EYglXGcbrp2FWh4/W2KWOcXZ+wcsunQ\nxRsu0G4AQiyg5RHscxHeUNnD1Kz/XBie8rUy9aEDLKSv7+P2VY59mUrAdbAB\neOL0zr/MrBHpNNrxtsjHFvHQ7lPQpXtnHOdF2ZJBNctAfz6s/Yo2ECq+ygLd\n5kn81ISAhUn6VPqgAALw1yj285EaXH8qJx6kYQxmfMkfR90NlxFPr5aOtRGy\n5/nynuEv7cPed4x8Dco8rLTfoxxG1U5I3o6N3VEWNjM7Bh/difQYhhBLjOtV\nanHHabQK6sa+OstTov02USWkK0WRHwiKYlAZdJnAHJMGs0OZIlFF43kDVnkv\nxQrKmrAGJt42RKSt7Ql47eHT9oLAhH/2n2z8EFBi94zodP6XCiWF7N1YYJ3y\nE/Dlc7hsIwAPNQyfjMZ09ETcl+LGYzCJCSAJom2v8RjTYbM6tLiq1pJnS4cO\ncS1c\r\n=o7lJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1d88a726d331a878c9a8721e3237e8cf6df49f1a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.818f4ee93.0","@material/rtl":"13.0.0-canary.818f4ee93.0","@material/base":"13.0.0-canary.818f4ee93.0","@material/shape":"13.0.0-canary.818f4ee93.0","@material/theme":"13.0.0-canary.818f4ee93.0","@material/animation":"13.0.0-canary.818f4ee93.0","@material/elevation":"13.0.0-canary.818f4ee93.0","@material/typography":"13.0.0-canary.818f4ee93.0","@material/feature-targeting":"13.0.0-canary.818f4ee93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.818f4ee93.0_1631728255499_0.7519186268520006","host":"s3://npm-registry-packages"}},"13.0.0-canary.8355e14dc.0":{"name":"@material/tooltip","version":"13.0.0-canary.8355e14dc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.8355e14dc.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5d7d864e2b103633ad4e9c730fa1f3909a6ee2b0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.8355e14dc.0.tgz","fileCount":34,"integrity":"sha512-6NHOR5jJ0T7mrVzndSj+Vhj/L5ZFtcC8LyuX0vgJbjOiJ40Da83jUNZ1bG+Qgr99Nghvrvz0y6kkzH1gO3JqQg==","signatures":[{"sig":"MEUCIQC0JtkaFmryQvPxsF8nRw1bvOVX3vd8pv9z397n60hqnwIgXSh/nNDf5DMbShFuq/k7VIZpZw8rZBXUto/2VY+ZsXU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQkW2CRA9TVsSAnZWagAAOqMP/3CgN1u6cVK3RARiEKYz\nkTVudgzeRmJY5E2k7GZh+367ss5P2kVg2DlomFX5JHSJmt/+dnnWX4W76SCP\nibZ5yO5sUahhANLlQbxAHbnhYICmhPi2I/NKNAFVw608yisIYxWHxQQcccVq\nI195ra9wuxqIh6Qy+Y3jJCGiPMb4Mr+I6z3V8Y/ZQwiKkKRMJpDafGXwSp23\ntVqYk+yyts54OB0ENo/wuHPt4ZUzbQ3jRUOeQw/VcvXAI2NXeDbQtNxhsD8p\nTPKFVkUp/FKMEXrJ1OnJKCKNhbPGgu2LD7ENkNJFZPy8xbJpsmCO4lVh36um\nYfa9iMYiM3Uxj0sF5XkXqKTQZeXDV2FQmNRFijoIaz3fNrPslpMoUf3NsrBh\nr0WcUbnLZ2YV36VHVjrirWfjigOCoS3M51xzZqnrUsNjWL3gQx/evoRTHyiz\nOVUbzzmsC66ZPm4ygpPwv+qw7g8mpeIQtpFpAupo+uF4AyPyvQdrAhMiiXFL\nshh9S2qVFyZ64bbxyGwnbGL88Pr/ZpuWMvylIWfOiznv5XVzy9rYbjRvr9mD\neovGa4C0eZBX+2qeDTwWN2K/O94hSs+WmMmxGTMy9Ph4RD4A0A5L0ACrfJIz\nx9x9AWqZ/P+aqLf0BCarfCwwp2dIa5lLrUH4v1ADH6kj0KYtZR/Geb3W07XQ\n9ODT\r\n=WzDB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"065f64e5cbd54d86f092d8d1406bbd0852b2a6a7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.8355e14dc.0","@material/rtl":"13.0.0-canary.8355e14dc.0","@material/base":"13.0.0-canary.8355e14dc.0","@material/shape":"13.0.0-canary.8355e14dc.0","@material/theme":"13.0.0-canary.8355e14dc.0","@material/animation":"13.0.0-canary.8355e14dc.0","@material/elevation":"13.0.0-canary.8355e14dc.0","@material/typography":"13.0.0-canary.8355e14dc.0","@material/feature-targeting":"13.0.0-canary.8355e14dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.8355e14dc.0_1631733173860_0.25386046915644234","host":"s3://npm-registry-packages"}},"13.0.0-canary.d4e16a6c4.0":{"name":"@material/tooltip","version":"13.0.0-canary.d4e16a6c4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.d4e16a6c4.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"97d22542c7267b2a89df7b75ca4f33355716d6e2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.d4e16a6c4.0.tgz","fileCount":34,"integrity":"sha512-bEhm0M3KFR2L98Ez9opgbDRm263R11nVGUhSjGzz6DZZpOCogQu4DDMlevFiNiWvx/m5i/nbQCh3nvGayiaa0w==","signatures":[{"sig":"MEQCIDEeDKpOIrCOwgUXXJrnz4Krgp6+RKvFhWAHzt4ItKmsAiBLIkr1GFI0ApmI+gkmyB4kBWfhgRkh6b4DM1fToodm1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQmzKCRA9TVsSAnZWagAA5YcP/iIUOQ8xPO0HcmdH+8MJ\nN1SyAwY0nH9lkd/WPWfS8yj/WJIXA8aooKTNuL5XpVQi7TnQbOLTGCL1eYjq\nmhsmcq+EOyWS4F2JZSD2mckcYAYeNu7sKVQoeimZYgkuExo2KoOpZgQPMsz6\nk5JytPpsF3S+FqiDQcuf+Q5eIAtKFtC6N6ervRUol0kNuv5VEjxO5NTwhDIm\n3+Q3KJiZY3dQ5SYIpDdiHmyqN/1Z4KtBpGkacPwtTc61Kgb/2b+aCb+uvyHO\n3l2yp+RUO2ZTTduKR9pk3QX4rX7ZpssvLhN2SrftUsPoADppSShq9yzMgf35\nyQGwyOtBQjB816Dt/+k5U3sqW4IHJMP6eoEsJYRiAPDZQ6YEBBWUS8aivZnS\nD2WAHpxrXIrCay2OIlPYmdhiH7Feb2qx52mIfYLwCE9r64B4P6eOPEpGR7wq\nKhiiMNd+5Yg2KBUkAEAVo7xgimtCEODW/9PavHRkQ00VOAcjxnClnWR0xnP+\ntm4XIYkCKGbI35saOja6eMZlQwmb9vJQkI+sdBU7WSZeZfj0sA/LoBRtSS3q\nRwAu0alaTaeCT/vezvP2NjgFHYRuSNyraVQGHOozyRLZUK1+4A9y+4Sf+5MU\nELqqf1aQKUoiDl7q0/dGqFznnyXQpHqfdIQ14YAPFVImW06twgWMLfRAGkBl\nVJsC\r\n=B7Or\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2c2d0c3f7c18e3a2b581679df71df5e7a0e2fcb3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.d4e16a6c4.0","@material/rtl":"13.0.0-canary.d4e16a6c4.0","@material/base":"13.0.0-canary.d4e16a6c4.0","@material/shape":"13.0.0-canary.d4e16a6c4.0","@material/theme":"13.0.0-canary.d4e16a6c4.0","@material/animation":"13.0.0-canary.d4e16a6c4.0","@material/elevation":"13.0.0-canary.d4e16a6c4.0","@material/typography":"13.0.0-canary.d4e16a6c4.0","@material/feature-targeting":"13.0.0-canary.d4e16a6c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.d4e16a6c4.0_1631743178728_0.7300821903721464","host":"s3://npm-registry-packages"}},"13.0.0-canary.65125b3a6.0":{"name":"@material/tooltip","version":"13.0.0-canary.65125b3a6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.65125b3a6.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"260a8d103aefd88a9a18c5bf515bd93ea5b168c3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.65125b3a6.0.tgz","fileCount":34,"integrity":"sha512-dPN6/KADHvslpy707zro67Uejvcb4tOqqMVb06ZE3Xp+BzUv5pQnGQHlSaSU5Z2Rffg77/xpAz7wziCEF3k0XA==","signatures":[{"sig":"MEYCIQCEltI+V5YGoBuwvFbZKU1Eq6wj58kDZEXP1F9Uo9GjfQIhANo/r5kWYgvUX9chSVBR+wFyTUplmgJSQV0at6TbpDMN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQ7SFCRA9TVsSAnZWagAAwB0QAJ2FZAdrgKMRove9MbBW\n0c9ORcWLc+ZdWZW2M4Vis08yHX6bW/q0GVZzElit+JVbbVgbpucwMTJG4NbB\n2OMJS97yFwkDz+HpyhI5jjPSHSwXzqXzXbEaY8JAXNroid8KzzXfLvUdX0eM\ncgfFu7KcN4kXMAH6CRy2Ywld6Oz1MsyARyuWkg88mwsrkKYeNeqo6tXxGvf7\na/Tn0URokYa2ItYXCZw2L/i+K2Q6pPjCthDxf8hrJiAC6qbZ90ENLUoyC9Zc\nT0Poe9ECf/UHEMdmXLB62TOcKeWr1hZn19aEyr0y27UyFcteKh3hr7u8Xcd4\nDt68Xif2ZkI6vAqD6pJD+D1VEcq9O0oSdehTjVUVH23pl0zKSxpGheAwHLqd\nlWtu2TEe61VlHVRt0gwCCA4lFsG15ddy1/YuvVhdYAnRmPDG9GWchhhcCyQ5\nm7/zHIvt+Pcos4CrIigD4+Jf2w1D9yoQkMF7bOJfLuoUt2dB1Hp3i8jPCuRV\n8vIU0PlSpPn6zyRp7tX05YZ8Cw4nB3jQ/2u8KP6t7Gy1puhUEueGV3wRbzwn\nJXG2TiVASyyxsSKt8UptGwBfSdPOWUKP1VlJoFHJF7+MyXHRs2dEtFeCP8AU\n7aGYDMcdQk93IWdfjxS1XOzJXgAdLslH6WuL/UiaDDuJsZK5iu3ofHBrRG2Q\npFh0\r\n=oyBo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7f141fcd82e6061ac62fb457dad40c0ad70e52d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v10.24.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"10.24.1","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.65125b3a6.0","@material/rtl":"13.0.0-canary.65125b3a6.0","@material/base":"13.0.0-canary.65125b3a6.0","@material/shape":"13.0.0-canary.65125b3a6.0","@material/theme":"13.0.0-canary.65125b3a6.0","@material/animation":"13.0.0-canary.65125b3a6.0","@material/elevation":"13.0.0-canary.65125b3a6.0","@material/typography":"13.0.0-canary.65125b3a6.0","@material/feature-targeting":"13.0.0-canary.65125b3a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.65125b3a6.0_1631827076940_0.8461042692402019","host":"s3://npm-registry-packages"}},"13.0.0-canary.80a583365.0":{"name":"@material/tooltip","version":"13.0.0-canary.80a583365.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.80a583365.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0cee972a46238245016b7b8df751ff88ebe0a72f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.80a583365.0.tgz","fileCount":34,"integrity":"sha512-KMPnUUS6jZP93hCSDTj2B2E55HTnnZ8zVWMejm+3Pcl4yltc5IkS925yTOERmN/pROwmtxV2xrrZx44kblMVKw==","signatures":[{"sig":"MEQCIFhm81VbJSaNqnFwrHWwExiVsOAOEBDSnkGtZaJHfRpiAiACG5dgdt6ENLgth9Vn6iodv/8qYyGLWo9NCFo4hq44Gg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808872},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c174baf193216601da7fe07831dd2152585c6beb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.80a583365.0","@material/rtl":"13.0.0-canary.80a583365.0","@material/base":"13.0.0-canary.80a583365.0","@material/shape":"13.0.0-canary.80a583365.0","@material/theme":"13.0.0-canary.80a583365.0","@material/animation":"13.0.0-canary.80a583365.0","@material/elevation":"13.0.0-canary.80a583365.0","@material/typography":"13.0.0-canary.80a583365.0","@material/feature-targeting":"13.0.0-canary.80a583365.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.80a583365.0_1631910966380_0.4380974651418992","host":"s3://npm-registry-packages"}},"13.0.0-canary.83900936a.0":{"name":"@material/tooltip","version":"13.0.0-canary.83900936a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.83900936a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"220272628ee2b4b5c8a274f252c261006ed68013","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.83900936a.0.tgz","fileCount":34,"integrity":"sha512-5QzdbOQ3MUSf6s1KKCKEW6gXB4ValefDlgPZz1pd0JYRFYmos8YC/UfOP1AH6LkVzZ4yLDOCn1UWQdGMJSaUjQ==","signatures":[{"sig":"MEQCIBjFFxSXTt0YwgtgpnxoyPcvEVWaub06Gd2waTBa5GxGAiB9eVnfmy8t3XZ+4szPl73FB2Eme9Zu39d/t8PRVPZOkA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808872},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ca6026fb6b378ac9a4f14997612369fe29f31093","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.83900936a.0","@material/rtl":"13.0.0-canary.83900936a.0","@material/base":"13.0.0-canary.83900936a.0","@material/shape":"13.0.0-canary.83900936a.0","@material/theme":"13.0.0-canary.83900936a.0","@material/animation":"13.0.0-canary.83900936a.0","@material/elevation":"13.0.0-canary.83900936a.0","@material/typography":"13.0.0-canary.83900936a.0","@material/feature-targeting":"13.0.0-canary.83900936a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.83900936a.0_1631921077236_0.651626107364045","host":"s3://npm-registry-packages"}},"13.0.0-canary.860ad06a1.0":{"name":"@material/tooltip","version":"13.0.0-canary.860ad06a1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.860ad06a1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f43f69a36067ec54c8e79003df8a1d4e72f26436","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.860ad06a1.0.tgz","fileCount":34,"integrity":"sha512-w7b6JJcNXjg7onpoo/tzTUK2vl98n+/9rHTpWJNeep0LkhkAyD7tLLv9oN8agzLNEpy4r64zQrJ5gxiV7ZxnNg==","signatures":[{"sig":"MEQCIDJ4e8bk+KRj65I42mtJ4MJyzGeBjBUB7yJ/qrskWCnsAiB0POlEPmbOClLgUuvbi7EEbL3pC+HXBvU0y2TcSriixg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808872},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8f156ac018a526d53d5f5077762518483bfa7dc7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.860ad06a1.0","@material/rtl":"13.0.0-canary.860ad06a1.0","@material/base":"13.0.0-canary.860ad06a1.0","@material/shape":"13.0.0-canary.860ad06a1.0","@material/theme":"13.0.0-canary.860ad06a1.0","@material/animation":"13.0.0-canary.860ad06a1.0","@material/elevation":"13.0.0-canary.860ad06a1.0","@material/typography":"13.0.0-canary.860ad06a1.0","@material/feature-targeting":"13.0.0-canary.860ad06a1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.860ad06a1.0_1631921759469_0.11132879098779225","host":"s3://npm-registry-packages"}},"13.0.0-canary.3b8d4429e.0":{"name":"@material/tooltip","version":"13.0.0-canary.3b8d4429e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.3b8d4429e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c3294cd08018a1a0fc2ba1b7f05a11afd76e3f1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.3b8d4429e.0.tgz","fileCount":34,"integrity":"sha512-RLOhNZPdj1CDY8wbxsM2HQfTq9j7W7awGz0DKS8+IiEIryUkH8D1UPorW9LFlrYM5nqKLrh9OoSWu1cLqpUIow==","signatures":[{"sig":"MEUCIQCKXHBEPN1+/GCz4i3d1dMj6r8o/JsPq2n6HMVTTeA0tAIgYcq/J5W3BaighmpDn76F1gvfux7jc9MHSEkpcXZT1Lc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808872},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c548d2fdb2731631683bc92955d6701cd0c2bd14","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.3b8d4429e.0","@material/rtl":"13.0.0-canary.3b8d4429e.0","@material/base":"13.0.0-canary.3b8d4429e.0","@material/shape":"13.0.0-canary.3b8d4429e.0","@material/theme":"13.0.0-canary.3b8d4429e.0","@material/animation":"13.0.0-canary.3b8d4429e.0","@material/elevation":"13.0.0-canary.3b8d4429e.0","@material/typography":"13.0.0-canary.3b8d4429e.0","@material/feature-targeting":"13.0.0-canary.3b8d4429e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.3b8d4429e.0_1632160071976_0.9886735792404693","host":"s3://npm-registry-packages"}},"13.0.0-canary.2da3606b9.0":{"name":"@material/tooltip","version":"13.0.0-canary.2da3606b9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.2da3606b9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"906c8181b3874fde83e44f5ba6596bc33a19a477","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.2da3606b9.0.tgz","fileCount":34,"integrity":"sha512-e9xfOYlKiIyJo6+heyeAjmMPGhSdUSA3y0nxiUjmausfcSNdf65n1lo1wfJDdUxx92Y2xdXEJZAYbK1RaFM82g==","signatures":[{"sig":"MEUCIQCJpwcJI5hI6A0aXQur2gawT6HrHF3Nz5tcVT+g/iag0gIgaZipIcujODJbBBx87hciGQDg1/m7TNkPMQ3sDLrNinY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808962},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c452408cf52d900869313ad573c1b84c9d6a3105","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.2da3606b9.0","@material/rtl":"13.0.0-canary.2da3606b9.0","@material/base":"13.0.0-canary.2da3606b9.0","@material/shape":"13.0.0-canary.2da3606b9.0","@material/theme":"13.0.0-canary.2da3606b9.0","@material/animation":"13.0.0-canary.2da3606b9.0","@material/elevation":"13.0.0-canary.2da3606b9.0","@material/typography":"13.0.0-canary.2da3606b9.0","@material/feature-targeting":"13.0.0-canary.2da3606b9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.2da3606b9.0_1632166678806_0.267099736481502","host":"s3://npm-registry-packages"}},"13.0.0-canary.e8c598d1e.0":{"name":"@material/tooltip","version":"13.0.0-canary.e8c598d1e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.e8c598d1e.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9b6763a013a85af6cf30cd6fe91487982d4f6fe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.e8c598d1e.0.tgz","fileCount":34,"integrity":"sha512-o+MEVPk+9Cqgvmrs7PWUkYlXb5LDrgWbx2EIpSAyaizVHEwnk0/Umkp4ob5I57f8wAW0XpMzzv0OSocHbS/E+A==","signatures":[{"sig":"MEQCIAQWZiMHhGcf64XcRkF12vJ5I51xYz4+I7Z3T0KXXKkhAiBoSILdSrqVkOb+cK9pl2lP0rh6TTZ22c1WOoCTx2FB6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808962},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"11ab5557b275cc7f950ff2123684083e6245eafe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.e8c598d1e.0","@material/rtl":"13.0.0-canary.e8c598d1e.0","@material/base":"13.0.0-canary.e8c598d1e.0","@material/shape":"13.0.0-canary.e8c598d1e.0","@material/theme":"13.0.0-canary.e8c598d1e.0","@material/animation":"13.0.0-canary.e8c598d1e.0","@material/elevation":"13.0.0-canary.e8c598d1e.0","@material/typography":"13.0.0-canary.e8c598d1e.0","@material/feature-targeting":"13.0.0-canary.e8c598d1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.e8c598d1e.0_1632172329969_0.642298031871062","host":"s3://npm-registry-packages"}},"13.0.0-canary.1340ee9f7.0":{"name":"@material/tooltip","version":"13.0.0-canary.1340ee9f7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.1340ee9f7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"feda5c9ddf7eacc39eadca36d894162745aa42b2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.1340ee9f7.0.tgz","fileCount":34,"integrity":"sha512-nNsB+3IH21VjcvTxiIFqGiCxqz3JXGnhNOyv+ILySBP2mbhMTwztTQLtaNHQLF9ZOMyJuL38Gqg8P3SrOUa+zQ==","signatures":[{"sig":"MEUCIBIbwiH/hj48WRRQlArrQ39cdDuYYL6nBYBFVafErQegAiEAjFfND/XI5KAOmz9dywLJX7fQGMV6fE5arUkJFT4GtZA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808962},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c9cbdc93fd9954f12cb74ebaf2cfa5806d078879","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.1340ee9f7.0","@material/rtl":"13.0.0-canary.1340ee9f7.0","@material/base":"13.0.0-canary.1340ee9f7.0","@material/shape":"13.0.0-canary.1340ee9f7.0","@material/theme":"13.0.0-canary.1340ee9f7.0","@material/animation":"13.0.0-canary.1340ee9f7.0","@material/elevation":"13.0.0-canary.1340ee9f7.0","@material/typography":"13.0.0-canary.1340ee9f7.0","@material/feature-targeting":"13.0.0-canary.1340ee9f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.1340ee9f7.0_1632333474292_0.7837258104666502","host":"s3://npm-registry-packages"}},"13.0.0-canary.65084baff.0":{"name":"@material/tooltip","version":"13.0.0-canary.65084baff.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.65084baff.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ccba4de136e096619fea6e671e3d505a05dd725e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.65084baff.0.tgz","fileCount":34,"integrity":"sha512-jxv+wLc2BR0MRWVJEBoIlKZ7X88gENzknXP5NKoLoiq9TbdGPGA2NGBWQXc9KAknIR00AvyKxsvYoGmhfbNdfQ==","signatures":[{"sig":"MEUCIFJIYFWh56hlvbe7kqiJX5WhyRvenh3+U7Nyj14y/8XfAiEAzvZn7YnTnnW6fZF86uQ+XNQV2BE//jVNjjFv1vKQDaU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808962},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"afe4cce0d8c7e5038058ea8198ffd72e99e1c941","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.65084baff.0","@material/rtl":"13.0.0-canary.65084baff.0","@material/base":"13.0.0-canary.65084baff.0","@material/shape":"13.0.0-canary.65084baff.0","@material/theme":"13.0.0-canary.65084baff.0","@material/animation":"13.0.0-canary.65084baff.0","@material/elevation":"13.0.0-canary.65084baff.0","@material/typography":"13.0.0-canary.65084baff.0","@material/feature-targeting":"13.0.0-canary.65084baff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.65084baff.0_1632432328038_0.5963113210532904","host":"s3://npm-registry-packages"}},"13.0.0-canary.c79aa0cdd.0":{"name":"@material/tooltip","version":"13.0.0-canary.c79aa0cdd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0-canary.c79aa0cdd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"54fe8efeb18b3dcef1c980fa94afa57e9b24bcf8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0-canary.c79aa0cdd.0.tgz","fileCount":34,"integrity":"sha512-EWproXbT7LrkflnYs51FCiepBMneDH9qBgj0hiNuiAwPbJ5udxVTWrkyWux75MGDC49k0sBAYRLBdKc8sm9nfA==","signatures":[{"sig":"MEQCIAot2ypJ5oUowqm/g4JG5CG8G8C+l2mMfLNa421olf75AiBTmLZ/+mow62Fomu4XvVZrjKcBpTDemHrgIWCpcuZWdg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808962},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2caa02d38f883966fd5f78948743dabdced9b689","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"13.0.0-canary.c79aa0cdd.0","@material/rtl":"13.0.0-canary.c79aa0cdd.0","@material/base":"13.0.0-canary.c79aa0cdd.0","@material/shape":"13.0.0-canary.c79aa0cdd.0","@material/theme":"13.0.0-canary.c79aa0cdd.0","@material/animation":"13.0.0-canary.c79aa0cdd.0","@material/elevation":"13.0.0-canary.c79aa0cdd.0","@material/typography":"13.0.0-canary.c79aa0cdd.0","@material/feature-targeting":"13.0.0-canary.c79aa0cdd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0-canary.c79aa0cdd.0_1632490914249_0.027431285845486375","host":"s3://npm-registry-packages"}},"13.0.0":{"name":"@material/tooltip","version":"13.0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@13.0.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2a4360b1d9b07b7573d69e2a85d5522dec00b97d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-13.0.0.tgz","fileCount":33,"integrity":"sha512-/QinwEM0sYtRUthgOy7R+V4iwLMZ8SCd8A3PyGyTr27BUGWykwAUFdXyzT4rxLhDNcnDOYH14N+Z3Bom+UwO9Q==","signatures":[{"sig":"MEUCIQC3aAPWe+S6U2+K0mbDNY1n3s6jFBP5/G/0PhyItcpBswIge3kLWsBBKwyMx3sxKSknVz4lkIZn8hVsF0x7Hn/q5zU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807328},"main":"dist/mdc.tooltip.js","module":"index.js","gitHead":"198431fcd8ff3028934d2cf3a5b292f8482a4570","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"^13.0.0","@material/rtl":"^13.0.0","@material/base":"^13.0.0","@material/shape":"^13.0.0","@material/theme":"^13.0.0","@material/animation":"^13.0.0","@material/elevation":"^13.0.0","@material/typography":"^13.0.0","@material/feature-targeting":"^13.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tooltip_13.0.0_1632512769355_0.6646476455655119","host":"s3://npm-registry-packages"}},"14.0.0-canary.198431fcd.0":{"name":"@material/tooltip","version":"14.0.0-canary.198431fcd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.198431fcd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"387ebec7b81dc32980ab72517ff1986094f427f0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.198431fcd.0.tgz","fileCount":34,"integrity":"sha512-ny/9cKgqpKpwDY9mXAk915UpuK4sI5M5TRSkIfAjZTKIIO6OifCHGVyqtpLHS0NyrQJOBIA9KDCJ0rzDUMiZAA==","signatures":[{"sig":"MEQCIBmWXvWxjZyfISVZz1nUdDFyVXUOXUPFKICnnHOkSnv3AiBN1zK05yWDDqywwPEiK7QPOGoFOhExXVeFM1zdr1qUAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":808962},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"34242e3354729334618dc12d6bc959e0a8f14dd4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.198431fcd.0","@material/rtl":"14.0.0-canary.198431fcd.0","@material/base":"14.0.0-canary.198431fcd.0","@material/shape":"14.0.0-canary.198431fcd.0","@material/theme":"14.0.0-canary.198431fcd.0","@material/animation":"14.0.0-canary.198431fcd.0","@material/elevation":"14.0.0-canary.198431fcd.0","@material/typography":"14.0.0-canary.198431fcd.0","@material/feature-targeting":"14.0.0-canary.198431fcd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.198431fcd.0_1632512812935_0.33936451358143693","host":"s3://npm-registry-packages"}},"14.0.0-canary.9a02b6ef8.0":{"name":"@material/tooltip","version":"14.0.0-canary.9a02b6ef8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.9a02b6ef8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"03c3d0b39a3a55b54374be8a57c4eb2272defd31","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.9a02b6ef8.0.tgz","fileCount":34,"integrity":"sha512-mr1Gg+JNkjOBppb/YyFryVVKVBq2ZwQ3bueyReAPlDGxlKpVpz2qECnUoSmIPxB2Os/62bWt8YVuroFT/SUEcA==","signatures":[{"sig":"MEUCIH01ou/+1Dx1z1nPmdeaceMhreacUJyjdm0OH2atxrs7AiEAoJergeAgCUuVlt96VshTlZikL7pI3w6UVSFS+HBbBRI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807887},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"13e91b1150d6339b15d71c44c8743eb9e2026eaf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.9a02b6ef8.0","@material/rtl":"14.0.0-canary.9a02b6ef8.0","@material/base":"14.0.0-canary.9a02b6ef8.0","@material/shape":"14.0.0-canary.9a02b6ef8.0","@material/theme":"14.0.0-canary.9a02b6ef8.0","@material/animation":"14.0.0-canary.9a02b6ef8.0","@material/elevation":"14.0.0-canary.9a02b6ef8.0","@material/typography":"14.0.0-canary.9a02b6ef8.0","@material/feature-targeting":"14.0.0-canary.9a02b6ef8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.9a02b6ef8.0_1632575461121_0.7301957326827353","host":"s3://npm-registry-packages"}},"14.0.0-canary.758ce31d9.0":{"name":"@material/tooltip","version":"14.0.0-canary.758ce31d9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.758ce31d9.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"305b2b06ddc87c9ee3488a8cec84ae2d159ab561","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.758ce31d9.0.tgz","fileCount":34,"integrity":"sha512-bw3VY1cGsA4LLD4Uiir00QgpN/Buz9s2vh5tJ2kx9FzBPRQCWfEerDz0YIp8Yf9hYV5LWiUrICvEkf/+Z8bNKg==","signatures":[{"sig":"MEUCIHoe74f8bSBKuL7m8lNnTPKnKvGsFzSjwbnMoB0Ict9+AiEA/Rs7oJv6os4rS3SWPDEsdxEeOzkvbDlrBCvW0BSTmek=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807887},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"09083795b738aece76a37f8a1dcc8daf958204b1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.758ce31d9.0","@material/rtl":"14.0.0-canary.758ce31d9.0","@material/base":"14.0.0-canary.758ce31d9.0","@material/shape":"14.0.0-canary.758ce31d9.0","@material/theme":"14.0.0-canary.758ce31d9.0","@material/animation":"14.0.0-canary.758ce31d9.0","@material/elevation":"14.0.0-canary.758ce31d9.0","@material/typography":"14.0.0-canary.758ce31d9.0","@material/feature-targeting":"14.0.0-canary.758ce31d9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.758ce31d9.0_1632763754464_0.9075868916603054","host":"s3://npm-registry-packages"}},"14.0.0-canary.86b50ef74.0":{"name":"@material/tooltip","version":"14.0.0-canary.86b50ef74.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.86b50ef74.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"58775cca2d6adfda1ff4870c1bf25aee222b8899","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.86b50ef74.0.tgz","fileCount":34,"integrity":"sha512-cjV8kaH3lsFapx1uDcCoKNKeqsL1eT72pJMc8366+STWJaib8y6f0slv8c4EdAt2Uc+EsG+Jdw5qfsjy9M8qfA==","signatures":[{"sig":"MEUCIQDm2Nc2omQ4tymXaRDg2oQd1Byqoe50D+ZlkipXqPr7CQIgJuGANUxQqFsBgUZ9X9veBRz/mXCHl7XQeH5XOriMM5Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807887},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5941ece7c1e494e720865be940d098a5556de149","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.86b50ef74.0","@material/rtl":"14.0.0-canary.86b50ef74.0","@material/base":"14.0.0-canary.86b50ef74.0","@material/shape":"14.0.0-canary.86b50ef74.0","@material/theme":"14.0.0-canary.86b50ef74.0","@material/animation":"14.0.0-canary.86b50ef74.0","@material/elevation":"14.0.0-canary.86b50ef74.0","@material/typography":"14.0.0-canary.86b50ef74.0","@material/feature-targeting":"14.0.0-canary.86b50ef74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.86b50ef74.0_1632850981939_0.2707039935630602","host":"s3://npm-registry-packages"}},"14.0.0-canary.b2fe3528b.0":{"name":"@material/tooltip","version":"14.0.0-canary.b2fe3528b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.b2fe3528b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3b5ee01ec7949ba2425bd6bc7fe52c7fbb5e343c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.b2fe3528b.0.tgz","fileCount":34,"integrity":"sha512-IRoa90Wxd9uNM3KMXU2+PhSo4ThqG+u5F9Us8gG2MRObhD8BFZF/LCVjahviSNzDu1b794zS9Th+RUKq512p/Q==","signatures":[{"sig":"MEUCIQDeHWP2DZw/sUdb6vUsFzYj2CN9T7xoX7mQeXdh6C/gxAIgAhVgJNIwcGB6g+C7TAcwD0NccKsEcTNx4auJyHPQvQ0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807887},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cce11b1c181ea84c0bfdbef26112377518afa98b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.17.6+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b2fe3528b.0","@material/rtl":"14.0.0-canary.b2fe3528b.0","@material/base":"14.0.0-canary.b2fe3528b.0","@material/shape":"14.0.0-canary.b2fe3528b.0","@material/theme":"14.0.0-canary.b2fe3528b.0","@material/animation":"14.0.0-canary.b2fe3528b.0","@material/elevation":"14.0.0-canary.b2fe3528b.0","@material/typography":"14.0.0-canary.b2fe3528b.0","@material/feature-targeting":"14.0.0-canary.b2fe3528b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.b2fe3528b.0_1632956231170_0.4600072150164858","host":"s3://npm-registry-packages"}},"14.0.0-canary.586e740dd.0":{"name":"@material/tooltip","version":"14.0.0-canary.586e740dd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.586e740dd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6e19db7630c27cc39e997eca72328bd9d7b9b2c4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.586e740dd.0.tgz","fileCount":34,"integrity":"sha512-1dzOlut9ej4KCL776NsBByP6Z7yEo/PkPVkc0o51Oui455FAiyZF6zcRRegklIhxK0/RHwhPL9lUjXnnxr4jrA==","signatures":[{"sig":"MEQCIE06UgCxnUUChqBJwluxE3iX5E2sen3CLK0pA5lM59rXAiAmYNr3iKuxhhWCNHc88Yxcn+HSc/hjP3arFqKhWyQk2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807887},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6c765889db11456de00c45d7bb289b6c7cf3ec27","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.586e740dd.0","@material/rtl":"14.0.0-canary.586e740dd.0","@material/base":"14.0.0-canary.586e740dd.0","@material/shape":"14.0.0-canary.586e740dd.0","@material/theme":"14.0.0-canary.586e740dd.0","@material/animation":"14.0.0-canary.586e740dd.0","@material/elevation":"14.0.0-canary.586e740dd.0","@material/typography":"14.0.0-canary.586e740dd.0","@material/feature-targeting":"14.0.0-canary.586e740dd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.586e740dd.0_1633019495698_0.4408296126900755","host":"s3://npm-registry-packages"}},"14.0.0-canary.2ac92d766.0":{"name":"@material/tooltip","version":"14.0.0-canary.2ac92d766.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.2ac92d766.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"df8c3a61a5614c5a9dc828daab84132649b1eef3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.2ac92d766.0.tgz","fileCount":34,"integrity":"sha512-2r5FDMBBNXoE0Lg2cfceYy+OU5cmu5UZtqfl83Jdip/1vBSgEvdB9TVUtSykr6bMSFjNwnKXyhGTfoCWClcpog==","signatures":[{"sig":"MEUCIQDXdgo+SRuPc5hGeGSTYKq3cI33Yu12xi6d2cB/aFOiTwIgZaMgQdRiof8NvxF0el8sA94hH37MD9hmXMD4D/LQ0ww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807887},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3a797e3a01110aeaf8270a13c2cc32d0871a8bd2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.2ac92d766.0","@material/rtl":"14.0.0-canary.2ac92d766.0","@material/base":"14.0.0-canary.2ac92d766.0","@material/shape":"14.0.0-canary.2ac92d766.0","@material/theme":"14.0.0-canary.2ac92d766.0","@material/animation":"14.0.0-canary.2ac92d766.0","@material/elevation":"14.0.0-canary.2ac92d766.0","@material/typography":"14.0.0-canary.2ac92d766.0","@material/feature-targeting":"14.0.0-canary.2ac92d766.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.2ac92d766.0_1633462112581_0.3270067976235831","host":"s3://npm-registry-packages"}},"14.0.0-canary.353ca7e9f.0":{"name":"@material/tooltip","version":"14.0.0-canary.353ca7e9f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.353ca7e9f.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4f2e5796de35afbe102ef5df38e8cc2c893b0229","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.353ca7e9f.0.tgz","fileCount":34,"integrity":"sha512-lO6LV1/EBMMikXSO3gqouQmIUIRblcqoaWsZBipyEv2Lfu0y/7o7dl9YvdHMt5GHIwrdCImasEuYOXCFhrl+Zw==","signatures":[{"sig":"MEYCIQDgMwcH0MzPokcNdk+9G8uqv2KNJVLknn71u8kQqxCiCwIhAP/uxOYc8CgIORicKZFQBZfCRB07+XVuquJyVtGhQ1on","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807887},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4f091efbfcb52d523712f9b99808d737b06a60af","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.353ca7e9f.0","@material/rtl":"14.0.0-canary.353ca7e9f.0","@material/base":"14.0.0-canary.353ca7e9f.0","@material/shape":"14.0.0-canary.353ca7e9f.0","@material/theme":"14.0.0-canary.353ca7e9f.0","@material/animation":"14.0.0-canary.353ca7e9f.0","@material/elevation":"14.0.0-canary.353ca7e9f.0","@material/typography":"14.0.0-canary.353ca7e9f.0","@material/feature-targeting":"14.0.0-canary.353ca7e9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.353ca7e9f.0_1633718832939_0.3449290314285207","host":"s3://npm-registry-packages"}},"14.0.0-canary.c78ff0429.0":{"name":"@material/tooltip","version":"14.0.0-canary.c78ff0429.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.c78ff0429.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"31155ffe7df17fc23bae861e7ed1991c6e023be6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.c78ff0429.0.tgz","fileCount":34,"integrity":"sha512-wLIfDOzAKD+aXH0qf+mJt/40Ly6LX8HTmZ0bgSVUDMkSyMmJC5ScqbUsND5Lbkw5s7C8qjeJHcKbefDm2j0/hg==","signatures":[{"sig":"MEQCIBME3VcxDv78ZpNVE8JLMJqcikJk4se/XLRIjgVa5FRtAiBIvbZ+o2sYexqWKUngzu2IDx/2Tp00Wt0YzRtZ1tVJ9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"55d918ee5ce9842b93075fa0d0ffd2b64b5f3ed3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.c78ff0429.0","@material/rtl":"14.0.0-canary.c78ff0429.0","@material/base":"14.0.0-canary.c78ff0429.0","@material/shape":"14.0.0-canary.c78ff0429.0","@material/theme":"14.0.0-canary.c78ff0429.0","@material/animation":"14.0.0-canary.c78ff0429.0","@material/elevation":"14.0.0-canary.c78ff0429.0","@material/typography":"14.0.0-canary.c78ff0429.0","@material/feature-targeting":"14.0.0-canary.c78ff0429.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.c78ff0429.0_1633972923740_0.008830525704890624","host":"s3://npm-registry-packages"}},"14.0.0-canary.261f2db59.0":{"name":"@material/tooltip","version":"14.0.0-canary.261f2db59.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.261f2db59.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eeae236107704e198e9ed09fc3826fa955fc65a3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.261f2db59.0.tgz","fileCount":34,"integrity":"sha512-mtTmujVhBjhS+JODK4KxC9Ybpqk0hCshIUhil+Aa1Gr8iclj7uwNn0VtNv4uDIKAxekrXAmbydpHgE0jKd+mNA==","signatures":[{"sig":"MEUCIAptFtdAJJaK3EG5LTJ2mhGMCiM2SqnuxrKLHLCoAWjXAiEAvcssfELL0OKoDm4p4NpOtStNzkFtjZfv5V4dIzzH3i8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"22c1cb4091a589b9a53b844da4e8d98309c75acd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.261f2db59.0","@material/rtl":"14.0.0-canary.261f2db59.0","@material/base":"14.0.0-canary.261f2db59.0","@material/shape":"14.0.0-canary.261f2db59.0","@material/theme":"14.0.0-canary.261f2db59.0","@material/animation":"14.0.0-canary.261f2db59.0","@material/elevation":"14.0.0-canary.261f2db59.0","@material/typography":"14.0.0-canary.261f2db59.0","@material/feature-targeting":"14.0.0-canary.261f2db59.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.261f2db59.0_1634749178894_0.539042768535849","host":"s3://npm-registry-packages"}},"14.0.0-canary.9803d2dc1.0":{"name":"@material/tooltip","version":"14.0.0-canary.9803d2dc1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.9803d2dc1.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"52320a6e2e01753ce84a11ed78bc92e3a30939d4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.9803d2dc1.0.tgz","fileCount":34,"integrity":"sha512-AMdBKURxqrKYAiSpizKAT+E/20biTz+m0ePMWhQ37T1PP/Af0xZ5SqRm84qVcS9f7FflJW7/pZGLll3Rod1QTw==","signatures":[{"sig":"MEYCIQDnTyO6osNty8LDekpryg2xgPDEmZdZH8AhseEjEUIwlAIhAKVUOtqdO6qno/qnoihsx2HJGbI4YssdprYaCOofhH1H","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4ef0574fd4b362b2609f5dc9bc002ef96f07fcc9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.9803d2dc1.0","@material/rtl":"14.0.0-canary.9803d2dc1.0","@material/base":"14.0.0-canary.9803d2dc1.0","@material/shape":"14.0.0-canary.9803d2dc1.0","@material/theme":"14.0.0-canary.9803d2dc1.0","@material/animation":"14.0.0-canary.9803d2dc1.0","@material/elevation":"14.0.0-canary.9803d2dc1.0","@material/typography":"14.0.0-canary.9803d2dc1.0","@material/feature-targeting":"14.0.0-canary.9803d2dc1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.9803d2dc1.0_1634757728759_0.534544635793929","host":"s3://npm-registry-packages"}},"14.0.0-canary.348665978.0":{"name":"@material/tooltip","version":"14.0.0-canary.348665978.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.348665978.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4f88242806b650c9b188509efcf4f8bbd2bc75ba","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.348665978.0.tgz","fileCount":34,"integrity":"sha512-VohqDhOzFlQs8taziWUKF19ITZjMYXDb64DstYHXo9yXcm6OPWi3f1F95/2IsSyn1WEOOZBEqPKlYS8OY0XLBA==","signatures":[{"sig":"MEYCIQCSVKrJXsAUkd3Arb9Qj66Ude0vTbRtMeu/XwbZMZERDwIhAP/nCH3Q7tbEu0iDkNnEt1tTWOY3xnKfMKE1iIY0Eajf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"bf16d95c07dcfc371fc864fe30028299a2d5d0d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.348665978.0","@material/rtl":"14.0.0-canary.348665978.0","@material/base":"14.0.0-canary.348665978.0","@material/shape":"14.0.0-canary.348665978.0","@material/theme":"14.0.0-canary.348665978.0","@material/animation":"14.0.0-canary.348665978.0","@material/elevation":"14.0.0-canary.348665978.0","@material/typography":"14.0.0-canary.348665978.0","@material/feature-targeting":"14.0.0-canary.348665978.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.348665978.0_1634827863060_0.04113131033329909","host":"s3://npm-registry-packages"}},"14.0.0-canary.b2b979a8a.0":{"name":"@material/tooltip","version":"14.0.0-canary.b2b979a8a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.b2b979a8a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f12263c91f799fe1d95daa97717cc9e3db56f786","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.b2b979a8a.0.tgz","fileCount":34,"integrity":"sha512-xXrZZi7AUXoi3y0R+g1Z52sZ+X2rCY/y1k82o+DNWMsCQwOzqAAhNx2UL+9wiMAdQbVQBOikxqZ5wri0fDR2yQ==","signatures":[{"sig":"MEYCIQDgd+e8IdS/adCp2LjKIADdJUR0nKh3EMx3M/vwvIs9EQIhAOBEX+3Bxkmos0urq5cLHisyLx0IM2kTSoMN929kCppM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"08377359fe2dfa41ac960f776df2ba00e50e9819","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b2b979a8a.0","@material/rtl":"14.0.0-canary.b2b979a8a.0","@material/base":"14.0.0-canary.b2b979a8a.0","@material/shape":"14.0.0-canary.b2b979a8a.0","@material/theme":"14.0.0-canary.b2b979a8a.0","@material/animation":"14.0.0-canary.b2b979a8a.0","@material/elevation":"14.0.0-canary.b2b979a8a.0","@material/typography":"14.0.0-canary.b2b979a8a.0","@material/feature-targeting":"14.0.0-canary.b2b979a8a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.b2b979a8a.0_1635433958924_0.5266038033564167","host":"s3://npm-registry-packages"}},"14.0.0-canary.1af7c1c4a.0":{"name":"@material/tooltip","version":"14.0.0-canary.1af7c1c4a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.1af7c1c4a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6cd3ef4a127961765807fa60af437ed88150b8d0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.1af7c1c4a.0.tgz","fileCount":34,"integrity":"sha512-qe8hqE5yF/qWav8S2d9CKEkS3vIETR3SzI1sZIsY/EiD+YcAPSZFo2T+EK4ZnFoxQKhAjEWHzEB+krpS92QyAg==","signatures":[{"sig":"MEYCIQD8b82OWBaj74/nld6F1JGmAWuUs8xg0UyYmzly2WvHiAIhAJwke7Nph2Fgyn3/PF6A154nOQOzeLZrE3E4HnwyO6aZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3673ef3144cd47c5faba873a239454e11e3d72eb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.1af7c1c4a.0","@material/rtl":"14.0.0-canary.1af7c1c4a.0","@material/base":"14.0.0-canary.1af7c1c4a.0","@material/shape":"14.0.0-canary.1af7c1c4a.0","@material/theme":"14.0.0-canary.1af7c1c4a.0","@material/animation":"14.0.0-canary.1af7c1c4a.0","@material/elevation":"14.0.0-canary.1af7c1c4a.0","@material/typography":"14.0.0-canary.1af7c1c4a.0","@material/feature-targeting":"14.0.0-canary.1af7c1c4a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.1af7c1c4a.0_1635443568777_0.8944206750349848","host":"s3://npm-registry-packages"}},"14.0.0-canary.4afd353cd.0":{"name":"@material/tooltip","version":"14.0.0-canary.4afd353cd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.4afd353cd.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"075eaf467a89636b3323628c0634897e02ba51ba","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.4afd353cd.0.tgz","fileCount":34,"integrity":"sha512-vUDJ2OW9gSYaWY7kvYmUr4hT2H/2JC626zHi4T0pHxxOm05GMf+LVU6aDeYeGLG2lHNKLBA2+fpscRli36zDGA==","signatures":[{"sig":"MEUCIBO488/MIplrOp3TjxJky0yc7OvMP9OTZW7Vk1pAsK/pAiEAmkUk18UgJZwwiMP0ZiSjyIBE9s8gpLO054LS9bY25Vo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"491d940b4e97c65f274b1b4d42b3842e9bd3a4f9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4afd353cd.0","@material/rtl":"14.0.0-canary.4afd353cd.0","@material/base":"14.0.0-canary.4afd353cd.0","@material/shape":"14.0.0-canary.4afd353cd.0","@material/theme":"14.0.0-canary.4afd353cd.0","@material/animation":"14.0.0-canary.4afd353cd.0","@material/elevation":"14.0.0-canary.4afd353cd.0","@material/typography":"14.0.0-canary.4afd353cd.0","@material/feature-targeting":"14.0.0-canary.4afd353cd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.4afd353cd.0_1635519694342_0.5982465721707988","host":"s3://npm-registry-packages"}},"14.0.0-canary.a986df922.0":{"name":"@material/tooltip","version":"14.0.0-canary.a986df922.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.a986df922.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"093b4c296e8f20b056546e71725391265766cdd8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.a986df922.0.tgz","fileCount":34,"integrity":"sha512-pqCmM+7c+fSNNaVegi77XoVONQP4tWVo7K7d1ifCeFl15gp55ggbMnHUc9LAQpUEPtw2u25eqa/SivahMa0U7Q==","signatures":[{"sig":"MEYCIQC4fLp7TQBgJOB/ZYaV705ZTANBYUMQOD5Jr4qBtRKugAIhAIAIrdFvxmLr9rNohA7i4Fmdr+hisNG26wnwqPk/E3E3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6fd5c666012fea37f8a5a820b4979cc66e59fe9f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.a986df922.0","@material/rtl":"14.0.0-canary.a986df922.0","@material/base":"14.0.0-canary.a986df922.0","@material/shape":"14.0.0-canary.a986df922.0","@material/theme":"14.0.0-canary.a986df922.0","@material/animation":"14.0.0-canary.a986df922.0","@material/elevation":"14.0.0-canary.a986df922.0","@material/typography":"14.0.0-canary.a986df922.0","@material/feature-targeting":"14.0.0-canary.a986df922.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.a986df922.0_1635543303039_0.2128815715727599","host":"s3://npm-registry-packages"}},"14.0.0-canary.c3cdff07b.0":{"name":"@material/tooltip","version":"14.0.0-canary.c3cdff07b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.c3cdff07b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7068c60254c090f954b445f07324415cf7cc6167","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.c3cdff07b.0.tgz","fileCount":34,"integrity":"sha512-v5jc5Hqe1MPJay7SdlkTEEahwoFie2xVx4RUxSBzLNzwnVLUWf1e/m75JzLUPEuZ5bs0zoArYxa9c7gHAM9Mzw==","signatures":[{"sig":"MEUCICXLUoRkFYlvyB9rfHOQ5Dzk7mjF0YX4GNB5q8IMXiYjAiEA/sILWkkgiC31TpeUtnWl9g9F9mi1ANxHsHV8hUvu03U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"078c19c333e3161ad6b51a3fdc993d883bdc19c8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.c3cdff07b.0","@material/rtl":"14.0.0-canary.c3cdff07b.0","@material/base":"14.0.0-canary.c3cdff07b.0","@material/shape":"14.0.0-canary.c3cdff07b.0","@material/theme":"14.0.0-canary.c3cdff07b.0","@material/animation":"14.0.0-canary.c3cdff07b.0","@material/elevation":"14.0.0-canary.c3cdff07b.0","@material/typography":"14.0.0-canary.c3cdff07b.0","@material/feature-targeting":"14.0.0-canary.c3cdff07b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.c3cdff07b.0_1636484755118_0.41757790453566934","host":"s3://npm-registry-packages"}},"14.0.0-canary.468392606.0":{"name":"@material/tooltip","version":"14.0.0-canary.468392606.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.468392606.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"21dbbca60dae58acd32dada1fa8e9ac723700650","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.468392606.0.tgz","fileCount":34,"integrity":"sha512-KEGC+g33uPiepVxH1FnXv+WyklBjlfLsHYf3ldIUGNNMYcXzsSIEZ3oZPWPI0FpXRKwbdWTlhYMeXh2kqV0zDw==","signatures":[{"sig":"MEUCIQC177MApn9a1K36ey1lZh4moFsfLSiEHJKqcIk9At2eMAIgZzVVwbB+wGSIMqFgEgnV2XOaHbpzby67bxKRkN65m/g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ac451ce035a924184caaae0df5252896a7392e33","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.468392606.0","@material/rtl":"14.0.0-canary.468392606.0","@material/base":"14.0.0-canary.468392606.0","@material/shape":"14.0.0-canary.468392606.0","@material/theme":"14.0.0-canary.468392606.0","@material/animation":"14.0.0-canary.468392606.0","@material/elevation":"14.0.0-canary.468392606.0","@material/typography":"14.0.0-canary.468392606.0","@material/feature-targeting":"14.0.0-canary.468392606.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.468392606.0_1636659625488_0.4102612984106999","host":"s3://npm-registry-packages"}},"14.0.0-canary.828f9803b.0":{"name":"@material/tooltip","version":"14.0.0-canary.828f9803b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.828f9803b.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"abdd6c072233e7690abf76558e1d7d1a2f277e05","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.828f9803b.0.tgz","fileCount":34,"integrity":"sha512-Asyvev/V8SD8p+q2M36GLtv7OPiahHYNVLpkfSmknXTgYGrwG59xO6ugj1nD5DvOKkojJXpF3Qs3dVSyNAvX2Q==","signatures":[{"sig":"MEUCIQCW4DjBNDnAmwb9oxsYbaPB0LQ4QvUChccap3K0jVpjRAIgE4yJy636oayf19ZpP06u9vEqdtRCgBxl27hhvn1XjOA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c64e9f941d45dc823621c068481be90a0eaa0f39","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.828f9803b.0","@material/rtl":"14.0.0-canary.828f9803b.0","@material/base":"14.0.0-canary.828f9803b.0","@material/shape":"14.0.0-canary.828f9803b.0","@material/theme":"14.0.0-canary.828f9803b.0","@material/animation":"14.0.0-canary.828f9803b.0","@material/elevation":"14.0.0-canary.828f9803b.0","@material/typography":"14.0.0-canary.828f9803b.0","@material/feature-targeting":"14.0.0-canary.828f9803b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.828f9803b.0_1636660267523_0.23774535627140847","host":"s3://npm-registry-packages"}},"14.0.0-canary.8795cba87.0":{"name":"@material/tooltip","version":"14.0.0-canary.8795cba87.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.8795cba87.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9e24467a8162989e3966c4122d14357c79dd6124","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.8795cba87.0.tgz","fileCount":34,"integrity":"sha512-M28X+2cFkY2C40XlqOyQzawgL++30ZR7ZVz+0YNbrKZihZqvPU1vaot+65gfvApj9PZPdi1xJpVSDPAaGEn4Fw==","signatures":[{"sig":"MEUCICCMUdZHu1XRW5tu+SVJIN9cuVbyZAX/rDgjMkQdoFq4AiEA+Kujj/pVTWFeATkwg8LLUl/K9+r4WlrbFVHVAJwu2OY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"12c2e8ee797434819828bade998610af66a528ac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.8795cba87.0","@material/rtl":"14.0.0-canary.8795cba87.0","@material/base":"14.0.0-canary.8795cba87.0","@material/shape":"14.0.0-canary.8795cba87.0","@material/theme":"14.0.0-canary.8795cba87.0","@material/animation":"14.0.0-canary.8795cba87.0","@material/elevation":"14.0.0-canary.8795cba87.0","@material/typography":"14.0.0-canary.8795cba87.0","@material/feature-targeting":"14.0.0-canary.8795cba87.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.8795cba87.0_1636660623494_0.8963660031141094","host":"s3://npm-registry-packages"}},"14.0.0-canary.cd7f8cace.0":{"name":"@material/tooltip","version":"14.0.0-canary.cd7f8cace.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.cd7f8cace.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e8826e8398702bc91d2abf050f4fa9f3417f0031","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.cd7f8cace.0.tgz","fileCount":34,"integrity":"sha512-e7m82qbKDuGssnq8W2uJD9tPNC1kq54HYbmoCdQXOTq2wTU8l9HUSQRiSCTiCeuOxHg1tXo4IFzrgsR0p3JPbA==","signatures":[{"sig":"MEQCIAWCuOG925etRoOT3+iQ3HhLg48st8pdVYSVARoxLgCBAiBWryZ9jRZ0zzLvo4To2sfGFTznkzPSWEacRP88AV6X8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6f1e9f39fe9a43e01e67b849cc2a96a5a31be67c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cd7f8cace.0","@material/rtl":"14.0.0-canary.cd7f8cace.0","@material/base":"14.0.0-canary.cd7f8cace.0","@material/shape":"14.0.0-canary.cd7f8cace.0","@material/theme":"14.0.0-canary.cd7f8cace.0","@material/animation":"14.0.0-canary.cd7f8cace.0","@material/elevation":"14.0.0-canary.cd7f8cace.0","@material/typography":"14.0.0-canary.cd7f8cace.0","@material/feature-targeting":"14.0.0-canary.cd7f8cace.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.cd7f8cace.0_1636660728675_0.009759669204407073","host":"s3://npm-registry-packages"}},"14.0.0-canary.207230eb8.0":{"name":"@material/tooltip","version":"14.0.0-canary.207230eb8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.207230eb8.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cf6fb83b600f14d141cfbd95f8a7fd3f85499b77","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.207230eb8.0.tgz","fileCount":34,"integrity":"sha512-JHSx6RlBMaNC78SQJUTixfoxqtyl5+thM1z26C6uMIozeKnovxit0w8K/tRRgvVSNe3RWtvkzFtpJGufSF2FVQ==","signatures":[{"sig":"MEUCIDMDZ+r1GVfa4E9PKz+N9av+yXh6NT8/GMk+4gku8rG5AiEA7GwoYDhadMbuaSUhQlSKACZwj5mCXtYUNAoIB0xZsDA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"de1b12d24234ecfbfbf5a665f46c26b71016be2e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.207230eb8.0","@material/rtl":"14.0.0-canary.207230eb8.0","@material/base":"14.0.0-canary.207230eb8.0","@material/shape":"14.0.0-canary.207230eb8.0","@material/theme":"14.0.0-canary.207230eb8.0","@material/animation":"14.0.0-canary.207230eb8.0","@material/elevation":"14.0.0-canary.207230eb8.0","@material/typography":"14.0.0-canary.207230eb8.0","@material/feature-targeting":"14.0.0-canary.207230eb8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.207230eb8.0_1636669468813_0.18911885810969142","host":"s3://npm-registry-packages"}},"14.0.0-canary.991fb99f7.0":{"name":"@material/tooltip","version":"14.0.0-canary.991fb99f7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.991fb99f7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ebf6f064029c1df06da7d165eb047b1da8c6c91","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.991fb99f7.0.tgz","fileCount":34,"integrity":"sha512-3tLMwGGRMi/KHs2LNWilnWqODf41z3FZuUSnAoNGtMFgElITNQpMrhlJI8Zq+WMcU9ySbUULnT40sZUIgkuOSA==","signatures":[{"sig":"MEUCIQDZpQDmkSADGYbAyzxwT7TZO8HH47/FJy9RpBb9xpIBtwIgav2JgI6InLfzcBzz5/dwJuiSxWguJWxhHngJl+FWXEY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d13dee60c11cfef5bdcac33da4fff6f13626c05b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.991fb99f7.0","@material/rtl":"14.0.0-canary.991fb99f7.0","@material/base":"14.0.0-canary.991fb99f7.0","@material/shape":"14.0.0-canary.991fb99f7.0","@material/theme":"14.0.0-canary.991fb99f7.0","@material/animation":"14.0.0-canary.991fb99f7.0","@material/elevation":"14.0.0-canary.991fb99f7.0","@material/typography":"14.0.0-canary.991fb99f7.0","@material/feature-targeting":"14.0.0-canary.991fb99f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.991fb99f7.0_1636670204125_0.7589256649663825","host":"s3://npm-registry-packages"}},"14.0.0-canary.15db4f164.0":{"name":"@material/tooltip","version":"14.0.0-canary.15db4f164.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.15db4f164.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12f6a99de659ae6564576e0d4fc96cd5ac3902f7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.15db4f164.0.tgz","fileCount":34,"integrity":"sha512-aVz/QUsHnQtswi+vH2gII6waE7e48Ipz+Na86KHFInJEyGpSZcpltfM187m2/GB9EXqbcuMDaT2GzKjYjaHkPA==","signatures":[{"sig":"MEUCIGXlh+4+XkTbH5aLepwKf/2Fa3nzxKNtV7G7Ko9DlJRUAiEAuuNxTHbctEUe2cHIxMqIQNGwVssNU5EJibO9xo5755k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"562e11bb445a0e51783e848adc61b690a7a1ba3a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.15db4f164.0","@material/rtl":"14.0.0-canary.15db4f164.0","@material/base":"14.0.0-canary.15db4f164.0","@material/shape":"14.0.0-canary.15db4f164.0","@material/theme":"14.0.0-canary.15db4f164.0","@material/animation":"14.0.0-canary.15db4f164.0","@material/elevation":"14.0.0-canary.15db4f164.0","@material/typography":"14.0.0-canary.15db4f164.0","@material/feature-targeting":"14.0.0-canary.15db4f164.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.15db4f164.0_1636738205088_0.43051254225224467","host":"s3://npm-registry-packages"}},"14.0.0-canary.8fcad5a3c.0":{"name":"@material/tooltip","version":"14.0.0-canary.8fcad5a3c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.8fcad5a3c.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"24ddf4ad7bc3b5ff3f7c8cfc507378d3fd1b3538","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.8fcad5a3c.0.tgz","fileCount":34,"integrity":"sha512-+U0TLUxiR7NGMLRQC389sQei7Mnav6gMefe51EBqfKntQBYhEpySzMpiqLef/buS3+3Cm7WkftaMrNQeBctj8A==","signatures":[{"sig":"MEUCIQC+a9y1BodtxnFE6sdGbMb8YsYf0tBhLPSBFmk1Fh7laQIgN72LLrOHI1Ly2Drke6VIx7C6nbs9nTP9vT5SKC7rXzE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"14b654013dacdda833d34b73c1a94811202298d0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.8fcad5a3c.0","@material/rtl":"14.0.0-canary.8fcad5a3c.0","@material/base":"14.0.0-canary.8fcad5a3c.0","@material/shape":"14.0.0-canary.8fcad5a3c.0","@material/theme":"14.0.0-canary.8fcad5a3c.0","@material/animation":"14.0.0-canary.8fcad5a3c.0","@material/elevation":"14.0.0-canary.8fcad5a3c.0","@material/typography":"14.0.0-canary.8fcad5a3c.0","@material/feature-targeting":"14.0.0-canary.8fcad5a3c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.8fcad5a3c.0_1636744430383_0.8335962991423194","host":"s3://npm-registry-packages"}},"14.0.0-canary.f81fb1d23.0":{"name":"@material/tooltip","version":"14.0.0-canary.f81fb1d23.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.f81fb1d23.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"21d2f73dd7163cb6f645c48dfc8492a898787f56","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.f81fb1d23.0.tgz","fileCount":34,"integrity":"sha512-SOGvISEqfUjOWQjiWxRWU3TBe7Nali3SuQ+F3xY/YbIi9DqkYgA409CH8x4hfplNZVWv6alIn1tsOTnY4yZFXQ==","signatures":[{"sig":"MEUCIEj88Yl0V3uZIipCPzDZlCZqP8v0vmvktoCeQA+FPRzVAiEAmQjBE9okLupy6sWsl6mzXgX9cGwIOH1/onLDbGeBCvM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"60600a1b8cf651dddedd6881a54b20db7b75cdc6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.f81fb1d23.0","@material/rtl":"14.0.0-canary.f81fb1d23.0","@material/base":"14.0.0-canary.f81fb1d23.0","@material/shape":"14.0.0-canary.f81fb1d23.0","@material/theme":"14.0.0-canary.f81fb1d23.0","@material/animation":"14.0.0-canary.f81fb1d23.0","@material/elevation":"14.0.0-canary.f81fb1d23.0","@material/typography":"14.0.0-canary.f81fb1d23.0","@material/feature-targeting":"14.0.0-canary.f81fb1d23.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.f81fb1d23.0_1636756834361_0.33043515360153886","host":"s3://npm-registry-packages"}},"14.0.0-canary.783f6fd5a.0":{"name":"@material/tooltip","version":"14.0.0-canary.783f6fd5a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.783f6fd5a.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0b3c7d3f66532479331d9dd224d4d3b7288d6241","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.783f6fd5a.0.tgz","fileCount":34,"integrity":"sha512-6HjRmlfmYW7J3VbIY825JG7vzaS+cyEhO16eRzbHHZpV6kBmYGwJBJM2mUEvBdEUeyhhSnIchf00JMDOJ2qKGQ==","signatures":[{"sig":"MEUCIGEe5PZESQnWTmM5kOQw/clLAPWMD2dhpTQ9f04Zx9c0AiEAp1MHNmHV7AMvn0NhRotwN7q7GyryF6kfxsVSGvcR74E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk0akCRA9TVsSAnZWagAA/VcP/jGXae57unvBWc2gPKzL\nAVlj5EkCxuv/RSLp+eYXJWGlRvtkz1Keb9FvPGUMfHpty+ytB6gdC7otopi2\nyJGIp7U9H2Y3/B1B4GmAI8cPbZThPSfPHMPiYYWfyfebBVxvMG/z075/iBsN\n4PDIorqRirjGiy2ZSfAIQTFzjDyd7AS6oTZbM0ZG9Z6ZrE093cabrV8Q3dn9\nuBdhvvU43tC3cGxDiWGhEsi7gySGyfYYSxg1+ce8C4LuiR0QP/UEmsXyWLv9\nF7/Vx089ppEqybc1caSCrEUcZ6Cyg5G+mT5qwK3iRSJBsPzMsF8NA+BLhwLx\noSdFlWlk02p3WdbAOTcaPDk3Zx/BF1KEloQWJWty9wdeRb8pMLXc2tBWUzjw\nr5hqNTOb2m/vzxq4Xly74Zu2O0+S+EWGjKgZgqha664ZOi2m/xtoZ7GmhsPO\n35Mglz0mDO99fpXE59sa6y+aeglm5yOIgxovLSfNIxrxSXSmYALJTemks9HM\naiw+/TaFS+CD30qZokRdRD27FDI+SZ+xrdgHr/iOayJcB+OWTOqx+TbGr/sK\nxzkI66ztmvLqATQkSjdIdB8/FgFKpLcviqzUszehKB9FucqSw44bnNUCZ1GN\nXZtNfjUPFq7GwF7NuwKc3XPvoRZteuMFvI6X4XBI5H9y/pcNlWa+OZ+bi24J\n4dgB\r\n=IkHV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"29ba9297d5424f35d235c8ff87e393874c1b0a25","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.783f6fd5a.0","@material/rtl":"14.0.0-canary.783f6fd5a.0","@material/base":"14.0.0-canary.783f6fd5a.0","@material/shape":"14.0.0-canary.783f6fd5a.0","@material/theme":"14.0.0-canary.783f6fd5a.0","@material/animation":"14.0.0-canary.783f6fd5a.0","@material/elevation":"14.0.0-canary.783f6fd5a.0","@material/typography":"14.0.0-canary.783f6fd5a.0","@material/feature-targeting":"14.0.0-canary.783f6fd5a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.783f6fd5a.0_1637041827898_0.743528933237007","host":"s3://npm-registry-packages"}},"14.0.0-canary.d57ec74c7.0":{"name":"@material/tooltip","version":"14.0.0-canary.d57ec74c7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.d57ec74c7.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"863f289aca91b5a17b37a93683f6b551b69e9764","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.d57ec74c7.0.tgz","fileCount":34,"integrity":"sha512-mGduO45jy2A3F95No02/a0GlLC0tSlDroAN4WWmZ/IX+bG343rotUCc51o/dFC9VFlSCtdqEgdxj7HoY2uu91w==","signatures":[{"sig":"MEUCIQDTTGl82tOM7lWPIP2JEnhlipizEU0Dn3XQEhd8a5rUNgIgaeXUn9sYDSQwWjQxrrhVEyu221I4cWgXArbbE4F26Ks=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk9l9CRA9TVsSAnZWagAASwkP/1jDne2usTpW5bw3NrNE\ngQklLrE3UqMx4m/0xbHBb+mi6MywvwXBEQt8LavtXtbM9FuWwMT9N539FM6W\nfsatqIcv3PPdRUKthfkoDFSgiStmF60TIJqCHsq+RjaDNZxdaNNW0SODWT78\nf9pA5C5pSsPlez5IKQsg4OA45ok3RcnXYTF1fD2cdBVnR5B75WMv26nB6B+K\nh4YCZDUb5QFlG57JePe0eZA0+QUaISs/6HpPcUxILvHKPy/PqPchZb2ValtT\nuRPYddeVUhhL7ZV7RNEa8ABWqLEhiXpZSv46AP1690EN4fuIWg/G/41T+fI/\neifhlulhcGnJQvkFG8ep/1Km0Oj6zKEzbjGN35Ylv6EKPqKNRpCvGpBGAa5Z\ni9JVdVb+kw+6J5aAuJAneAPECRxLII1cIiJHrdbzzINL/plJH2+rsE26aGdz\nRfQDnKtKhP18oqtJ4dn0s6JbBweGmX90Lnl8og2NhSulQXEQOTjmuxSCU3jg\naUUJJhSPzK7tdZSeOn/P9nIyxL323++AH6T6EYJpR9MwPmntIV/yLfjaBcNK\ndsTZaOyT+YRdX/CTVl7rIltTQ/cQ+PFsOF+aJlmevTjsdV+kq5lLaF/1A8IZ\n/nV7Tct0a3gk0Xf+5ujiskDGPW58UZ3ryS/VImASfkI6FfIMxMPULt3+6J/c\noxVk\r\n=Con8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"dbbd8db21de66e88b3e713faa99419e6b2f53c68","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.d57ec74c7.0","@material/rtl":"14.0.0-canary.d57ec74c7.0","@material/base":"14.0.0-canary.d57ec74c7.0","@material/shape":"14.0.0-canary.d57ec74c7.0","@material/theme":"14.0.0-canary.d57ec74c7.0","@material/animation":"14.0.0-canary.d57ec74c7.0","@material/elevation":"14.0.0-canary.d57ec74c7.0","@material/typography":"14.0.0-canary.d57ec74c7.0","@material/feature-targeting":"14.0.0-canary.d57ec74c7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.d57ec74c7.0_1637079421268_0.2647906226344605","host":"s3://npm-registry-packages"}},"14.0.0-canary.554c71829.0":{"name":"@material/tooltip","version":"14.0.0-canary.554c71829.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.554c71829.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9afca503208f876889933390fadfb5d18706846","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.554c71829.0.tgz","fileCount":34,"integrity":"sha512-sPB43iLvJpr3S+hFDbqzg6yzKBVUEFO0uO55F00Yy57C2UmPeG8R1I8/LzV14oxU+ukp1E48TJX2Tl1VowsrOg==","signatures":[{"sig":"MEUCIH8dnbhgXZ6Skw8cOBrgJNSPucAF1vAysJQHZlv5IYBwAiEAnYRJIOM1mXrMRPMHdNl5Pf0HbmWTEgH/QYDtT661qpA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk9omCRA9TVsSAnZWagAAyPUP/3oMJFtJ3NxbhhlMRolj\nXShfmG0SRwd/m7VZJeybY1bC5dZ8Pk0898dMTbr1rnZG+n37Jvx5iJsDPBqy\nbthkUn2WY8irNABse5j+U7SuzgtMNCBEDy+XrzhUgHJRJIomRW55GT8+Szuf\nMGanz7GuqsdjeFSoccn9eYWiLhRHXvPqniLxOAnz0d7xsXFuNpe7w0sGKFvp\neF8mlqQSNplKJfuF7rdnlaECnuoIPJsPtRuj1ZCXFewG+aplOVhPf+0SapZq\n0MrKlP3EXXFqrZm4/lQe+bs0pjmFRu8fX/826PtvZxrd6cQsDoZY3nusfSvi\nj77zwurmEoGMt2Sa5zEz+Jxr3UMVGlaR8e2v9z/HbcX7Y+HguP+Zm6oDa+ps\nXGSFmwuC7174twMll7yv2dCcNLNFlxCr46h6Gqgt8Nm4IV8xEjt/Ycp83OPE\njzuljnlB9qRADKHRn891pjQNJHsjKAdChHmhJZwkCRNrFYE6dkEdNkpsR//2\nOGEVYqJr8/FVQn289yyUgxj4k7Dyv+/KrWJ41mSlEBS3r6fq5qsomYyJeS2K\nc/mDzzMNislf4j28Zj1658AHWe30Yx2qHiTPxzH+/PcUoQZ/W3cluBucZb9p\neFCyJUJFDVNbjlsnU8PjOdrrssC5CoIhyvvFbgqaH6R/RekK0jeoex8ISjID\nXVnG\r\n=UPU4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"be0799ddf10fc34b46ab20d754f7ef73d9efbefa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.554c71829.0","@material/rtl":"14.0.0-canary.554c71829.0","@material/base":"14.0.0-canary.554c71829.0","@material/shape":"14.0.0-canary.554c71829.0","@material/theme":"14.0.0-canary.554c71829.0","@material/animation":"14.0.0-canary.554c71829.0","@material/elevation":"14.0.0-canary.554c71829.0","@material/typography":"14.0.0-canary.554c71829.0","@material/feature-targeting":"14.0.0-canary.554c71829.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.554c71829.0_1637079590410_0.6779586995238214","host":"s3://npm-registry-packages"}},"14.0.0-canary.3ef470efe.0":{"name":"@material/tooltip","version":"14.0.0-canary.3ef470efe.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.3ef470efe.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"26139691dca20b34ccb335cd05a130a83a76afe2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.3ef470efe.0.tgz","fileCount":34,"integrity":"sha512-hpG0eW+FQj8Naxcb4Ej2oA0E6mObyiqwm51PE0Bx0HxGDjnlyncPEOQ8RPtx4BS/JwuMB/5+tbrbJP4qYo/WfA==","signatures":[{"sig":"MEUCIEqZGHt3znm3LLffRzj1UAkucCpSyof937Asl1WRVi4hAiEAlNBxcdyotc/AS+aWb68+GOrBu6FAEpGwyfCaKvKatRQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":807893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk9tHCRA9TVsSAnZWagAA7GQP/18GjWS2KSXyIaHtOpyy\nbfYz+Dr0to9TJYcz7gG3dPS40xBeHSl/LQUgzdLZ/xQ0pMfKJSF8AIaqNYGT\ni5zuaoTXQ2f8AewzQDnp6iooJkrle2HSvVydvpn02/3hfdUPc306tGjmmQ3H\noqOCOEUpoQUre6c3U9By8SA0MtTSFCuUx9B+63WhTXJHR6yj6hhz88DzEFaT\n7UaNhWBvs9O8LQrihzYGWEjqFlAw1XeYrnsU6un/o6ECsQNR8EDWpfjT6X33\nBtSwA6zY84uVO4QjAjzSk964ayL3PdwYTvQ5r9Mz/SuM9sRcH9X01QT7RC5I\ngJJ9OVZ32baUuQu2N6e3VSaB0wUJetKxKDZ1tqWWWE/LV2EGiaqnc75b4lmB\nX5Ggg8tDi1iJtuTu9NTsYO0MFGppMegdNbE0FKmL/96gW5ve41hnC360eDHC\njPsWowabqqJbLPMMm6ExPRC4H7loRoV3ilXh7PgMjQGQFRFDdb3GCBscQnq5\nvlGDG0GAmxKOz4garZdTldsJQDlRODhIEtdShAprkm1RRIKORVmLkte6VFdu\nvFmbuD01tNDs5Qi2OYhJ+Zy/gyz0pEXvI+fM6lbCOjSQY4gZMbbs/8VHzMOl\n+ZEdaqdyfq12HmWCdrGjHN/uBvr+57fQkpPYV+BvkCO9uADYwHeq7ts9hXbR\naxoe\r\n=60jc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"49429a109e0c13bb4f9d8fce0142cc5f142a6afd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3ef470efe.0","@material/rtl":"14.0.0-canary.3ef470efe.0","@material/base":"14.0.0-canary.3ef470efe.0","@material/shape":"14.0.0-canary.3ef470efe.0","@material/theme":"14.0.0-canary.3ef470efe.0","@material/animation":"14.0.0-canary.3ef470efe.0","@material/elevation":"14.0.0-canary.3ef470efe.0","@material/typography":"14.0.0-canary.3ef470efe.0","@material/feature-targeting":"14.0.0-canary.3ef470efe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.3ef470efe.0_1637079879555_0.15298935108005352","host":"s3://npm-registry-packages"}},"14.0.0-canary.61a28b2b5.0":{"name":"@material/tooltip","version":"14.0.0-canary.61a28b2b5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.61a28b2b5.0","maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"williamernest","email":"williamernest@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c59955933a9c4e9c33e1791891a7adbc359a24e8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.61a28b2b5.0.tgz","fileCount":34,"integrity":"sha512-7+AZRhfk2e9Zm86PY4c2s3KXcgcy1ziYSQ3nung9KsWAELrUV5QX8sNL0K1wKw9XvLuTt0OGV32jb5jzOoDy4w==","signatures":[{"sig":"MEQCIEyjWgUIk+XiWdnHmS65M7Eg5S9r1vQW9+lwIBoVfNiMAiBBP6p0J6x4fuK8oeHv40RkMOx1/PPTJtH5aESmON7oOA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlVEfCRA9TVsSAnZWagAA8RUQAJfrvfvpfohMW0tfKGAZ\nAEuf1hKQluGN4H7jnwKyTrPgIAyuTL0JAAVa0iYSRbL+L4HnPt1Vrv30lMls\nGoYvZzqtvu2aXSjEDEO2bt9U/d4YzgiStjCyAHanl2zdL/JQJy4g9Xx7ujuP\nMhAWVOtx4yANNKg2PFnkR3ViUWwQhILmwyhmvWdtwSj8zK/bYknDuVnr4Pmu\n7vubrqyP1CraCnk4LnjWcmwjy52Bg80ZcVYvEvj5LO8tYasi7tsUUHt50BkL\nbTTiBJgHAjgVb8+kXBYqeKxnSN2hQtGymUY3anjWKYbnlDffPePZBVOxlVwa\nDcEyKgxF25aukQ+PxDNNqPRQB1nC1KnRm41vrlk5vFNSkW6Ly73mlENLGrrS\n1z7IgvVUnL+72euX0gHL/93ysJURzE9bmO3KeGN+NzWODmdgoP4/PjamprTZ\nrXjJIAgYrIb4ZxZkrtiukx/Mck8931oReiQa63u363U4axCc5U3EPgYsO+kJ\np3luNBFU6SptLykNqJjpbjWjCpUsr6hd89ZCU5QXpX3P0MGVZZ1SKDD9p9tl\n8kzZgsrDmIcytra7KHzso3YShI+JpOgmm7eP+dLxkEwbVE69C72pp/nXz13t\ntnSgstM+DPy+1ivdSyQrQ+2Ivbli4VwPBdpvSPwYifrIS+ufULGICebj+Swt\nZuIB\r\n=ikmE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"314b98aa8ec5a35ba8a45706765f4cd7496dd803","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.61a28b2b5.0","@material/rtl":"14.0.0-canary.61a28b2b5.0","@material/base":"14.0.0-canary.61a28b2b5.0","@material/shape":"14.0.0-canary.61a28b2b5.0","@material/theme":"14.0.0-canary.61a28b2b5.0","@material/animation":"14.0.0-canary.61a28b2b5.0","@material/elevation":"14.0.0-canary.61a28b2b5.0","@material/typography":"14.0.0-canary.61a28b2b5.0","@material/feature-targeting":"14.0.0-canary.61a28b2b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.61a28b2b5.0_1637175583263_0.7348768468264335","host":"s3://npm-registry-packages"}},"14.0.0-canary.fae6c652d.0":{"name":"@material/tooltip","version":"14.0.0-canary.fae6c652d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.fae6c652d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d694aed54aa9d3b44b401d0ed231378b7e330210","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.fae6c652d.0.tgz","fileCount":34,"integrity":"sha512-TLd/iDmtkUPQaePgvUc7xgIBfYS8U7CLSQnbpA2tY/BTi9Wekw10jYIBO3nDwG9IW0vw60Te7BiCQOvSxfmjdA==","signatures":[{"sig":"MEQCIHlgN1LiFyOY330DKllVVk0jISSAVcRQEyovqBUp1b1rAiAGfgkxMfjM8BdnO2BwUJmBJCgIWhCMQt/eDAGtweKfvg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhln53CRA9TVsSAnZWagAA9UkQAJOe52aP6fsOYnbMAsSF\nio4vVPMmDhw2du7cwWXls1B7UBoXkxZSBv0AdW5M0BcQfQ62At5UDAyvb1DH\nWi38NdbRSaiBjM9ox25xIElvWz7c/bjLmxplZjxJ2016i24sOAjfno3h9BiV\n8gUqgUJ51r+c44BrOXjH8AhVTp10vp42m3Y2ynK5PSmov98kdA7NVEV/MUIQ\nrOIf1Tl5f3rbidiFfQ/nMU1CeRFPUP/2RTzTAMiTq6QdTQgA8ZfNrzvdwNwh\niadKewQXXV1KHc9/VuT3JJQytoyz7c7tH89qEmBApNsRTl2aWc9Is5q7nPlo\nGVUcsRYFMFlXo9xpWVfuawWQR+fS/RMqLxqPXx5XHvxdHQI1EQXG5lkYwSpj\nHIybM85+1NZ8D5Gama2vjRbLWfIDZil96gEAOn2Nbz8tAkA9exhsZbo7Vu7h\nrBPbzHSArNwpnhwO1WbW/Au4LdzMn++HnqV2idsMXpMJ2FJRK56zm1E3J4FQ\nr/BmeYAwb39nB9iqI3INKst7PUSbgOox8NKKKJRYJemUmeGijxHn6PLoDaRi\nKEz16heNHrcKQsjfAPHgaDti/ufJRnR92VaTYIag91Bv+G76AULCrE+pHl6c\nCNeq1ACGRB7AFfZpexeIK2qVfY/KRs4ShS6uj7/tRYBs05/kV0P2EyBKA91i\nohO5\r\n=RHXT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d27c4bc9db002b9009b70cb7437b393ce59b9992","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.fae6c652d.0","@material/rtl":"14.0.0-canary.fae6c652d.0","@material/base":"14.0.0-canary.fae6c652d.0","@material/shape":"14.0.0-canary.fae6c652d.0","@material/theme":"14.0.0-canary.fae6c652d.0","@material/animation":"14.0.0-canary.fae6c652d.0","@material/elevation":"14.0.0-canary.fae6c652d.0","@material/typography":"14.0.0-canary.fae6c652d.0","@material/feature-targeting":"14.0.0-canary.fae6c652d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.fae6c652d.0_1637252727745_0.3925249931221475","host":"s3://npm-registry-packages"}},"14.0.0-canary.978a3b5bb.0":{"name":"@material/tooltip","version":"14.0.0-canary.978a3b5bb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.978a3b5bb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f779e4ffcd6e6c650cf8dbc1174d151e059a3d2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.978a3b5bb.0.tgz","fileCount":34,"integrity":"sha512-7avRrm238wgV5cMQczQYabLcoxhVZuU3gDkRMQsQVDrQM0flStAuUnpAQKnvnlllH8WZKhsepquFr+Ww17ZGdA==","signatures":[{"sig":"MEUCIQCtpeyc5p8fyy6tVKvW1UizOjyFvM1Ojo3/AFcd3UAzKgIgCnyUTpyRRPbr2hJTjnWkPTT2lU8xilWSHxsbBTelBZY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl/2ECRA9TVsSAnZWagAA+dUQAJ8nYWRchj8jakJmdkYM\njetuvaVUsUTYGiy77Mr1ljFjtFSdQf+fr2+VRQX/2onOJX3P6FNER7s8BMv2\nDZVPMv2acYAwPMi/EdCskjSd/El52W8/08KcJAR0XCnmgGFwP4EePiYU9Imh\n5kyGpvz+f/kJ1Yd6SAPEwD8LbqmpswBOY55MWp9di7kFzmpLt8AT+ObRELHW\nLBZIblwYr35wALi5PU0UxMO1LtcEI938lXGXU1SqVe49YruHs+F7/hVPihhv\nUpiCmSHlffqfGLWnX6KWT0cxxMXA89f8fo2fseDChTwJ3gAABHYqPBhD9QLk\nzffyUk/eHuRyHiZbLti/NznJGPyhdSYxbU558v+H2mzF2QgDV5lOAILWEdce\nfrDGuybjiDmkLmqhLaj/Pl0cuEABTbMftALydaNFvIMM2sTdAGgKaJ7rL3RZ\nDXb11/YQny556b2SH2OLMJ4GoUVsVFHc5421BwlXjZSL2a1Ltj+QZKTdQZW4\nw9YwQbzBql/2bh6N+Ps5XvJqcdtydIb8NtX7/aXOBST/+GIa8OZxeGyDePkv\nnYrsQJ0ofx9t6YcGlDXZmjDapZLNM48t523I2TMvWbhDzux/1jO+GkSSjMsP\ntaCjy66h63Xujgd2mAsXveXwTmiod/+AuGdjw0GQ3XiXZ4/oUqaisncKDfOT\nICDs\r\n=6k7S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0d21a3472967f5ff791662e03961fb034a9227d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.978a3b5bb.0","@material/rtl":"14.0.0-canary.978a3b5bb.0","@material/base":"14.0.0-canary.978a3b5bb.0","@material/shape":"14.0.0-canary.978a3b5bb.0","@material/theme":"14.0.0-canary.978a3b5bb.0","@material/animation":"14.0.0-canary.978a3b5bb.0","@material/elevation":"14.0.0-canary.978a3b5bb.0","@material/typography":"14.0.0-canary.978a3b5bb.0","@material/feature-targeting":"14.0.0-canary.978a3b5bb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.978a3b5bb.0_1637350787960_0.3654537364058912","host":"s3://npm-registry-packages"}},"14.0.0-canary.e6f43cf44.0":{"name":"@material/tooltip","version":"14.0.0-canary.e6f43cf44.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.e6f43cf44.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c410119ceb83b61cb104495bdf36072851c9f7d3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.e6f43cf44.0.tgz","fileCount":34,"integrity":"sha512-L1fiJd/R1bMUEuX/hECvF8TyKqFh6s0XOwWW56aUffje15e++L/jq2ts4Ko1C00cI2TOo/s2ZTEfhQvlzinQyw==","signatures":[{"sig":"MEUCIQCtzyv7Q69ZJnlRdg+d4L7Buot/ubmytIcol8kSuvCGygIgc3ojQWHdfqqjr3yPg7h0kvzWq+G1ZPr8sucWsdlqlH4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm9TrCRA9TVsSAnZWagAAdcoP/RB9Ja0vBV5Z/F+50PTu\n3h3u9qgAN+yODDOdWkJM9BXCFFM+wiLfsLef+ftOfoX9T08u1kxCKo8JLCs7\nKReKt6FsrkzyNxpcUDvlNYLLRielAjcxFX/BFzxTJGbcfvAwuvVREzmHauKQ\nERWzl05G24r0JH/qQ0J3Z47sOAcX1ysV9N4BYtekTetIa2caVYYNRW/hpIMG\ncyDfxGjJOBjKbw4D1HTjSJn5IpKPn6RUkH1OeTMyn2jdctJN4Cfsp6LLUqwP\na/6BYBr8N6L4Sg7yx/LplTJcMj3NgXEft2TS7IpmI19xDOHDA6n1yfJk/RsG\nGvHORFtbBNVbyY4L9jE9gwLny5IRAod9Ze3sfd4Eu70DKBLfZfN2ysxWsqjs\n5BN4hcEpaE+5JyAB9UXU1cC7FfMNPfrRnNqCZc2w1bBKJY9iB0S0euZFWZnD\njejewSJzCbpxIltHk0Qht9crsOAmGO7/EE5yGfmBMvdT+i6tr2fLcqNRTnOd\nFX2ImbHIQ5chUrQz71McjVmwMFizLWAShvuvz3xNTbS7f6z+vsgccq9Kd9Qd\nJyRaqnGFFy+5su2JAz12tH4Q2J9JVhFlIVipQb8wr5SfTDGlFhPMxrwOBVln\ncr3le5rMcOiMKAn6QWvLZapyVpYlW5N2zDZdRAA5Y/8rS5lXcnaW6CAQmxFu\nsp8b\r\n=goL/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"36200e7acad50905888cd5fbe17075663a96ef91","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e6f43cf44.0","@material/rtl":"14.0.0-canary.e6f43cf44.0","@material/base":"14.0.0-canary.e6f43cf44.0","@material/shape":"14.0.0-canary.e6f43cf44.0","@material/theme":"14.0.0-canary.e6f43cf44.0","@material/animation":"14.0.0-canary.e6f43cf44.0","@material/elevation":"14.0.0-canary.e6f43cf44.0","@material/typography":"14.0.0-canary.e6f43cf44.0","@material/feature-targeting":"14.0.0-canary.e6f43cf44.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.e6f43cf44.0_1637602538998_0.045434771855847655","host":"s3://npm-registry-packages"}},"14.0.0-canary.39cf14bc3.0":{"name":"@material/tooltip","version":"14.0.0-canary.39cf14bc3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.39cf14bc3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"50a4b3d594aeb96daaabb4cda7d316f627b75edb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.39cf14bc3.0.tgz","fileCount":34,"integrity":"sha512-l4jM7fQa1Fsh+DBc2uUB1LB4c3IlF2PKLeubjJ48/ytdITMWn9sory4HTHAvS310MxerSX5BYMBj14WEBGR03Q==","signatures":[{"sig":"MEQCIBOWNpfzcgLRZfOvWJMHH3Qk+x4oEFOgasaJQWM2bOS5AiAZn0kJnPM4bXjSqG+67jNnmsDPVaK19NvTaRjePx1A2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnCIeCRA9TVsSAnZWagAAyiUP/ReNyv1Mconm1gpfrsKj\ngMAz2q6ywCGAej2+4DP7bz3sG0XoSfShqktbRJgQ1UctqO10lbpYret8UkjH\n4fvVkuu11sqn4qV5Z/+vlr9RhC/11wSu9sXf76BNLxuxiAN4ISAfkWGTNwZP\nd/zpTNk+d8ZhiWSV4LkGqbyHbE8KNIY4mxOPrNkU98rcB/T5334LQLUTIop2\nTTWEMyYTObBdzXxQs7FcIMT6HItqu66NUFsshubf1e5g/S/pjhqtnyTYwSRd\ngS0Fz98DI9OvVu7LxyEJZV76eIHw4dqEkOCLjlQLr67xE7U9R+y6rRYzp3E9\nFvYXRiPn0+ZXqBhLnq2GAs/RbWBj6wjXTdNjI2RWHCsy0MQXRfP/zf6jbqh6\nvQYCaGSrmXLAlb+4/gM/pHK5h9DfSK/wUN0JLbx7iXXLlRT67lEI2Y2AJO3P\n7h+rKYASTizNusKiEGLQZ2tj3/SJzR5HIJMF1DkotGNvLVox4FEbzQoS2JS/\ndoRB7YZGjG5+N0aCr+7v/vNRLgolCYosercC3zYUMeXNPQ+wRCFXBgNLONwp\nKluweRAzRtS/beEkl7wjsgFU8aq8sE19vi4bOu5Kh7ZsiAyjpsYKuczJikcu\ngyIWHIRqXO4Of+/qbHYqHfDJXM5Q0piEMt/cSXM8GSx/tWdUDuxJWFO/9upf\n+MTF\r\n=G410\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7a4dadfef1095fc344517a394b0286ecb59751dc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.39cf14bc3.0","@material/rtl":"14.0.0-canary.39cf14bc3.0","@material/base":"14.0.0-canary.39cf14bc3.0","@material/shape":"14.0.0-canary.39cf14bc3.0","@material/theme":"14.0.0-canary.39cf14bc3.0","@material/animation":"14.0.0-canary.39cf14bc3.0","@material/elevation":"14.0.0-canary.39cf14bc3.0","@material/typography":"14.0.0-canary.39cf14bc3.0","@material/feature-targeting":"14.0.0-canary.39cf14bc3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.39cf14bc3.0_1637622301820_0.013205149310970166","host":"s3://npm-registry-packages"}},"14.0.0-canary.93134d453.0":{"name":"@material/tooltip","version":"14.0.0-canary.93134d453.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.93134d453.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f82822c0170a84a571b3e36e907538a45c26d6f9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.93134d453.0.tgz","fileCount":34,"integrity":"sha512-dHBYgJVy9IfSFz8zSB6GhgJ/0c5ReYuYUfOUI5R4iXwPlV/NvuEo6BeMcaE2Hmx60+iMnv0KnhXJF8ikvyFl+g==","signatures":[{"sig":"MEUCIQDTPpxly3yMQsc7mBcLCK10Dr44r/Q/YGMvRpkPLNzBAAIgCibSy2C6fIloa4+A4aJlVS8f1QvcRe7+Zy0f+M3+EY0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnQtCCRA9TVsSAnZWagAAuVIP/2upvHB2P5c4mITefQ9k\nfjVN1iUGfiDms9OIxnvjUBi+rY0yp7Y4DEVxKRGnhOfBO3l8OLrY7sD1IGYN\nOZPXL9WzJ4C6b4z5/tELYJ5ND6CtjCSaGzxWPr7J4a+roHJQAFbThZYYhe60\nKXU13wuwTA+CgCvk0mYuyynFVuowp8K8Igbtbp2hyhoGYEzf38z/eVW51HW5\nx1+m0TD4Ilk2qmfbA2dpmpk61IMKRK0lEmEl1boe0WWcmYaCAFPNJh5r0y+t\nsvci8Z6dvCV0RDLMZ1x2/nLFqYqn6X+uzoNh38ejkklxEvYOZIRaVSOzf+wk\nX+JAlAEX1K3617B3kz1G+jMYNa6sPCh165ocM48RNSlRITg0+gBd8baP+xnf\nkNCMNzc0SE28a7lX/scBGTKPryPNu9IGBVSlkIJWa8JKNWDbOrOeALkpt6+z\nL9GeVTQ9XSSlHofJJJEUuDI/pJwVWg5nji3W4f7HcDe+EvWN5BfpD4u93mBO\nF0R5L6YHs+PG7/hnJOb8w0XsWlSfEk/DLzFYCYeLt8k3b55CNL5RZbvnm0dK\nImP2aAMn8U9eWeI/iKrFlMgPKRsnYEda5IOLhpUyMYS4c5vuDmolt9KG1hsa\nzNpTE2ZIljq0TdRe9SoPWxXv2zVFFLb7UjG93ujyN9lKRX9TpygLJ34A14+v\n68Wv\r\n=D2s6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f37d4e46e027a3258621f6950e12796013661afc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.93134d453.0","@material/rtl":"14.0.0-canary.93134d453.0","@material/base":"14.0.0-canary.93134d453.0","@material/shape":"14.0.0-canary.93134d453.0","@material/theme":"14.0.0-canary.93134d453.0","@material/animation":"14.0.0-canary.93134d453.0","@material/elevation":"14.0.0-canary.93134d453.0","@material/typography":"14.0.0-canary.93134d453.0","@material/feature-targeting":"14.0.0-canary.93134d453.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.93134d453.0_1637681985828_0.8526522461766806","host":"s3://npm-registry-packages"}},"14.0.0-canary.bbd11268f.0":{"name":"@material/tooltip","version":"14.0.0-canary.bbd11268f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.bbd11268f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ed90334b19cdaab95d081c9be752313c128cd15","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.bbd11268f.0.tgz","fileCount":34,"integrity":"sha512-h9Iuyjw+TrtZyZGqbVbDjaSaSIQ3POBaQpOYhj7e3VKwkjSg23x76IyuQac1HdLSxTGDb5A2BYG1ChPe62Ibiw==","signatures":[{"sig":"MEYCIQCgNWoxAO1V/kVFuNRm1wt/57exvzpxvwRU8/4K0y+zEgIhAOzyy2xTTo/qF8uNgnxr/CrDJsuamzGUkxgKnTyv9XGY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnWwOCRA9TVsSAnZWagAA+n8P/3LevBgShmqgP903f8OF\nlrsRm1EobDAtqPayzvFULysnXxgkhYRnj0Q1GBzAHXK0btNjthCIO6CDBRrR\nYYKFsPPV3zZxYLLWIAu3ewHHFu2qjYLWfIvFJfrZMIUIGGevfOVbDpzZh8nI\nfTufjOa2HIb5OgGh0x6e2VIWammMRN8qG6/2gFgerwc0m0kriBb81co2s6jH\ncb/8aE3zrgAyAnZH6/bojA8DgtcZP4oYmgDwtxCZDyhHlwSdRvlz/kDLkV87\nGQpIvB4FOxXsB3TOGogWYIR3YnvHBa6URabyfhzeuJYXV1yHAbErQIVQbWux\nOP0lSe9Hool+6JU24IAd9Vr91rzIrQFwIQ5XUvqrqajUHho52ME1GAY5j2Iz\nGwGpoqQpKOf6BKl/e1dboGjGQabySw2ODhj6MoLLrnjqP6Pw4kYDgpr4xW0K\nphlxianYobhRVt8jSmDWmpWEvnDsLEY7Mc8zW10J7Y6QoY0XS2g2Vuoprs3l\nC7QAyUHiyxyBXuUU7fk+WG4vV09lGFQja7wavzO7QjyZQ32iyUycokZwhMPJ\n4E63mmep1IcatqWkX/bu1PmpB7WoEo3fXK5ppmmeCW/vk4DlQqkpXMaLOkLT\n6LQainV6+XgPg/+VcHG5oLnzw8+h+uOxWSNed1wtoOmRXlirGB6Pbxj935eW\nPwyl\r\n=VX+A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"46484a77ecd0c6d7b548301f4e92325ffc4f8010","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.bbd11268f.0","@material/rtl":"14.0.0-canary.bbd11268f.0","@material/base":"14.0.0-canary.bbd11268f.0","@material/shape":"14.0.0-canary.bbd11268f.0","@material/theme":"14.0.0-canary.bbd11268f.0","@material/animation":"14.0.0-canary.bbd11268f.0","@material/elevation":"14.0.0-canary.bbd11268f.0","@material/typography":"14.0.0-canary.bbd11268f.0","@material/feature-targeting":"14.0.0-canary.bbd11268f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.bbd11268f.0_1637706766702_0.12794504533441953","host":"s3://npm-registry-packages"}},"14.0.0-canary.3db9c4d3d.0":{"name":"@material/tooltip","version":"14.0.0-canary.3db9c4d3d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.3db9c4d3d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"97bf8f6ec6979caac711d89f6dfb02e9749b9b2d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.3db9c4d3d.0.tgz","fileCount":34,"integrity":"sha512-2KH7twwHto3kXiduROZh/0b1m92xX54XJgQEztyWclRLRZtcL5AkpHH4X3uw7h6kT7vvrL6PfVFUeDJ+JN2KhA==","signatures":[{"sig":"MEUCIGqc2pXkyjDRN+gj1fEYQw57VNJvrI4/aZoIHyzmc4X5AiEAwsHpsWaH0Bp3ooyzjs62w2lXTNNh3urbsQQJ7zYEmoU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnlxRCRA9TVsSAnZWagAA5jsP/jUs6uyCbhmJpatQ6k+A\n8TEOhHO/jP+jIAHb9hrvfqg1oYN7MPWIT8F4NDqhjQ2zNQDPfFmRBLa9tS9w\nb4kZyOKjSj3kwycyaynalp1elRcDOyZFpUgtgTu79PnkbhiCtZKcFt0zk4PL\n5U8QkE4TY/m0uSMebmzRFyFEUDJ+XbdEaQrvHmHdTZnnoACr1W4swczxggMq\nSDiR0A++gd5SAsDqYs1eIN4azV2OPCFygo9PWelibCLcLo6pHrRL+fYgQ8pr\nRJEPgvvuJpdiLCtQi8r/TRGO8hjkAam5nFJTtQvCMZpQnRP0upxDol/zgoYs\n8ZXmG123CuL5uKaLWxjubAdUKDoe13lBgZM2Cy9l4LQTFHYJMTVEAXBKXdtE\ndaQ0CH0phwX04TlyFrgcYKuxTcRNP6BQrwKqVWhVfZ1HBvcwVYsp/JIOAQTL\npj5Zak8InqeG78Os7l1Kk4gx+wfUoNgOrf89i32YOM7KLYCcdOOoUBgMLxXP\n3rwmUau6h+kGNQIBY04bKKrE1zh9oc7aJAoPSURanvE1aMHL8GgYhnqabfpy\nE7+4gLyZxNOrUB3ATLQHaQbexVzW2+ud7fVMQMHXGybpMb9+usS0Wbybab6S\nJ5dI3Bi8UDgSfh6B4ukmUSWUB72L2shPa0DpMk+mt4AlUAQpCzDlr3xyXOd7\nlXuX\r\n=Q6t7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"61e9de8c9bd6ef83a5f0949cf53ce4a8b689f158","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3db9c4d3d.0","@material/rtl":"14.0.0-canary.3db9c4d3d.0","@material/base":"14.0.0-canary.3db9c4d3d.0","@material/shape":"14.0.0-canary.3db9c4d3d.0","@material/theme":"14.0.0-canary.3db9c4d3d.0","@material/animation":"14.0.0-canary.3db9c4d3d.0","@material/elevation":"14.0.0-canary.3db9c4d3d.0","@material/typography":"14.0.0-canary.3db9c4d3d.0","@material/feature-targeting":"14.0.0-canary.3db9c4d3d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.3db9c4d3d.0_1637768272944_0.496047071254599","host":"s3://npm-registry-packages"}},"14.0.0-canary.78305b6d5.0":{"name":"@material/tooltip","version":"14.0.0-canary.78305b6d5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.78305b6d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8fb733f415f7fc180fd60b84239b84f8ea73a627","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.78305b6d5.0.tgz","fileCount":34,"integrity":"sha512-u6NAsqpZhZNwIonWXnJCiELF3xBMNg5K7AqBf4wStsvnZkWew/QDiOVMIs8w5I5I/zOkuBbKRlAKvRXe/FfOOg==","signatures":[{"sig":"MEUCIBhFvJOqjpYkpMh3iwdUV6Fk6psExeSiBmLypuO2vwosAiEA/rDecu3jLhgqt7S5f1gQX5it0961pVP+tGSmDEVczbg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnpetCRA9TVsSAnZWagAADqAQAIJyOPli8wHj7SU27gjl\nBW1CGbV6sqBxiB9CExQb0035LH/cywAj9K6lBNphnntyXPF3XBcnw8MdW98m\n8dAYdeu+EENnt0jCBDWQl9nWKpBUOV2AMJJZT8BCufjA8stQmBt0KsK4Atwp\no0CpdnDa1NRWmhbeohTSzqdTBXJxXWF5f+4yNTMmq5Ib6OfE1m9s/MFBYrWS\ngBXAWkwefVBZ2XyFMFNq42+M8LzJtD08lMyZe6kWQ69HAuTGGmIhAEfNGs0l\nMcYc7Ut3AIt11sx8r1sJAD6cAI6l44YDvoDK93p+wXdTQcieNv3V91FPcQUW\ntv/sQHc2830zey00orxOWKvW7Vu3Ds0ALbW+AliqbUhPjzQz32SVqCdSMyvY\nulpcuFyvVBSatkYgn05q8/m3eu+x1vD4zm9S375KT8y2j0L0m6accEgQDCTk\ncKGFMvqB/PcUDvQ5zdBx0V8oJ/MC1vgJA1VCPJs4z9hlH1kaLH3/A9sOpqRH\nuoHYUQPOS8lr6ziKv0JajUZfqEuh6cLYQWTCNDrBOShkWgCaekje7XDg1/1L\nuOMYYczKyJvkpHi/yT3Uj2UkKNYsrldc9MnChw41mxLnATwdWW6qJKs9tSla\nXKzZ9z+7fOmcF63zNo1zpmfjeiTHpPhnq/ZkrC/L8IU+XynjVzBjzrVMTP+s\ns8D6\r\n=L1gz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2885de69eab36903fec52b85e7001eb561624eff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.78305b6d5.0","@material/rtl":"14.0.0-canary.78305b6d5.0","@material/base":"14.0.0-canary.78305b6d5.0","@material/shape":"14.0.0-canary.78305b6d5.0","@material/theme":"14.0.0-canary.78305b6d5.0","@material/animation":"14.0.0-canary.78305b6d5.0","@material/elevation":"14.0.0-canary.78305b6d5.0","@material/typography":"14.0.0-canary.78305b6d5.0","@material/feature-targeting":"14.0.0-canary.78305b6d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.78305b6d5.0_1637783468764_0.21181729367017743","host":"s3://npm-registry-packages"}},"14.0.0-canary.43d08ba77.0":{"name":"@material/tooltip","version":"14.0.0-canary.43d08ba77.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.43d08ba77.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8bb1af002e77d14a499a93fb14df7af55185108a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.43d08ba77.0.tgz","fileCount":34,"integrity":"sha512-Bv1uyLRI4hylolrBVL4i4pAjHz+qn07l+dx1ML5LpFZnuyUjOYZPt/EMBYHHI8AY+ia8oXYufXY/Gu5F+te4LA==","signatures":[{"sig":"MEQCIA0Ldc4mlGZALHnKFlE2BP+5Bq2Od2jcl1wcKkHsHB1/AiAimYGCpjOfjSvjD2fMYAnIoAEWTFhTjMiVRdHHRlG2Uw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpqwgCRA9TVsSAnZWagAATc8P/i1oGCaAGE4x3PiSRstD\n0kJPRDOeW6bdSkV9rvm7vErDQ2QXpJyOcXL1G0cdq/ZVE0IWdoPd2pRY1617\nly2NHP1AUsD47ZsPGJ2tqcjOp6R9MslooFhwPptJR5dEvGA4MKUa3bJTHTXa\nnQrz42n704fGGiI2QuNZtkfrocSS+YFUSIGe98PnsqlIWoGnNN/U0usyhsuJ\nl0vyKPT7fpett1dlAPTRdH8PNLBAVv8vTuW38vfZf5cWxHOKgL9OJ8cuZ92k\nlRn7un1bEH6ccvkvciRRDC5ky+Y2nKBd1G6ksaM8KyXOiqFDGkb5aaVqdT7v\n5Rc9eQA9IKAn4F0cuqTMW0fN7fDsRYyc2RGAGfczn6jUpvvgKLDEvVtQkMyW\nVpdBuqS2sNfI76CHWfJ7LM2PxnRr62Xh3Ojt8nvSrr+8Cts94oBrWCzNb5OX\nXroG6z+gMW4ND9ncSK4AQbDaQHxktaFUCa0DarQvdbCo8fNjIjeZh4MLc0I5\nhlmNqwfmK9H+pxTH8rq6mzgq8iFHaOljaiem80fqGOjMtZG+uinP25XiQf2K\nInGKVWDgQ5V0++beYSv4FDUESkYJUSmUTlg1AiN+m4mi1SNlxEahMCUBKbsd\nE4DeclXooOkp2R5FGOPi9HCbEwpaGdflstfggufhyqC8Vy+QFoCYByiv8Aq0\nLP8c\r\n=jdj5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d1929fe60ad2c7ba249562f1c1702898df8f04d2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.43d08ba77.0","@material/rtl":"14.0.0-canary.43d08ba77.0","@material/base":"14.0.0-canary.43d08ba77.0","@material/shape":"14.0.0-canary.43d08ba77.0","@material/theme":"14.0.0-canary.43d08ba77.0","@material/animation":"14.0.0-canary.43d08ba77.0","@material/elevation":"14.0.0-canary.43d08ba77.0","@material/typography":"14.0.0-canary.43d08ba77.0","@material/feature-targeting":"14.0.0-canary.43d08ba77.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.43d08ba77.0_1638312992466_0.5362306566103885","host":"s3://npm-registry-packages"}},"14.0.0-canary.17a072535.0":{"name":"@material/tooltip","version":"14.0.0-canary.17a072535.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.17a072535.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8406e847f735d4eb77be86bc9e0ece58b5107ebe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.17a072535.0.tgz","fileCount":34,"integrity":"sha512-XULCfhsUzRHIiA+lMUlQVYwEElyYVTnhATl4bFd0dzKJVx8F0NbuuflHLzjjr/l3bUtsHGJIvWZImVOpaJXevQ==","signatures":[{"sig":"MEUCIQCYhB7dzGgwavZeZfVk/qSv7CL1AD9zns4aYIi6CfBJIQIgH/FVprilix/sgaKj3Y7CyUt5Dr4cWRTvlNkUYuyhP4U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqQr6CRA9TVsSAnZWagAAKngQAJ8Qsld7ZfIF/d3IcXjd\nOBdSVoP/f/1Pj9kkqtIO/2a4DGR+pfEZuUMKmC7kPWT9v7g4D8FovZmejgwQ\n4L2Kc+foSJnZLtGIcyVI9TIRJQ+tLdTgd19aPZzHvNdZZ9Q+A+pJ0cdtlR76\n+8slJQ4hrHPKF8jQMc+Y7D5/lYxUEBZjlypk/vvSakGQrV9R5DmsHYWz1a+x\nIUuzfzVb3TZX2p5C9duFbTohxdWsDNlMvKwBAQLa/+QjNn/wEL3OMUREn5zZ\nuc6JfztcahiJaQl4VkFRqD4/PB4OVzMeDBoVixsgbKk3ITrSP6cp9dkgwY3T\nDRX132EN+46DC/1JWewgwicP8CbmYh9PkkCzzvMircaQvTXw+bmZzPZ+nT1k\nlG2N8vzrPf/ny5CYE5GBuGMKvyhh+02NllOJoVrX5XFq9QuxnC5/ZJJtw7b8\nHWMUIxC3HVzlgOTDPv7KtYV/LFUCnfDMnhanCLSWKrH6CvyO2Xvt2kreZ2km\nYu1cOa05aCJSjHT5S83pbQMzumKYrKBvKyXWV9L6oyRbDFJwGZg3iy32x4X/\nPVPfo8VoAfGJo118u30Uto1t4bccjXQDtZHvBVo8rYEFK5c7m2JX2qx6CDkE\nfv+tg74fJvqfYwpqPYB8oWrEzGhIAWzzF5LKPxbqPVQO9Gzv9kJZcibWBmpM\nxIoz\r\n=ENUl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"317cda93b55159038a12575fec5c35e9ff5460a6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.17a072535.0","@material/rtl":"14.0.0-canary.17a072535.0","@material/base":"14.0.0-canary.17a072535.0","@material/shape":"14.0.0-canary.17a072535.0","@material/theme":"14.0.0-canary.17a072535.0","@material/animation":"14.0.0-canary.17a072535.0","@material/elevation":"14.0.0-canary.17a072535.0","@material/typography":"14.0.0-canary.17a072535.0","@material/feature-targeting":"14.0.0-canary.17a072535.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.17a072535.0_1638468346165_0.7728048204752145","host":"s3://npm-registry-packages"}},"14.0.0-canary.5d809696c.0":{"name":"@material/tooltip","version":"14.0.0-canary.5d809696c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.5d809696c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8006738abc9461918732b0547cac1989eb11ff25","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.5d809696c.0.tgz","fileCount":34,"integrity":"sha512-wrvtKGGEGL70L7XxFZuhg/Ae2tX7gTAXbMydoiAhDbS2MONMAeXwvYMeWdZYQVbZwq2umj4Ou3+tHgiKTCPmzg==","signatures":[{"sig":"MEQCIFvuV/9P1lwuhWKZH/LOGe60Lh5+BCJt2JhqZkXfERriAiBXj1gW+3xruvmaH9am+Sc52PfQGuR3IC8/S/1BltBmqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsO8XCRA9TVsSAnZWagAAuCAP/RInuqxEzSFTcBKHMt/p\nl7/MNh9ZCl4AzcyN/l0MHpaVd1FOv8mkItd3MOT1BUJhD/wSuGH5yjDdHWb/\nXHQFzdrf3DUpimd+zp22GCFBot32m2eAnuIzKppg/+24J4fJzYehSewpB7gO\n48Y3MU+L7AP683rpuP9jKNX6uVg/1RXxecMVGsixX33mwZwKusFp72sfZUmD\nOr/mWF/6OCnR9YsQllu5DAc3QAhGNwDOUhLa55sFu6qUgqZMLvTp05b13X8O\nqKOkxOePnb7NYstNI9PGctXJ3Ks2lBMr7NxI8NjIY5dtsgCvVBhr0jCZrjy0\nsWbTRUpOz9FK+OL8jbavLVdMYvlXX3yNYvQfEH6gTz+TXtl+ia3ojTI9Sbwc\nSOTCYOY/cHv57sL/6D74QEyM5EwJaKKR3vxVgSR7Qpcs5bwxFmpeizwJb7ZM\nhLacgdwvzHoMqHm2ZZOVxLL/odPryTtsbeQ9QJNNtwnr1RKrcJ0/hsfV2p0A\nMmPhVq7jC+rE32OBxEBKGvG+q3XjZb+/yT7sdiSpqrUtbva25znbQsU+P35k\nPD7j1NKDXscwup3PqqUd2HGlxGOImJeO5+orN2V3z3pshhRx1ydwktrM4sSP\nZlAv/OKNKA8lDMzU/jcNhS/TTpoAJPKMfz0iCFZ7KVGjiwfnDGFPmNPuUzKX\ngTF8\r\n=d4UX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"955aa3e4252f722f096ceef387b285a197760b82","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.5d809696c.0","@material/rtl":"14.0.0-canary.5d809696c.0","@material/base":"14.0.0-canary.5d809696c.0","@material/shape":"14.0.0-canary.5d809696c.0","@material/theme":"14.0.0-canary.5d809696c.0","@material/animation":"14.0.0-canary.5d809696c.0","@material/elevation":"14.0.0-canary.5d809696c.0","@material/typography":"14.0.0-canary.5d809696c.0","@material/feature-targeting":"14.0.0-canary.5d809696c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.5d809696c.0_1638985495228_0.11007389008572943","host":"s3://npm-registry-packages"}},"14.0.0-canary.b6510c8c1.0":{"name":"@material/tooltip","version":"14.0.0-canary.b6510c8c1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.b6510c8c1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b3b4156ee8003a9592a86a258e5e41dea86c0be0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.b6510c8c1.0.tgz","fileCount":34,"integrity":"sha512-fS+kNtRn7K8GDKyT6eEEZlqeqlUELjydvPfVz/5hIWVpH3YOlwcayR5qRtOjBwspyAHkQSisNbKsRZgrB09jew==","signatures":[{"sig":"MEQCIBiqUsw1ghuRmhgPgh3lZg56WeHI4hekGxxZUkf+hWn6AiBUuoDGDtip7aRmMqoQXRVLL0sVwwimgIP7qzVzNLjQdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsPRMCRA9TVsSAnZWagAAKMYQAIujciB9k7XA019UUyar\n1GhxDMm8orUe93zz+X6XLzzVYZFA9opwOVvHB1ovtNA2jrlGjRWJaTzxniT4\nfMNHp0I+XwxjI2cNjgBg5DOwl07O98oCqzTIgP2OzhWVQ2TXXUUH8f34dTvM\nuLDX0a+MRsGwXq958xr2OqXcTIvS7Si1DGbymYYY/7qIGCnDRV0h0Uy7dYD0\nAKiIUoNyy6Fo0QA5p64T7GcZl1USoIeVAP67nVv97kHSJJKAJPKWx8bXr4yu\n0ntIswiJu3HQS3OtZz1ZramxSwOvQmp/XMQ/+GYsWfCQhvLB26ai7fCApv/m\n6kwutSXcsOkahHLNEWz7SB11x38GYI45UIoTegu7p729ixcI9gd9jqxhlf6p\nR9oQRN+93oKByVRMrB6vb8heQRz5/2LBPgToPT7siL02gBl8x4f6Ie5kKWi0\n1P4uWqAwxSQoVJJ8L9SKjvbqdrePOyNc+fcNpQqlYQVpC9/nCoksNDxvw8jU\nPvWMeXadw5EREqsrpa7/DK3Z9fuIsSopVm1l0Cx3J9usK4YgB2PRjdPlvfLU\nhPx8BVw/kf2QZH6emBXNmA32djGYhUCDwujB8YmbMPbj900hrkzcAbGb7n8L\nW2oCID7Lvq3EwuPjDhGueoBUiJMaY/sWMp3R0Nm13lTMERaKBkTt23+FTC1A\nyvGW\r\n=c9wX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7b9b6695d55be857206c67de94ea9741aa48bb38","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b6510c8c1.0","@material/rtl":"14.0.0-canary.b6510c8c1.0","@material/base":"14.0.0-canary.b6510c8c1.0","@material/shape":"14.0.0-canary.b6510c8c1.0","@material/theme":"14.0.0-canary.b6510c8c1.0","@material/animation":"14.0.0-canary.b6510c8c1.0","@material/elevation":"14.0.0-canary.b6510c8c1.0","@material/typography":"14.0.0-canary.b6510c8c1.0","@material/feature-targeting":"14.0.0-canary.b6510c8c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.b6510c8c1.0_1638986828574_0.8619283815623526","host":"s3://npm-registry-packages"}},"14.0.0-canary.f460e23da.0":{"name":"@material/tooltip","version":"14.0.0-canary.f460e23da.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.f460e23da.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4dfc6d32f4b1e0e0a90ff193ea18e79f916385d6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.f460e23da.0.tgz","fileCount":34,"integrity":"sha512-4WIr4bkf/agr+ohB65OQGNpJY4arL1MHaGMOrjlBtRSbE2QOK37LKd+UfJSmoP6Zk3JDtX9M8SYDycXZpqWf9Q==","signatures":[{"sig":"MEUCIQDhJVIyejhkvhamGETFg4hQw+m/MKF9q8X9iOfLe7gijgIgRFZWQvuMJw1cQl2xFlr6btdl5+8j75HexBn0zyW935c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs3GCCRA9TVsSAnZWagAAzKwP/1Awa/Ix5F221W8b3s7M\nuUXXm+GRjtQdvlTcsretmCzvNdfLo5tf6zVDfIxRDykZ1gB/Ya7cmSpFdz/G\nmMzTiKfIFS3Z+/c5Cdzbqixc3LHvmU0KJoFpJklEqyl40bSmwBgtITOx84PP\n1gm6Pf8DItj+dyimtBt+93CAzhLCepdNjTYT4ZkuPRCnVpvuEwa64gmyDh1S\nrONICXK3XxE2eWGgCsH3ef2VOx99Q/x/j2SyT6O50BfSoTGGrQMEYj/O92Iz\nl+uERaNKZrb/XxBv0nKOP2fSX4Cao8YvgOyt5dtDGasm/TZTpfgoB4kS1ZO8\ndv/shFdCUNvohJVsmDu6+gqoMCAp0gYt8ONW7QrPaqkmDRrTf4lzfsG3iYt2\ng8h4vFo0czSluxECm5i6BZV/uCZCt/rmociE3aJQqSLnGwrb+uCgFagXyNC/\nTSDdiOollN74dhzEDp3DSLhni1xjMsjZcVDygIWwRkBIif7dDbozrE3YehY8\n+LjU7B7u1z7tUu9N42bJYQ0XDmm/zo70GbxaU+Rc6bwZtq6uwRaIjB6hWuuZ\n8ZVTDHhn1PPH7gJ/VJcMuFEOmQRRCQW8/bCjyklDRCGoCkxK2DQAd9kWv153\nPCKpoHsJ6HEmmf/WjCXCmj2zdEKCMneejmv5cwZIaK/EkWOw/n/VOYUl6/OD\n11mt\r\n=Ha2A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6d994090cf732fc4f1fb93f91d64e265cada1b1c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.f460e23da.0","@material/rtl":"14.0.0-canary.f460e23da.0","@material/base":"14.0.0-canary.f460e23da.0","@material/shape":"14.0.0-canary.f460e23da.0","@material/theme":"14.0.0-canary.f460e23da.0","@material/animation":"14.0.0-canary.f460e23da.0","@material/elevation":"14.0.0-canary.f460e23da.0","@material/typography":"14.0.0-canary.f460e23da.0","@material/feature-targeting":"14.0.0-canary.f460e23da.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.f460e23da.0_1639149954233_0.46549010142530345","host":"s3://npm-registry-packages"}},"14.0.0-canary.7d8ea4624.0":{"name":"@material/tooltip","version":"14.0.0-canary.7d8ea4624.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.7d8ea4624.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ca9b3f0f2378e2f18e96465478dd9e9ef572a4ec","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.7d8ea4624.0.tgz","fileCount":34,"integrity":"sha512-Sdnlq7UC+/Dry3Lzd7yVpceWUK+7CfsDdXxs2wahIQixukF9O7+H1B1ZnJhX2hyfIOr18GNarvqlRlGrUh96/w==","signatures":[{"sig":"MEUCIQDyETHrYc9BewLEOZ+GSO0EB74j9ivGJEkQ4pmrNNnSEQIgeRTK5cAo/wZgSEYjeBCciWCzZg0Yp4OK+oRQBiVHEP0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs6qRCRA9TVsSAnZWagAA3+EP/12VaRTMI1/REjYeOLAJ\njdYs7b8nzABcFYbJGepcfa1mQhyjWt5TYGbeNabC9hOsIuRv2ZSxqVfnWPY/\nHAw/uSoMoiB0zVq7CR4ktlk11l8RU5L2qW4HAovn83YTNmOnRa4BNOhXk+b0\nhPzB2ZSyCieM0OnVMKD1mvbPK47Y+wqhrb5mlgg0RzXTjhjB3yqy7y7ay1fG\n4M2z6sMc+nb3mv6xc94rgCuywa5ypqa1Bcwoh3jkZ5YehJapgFE//p6+XSfZ\n2LQpTxLtXhF/kcUJTVhKyp5zbYcfJ+vSmPZnwFpUAmh7q0k8GIIlXA4ZwcqV\nAnKth+8TGG85CXDbFky4C8X9M3fAoYVcWv6VMc9T81kUsGhKE7CkjhSh9meH\nh3kF07f0qVc+Im9MIRHV+hFaMVO/EYDE9185Ud2Pj9MFikjcRgvhb2nTcahb\n8dDfM1bRryI0qiIbEw5914wSeWadAb81LV8UL5bk46yvZFwt5DJINMZ2c+l7\nLMXG80SPWqVfVOa05OF8vLmDc6ryBe/p4xQWYXTXirA+BIPmrmrH8b8LCmWW\n9axzkcYk4b6QbVKB+NmcJ6AmLmhVKRfBXKTrjWkKm/BnxGE+bvs16Ce3yjck\nbjHKr2jM99E1Th4sYhLof1Y9+nrhFbe86P4xWNOFEvFP3ZpwersngEx04xp1\nBaHN\r\n=Rg7E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c5733baaefa11aaca3bd6f32fb2ac29c20894738","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.7d8ea4624.0","@material/rtl":"14.0.0-canary.7d8ea4624.0","@material/base":"14.0.0-canary.7d8ea4624.0","@material/shape":"14.0.0-canary.7d8ea4624.0","@material/theme":"14.0.0-canary.7d8ea4624.0","@material/animation":"14.0.0-canary.7d8ea4624.0","@material/elevation":"14.0.0-canary.7d8ea4624.0","@material/typography":"14.0.0-canary.7d8ea4624.0","@material/feature-targeting":"14.0.0-canary.7d8ea4624.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.7d8ea4624.0_1639164561526_0.18880106069710378","host":"s3://npm-registry-packages"}},"14.0.0-canary.8fffcb5dd.0":{"name":"@material/tooltip","version":"14.0.0-canary.8fffcb5dd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.8fffcb5dd.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"734fb184f7c134f594cc66e7596ba3d8f8b99dca","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.8fffcb5dd.0.tgz","fileCount":34,"integrity":"sha512-9Qs/9I07OMDd8VYSM4dhAK4OixxF+wsYaDonHULC5bnRcMo3Td+MEIIo2wYNXYA8uj/mA+knafy/Y2NWQsSOZA==","signatures":[{"sig":"MEYCIQDgbS/1LRzNv/xB0VfMbnd01l5vhiWgIvwWZ3tBssBqSAIhAJIWyREhLeQg+/ZjbK6R13FPG8bTQQwXyaLarXT+m8no","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuFwKCRA9TVsSAnZWagAABY4P/ifMwFJdADS/FPkfQRM7\nYrItsHFIS/4kspat8C5/3d8zikob+6K56wEdI8HnZxoiXo1YSj0XCIql4cS7\nVk4MOZuRTP2ahlUbOSwLRXkSL+1/nostwScmi9EfZ6C20DGJcJfW17FetuIv\nqVtwKKTv0dKM5otgWeCaiU5SbwAPK/HX79sMzDkQkyf3KXcz8gWh4sK1Fc5B\ndA+vEpSelV+F0CUDjvTvpBZaeayqjiZtrd/A34TUATnm12tZZJWgRjE2/FoG\nzBasHsM+7wPLWThEnlZF/IFWRi63ReZraGx4br6MZUY8CIpCXCn6vDqNf2hl\nCQ9YVLpUw3JBDftFqeuQuzpxkA0IaxdA5CyJzeg9xGF7/Q+BFrjL/LhnV1v+\nt3jeoovnmd60Zf6dttii2t5fB3aX/9mzG96V0FxVG9obbY4tD1LEtyzY/iFV\nuRZcTrHOpGaHh/qnGH8HVhlRntm+fEdmoMtaiZShhucTYjnh0Ed9j9m82pUs\nUoxXnHuGDa/OsW8NoVreaLtPSLXQVQtATTgJiSHHo9ZnNLImWYt8Ay1yqhL2\nVp13C0t44eW0UVyPpF7X7qFMTrYe1RSjLq7mlUU2JyIta0NYmEj3Vx/KrR/x\ncoXxzSkxt5p+73mNqGyBZ4ttLrO1sXdK/hp2ok5yPbyQozBKXu7BDy8oeb/D\nxiCV\r\n=Yie/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ed22e4daefd7bb5e95668ab484a3a4a65793437f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.8fffcb5dd.0","@material/rtl":"14.0.0-canary.8fffcb5dd.0","@material/base":"14.0.0-canary.8fffcb5dd.0","@material/shape":"14.0.0-canary.8fffcb5dd.0","@material/theme":"14.0.0-canary.8fffcb5dd.0","@material/animation":"14.0.0-canary.8fffcb5dd.0","@material/elevation":"14.0.0-canary.8fffcb5dd.0","@material/typography":"14.0.0-canary.8fffcb5dd.0","@material/feature-targeting":"14.0.0-canary.8fffcb5dd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.8fffcb5dd.0_1639472138005_0.318713271272105","host":"s3://npm-registry-packages"}},"14.0.0-canary.21e1cb9be.0":{"name":"@material/tooltip","version":"14.0.0-canary.21e1cb9be.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.21e1cb9be.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9b18147d9da69343b7ede54599c2cafd7a95e865","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.21e1cb9be.0.tgz","fileCount":34,"integrity":"sha512-mjcXdvMhgMjbVjuQ9JEepf4ngF13xJQdzrPW1nMLe40cXEKhVA1hPww6MhQrRiYOu7pBhVZ1G+pGQdiu2moR2g==","signatures":[{"sig":"MEUCIBFs71mEw/AinW7dFlMEb2LP+Z6Fp1+gk+46ec+a+XY+AiEA86YVZmzVV4J4DmtwC+5fTpVEUnUtGiW4+czbiz/wTzE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuPMlCRA9TVsSAnZWagAA+fIP/0k4FbaEowBQUOlgHFWD\nuYnRxH8eNpoutRuF+opmeOEhgKNVJBUjDL5UZ/rIFzNQeAZQe1BvXhBwAd5Q\nsnRQ7Qs6FmxpJEFye4LjM/a5f2ySCqdTZMv6yHxpzajxIwpjASjaFv+Va78f\nlUBhVGkxSGncFoYj/hnkearEeM+RCQAZU/f//JIFrks1NuFaTsFvilcOOA9t\nHy54U0+KniYXQGmJAu8EDbS8AM7UL7X2itOC/GJCIrJJWLIcvnhlJK82zrky\nQbBjXaemLaQ6kHWh4O5PTud26M+Uly/nrKiX6qkuryLSjeYl11COQVWH3/jo\nnGIehRsLwUgxUw/LMaP1mC8A68KoTpAwql1urPyzWAZEZwTAhcIZsrS82pee\n+e+EOV3kXmY5UTla0veJx0oHvEf5oVpgijELHqBVcVp4L6Sbw35DORJ37VvU\nlftI/COzJx+riBvx51n8KxDP2hpjXbn7biB5BJHh0Y6WXowy9qfKAXw4r0/m\nQ88B+cuTJ3IUTpZOWEwJZapVsD0DfQ0fqPnhDZ6bXQj2DOIc6sDvmCFtgMUq\nGP0fluvtyThiYXvcqKgW+2m6NPhY7XFTfAIs3QgIQx8X8NK5IAO/wRnOyVb8\nrN5tPUwkkNKv4S/vxslKUNOt4umAL8m6K+9bopCjbaE1cTCWWBxMvszycFvI\nlKO6\r\n=9mlF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"091bafb203d13305d394af0cb6817b1bf05c64af","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.21e1cb9be.0","@material/rtl":"14.0.0-canary.21e1cb9be.0","@material/base":"14.0.0-canary.21e1cb9be.0","@material/shape":"14.0.0-canary.21e1cb9be.0","@material/theme":"14.0.0-canary.21e1cb9be.0","@material/animation":"14.0.0-canary.21e1cb9be.0","@material/elevation":"14.0.0-canary.21e1cb9be.0","@material/typography":"14.0.0-canary.21e1cb9be.0","@material/feature-targeting":"14.0.0-canary.21e1cb9be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.21e1cb9be.0_1639510820824_0.05385271913082934","host":"s3://npm-registry-packages"}},"14.0.0-canary.ba78e8724.0":{"name":"@material/tooltip","version":"14.0.0-canary.ba78e8724.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.ba78e8724.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"156af9a3e9569a1ccc294d177c48e447b8ae1d20","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.ba78e8724.0.tgz","fileCount":34,"integrity":"sha512-AnjWW5x7VuJaK8yhM0X+iXyh+EmRqsB41wPna7T7N2/1WvcuE+mTNomSUV00IUPV/SPGB97ezKmRR63SCuFWfw==","signatures":[{"sig":"MEQCIA7dkkIxSWrYcTElB+C6sdH/sFsz/D8HFzhfzDLkMItVAiBMxhkUsMgHzn3mVFw0m0esGkBQA4fKnFmZP/QHdWE2Jw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhumiJCRA9TVsSAnZWagAA76cP/2fp2gHSc/wvY7xs6MDa\n8mDeSGFtw3OosxrqA+cExBm5T6yQ+taQrH1QWtfN+3DO3/tgN7jkvqvrDTt9\nUrZx97u/LKIyZ+JjCydIv9HxvgO24OtILFcaKs4n3u+RTpzbW/qWxLMSYGi2\nlZLd8sLRezQnbPewXimpw74wx+NVS5jYvgQq8/NKSUCiq770QhBltI3ePjq3\neZl51lF5PNwKjBl8Gx8/PSBUNsQHn/91VlTgT8bidJxS7cGOhQbTm3oy/25l\nvlp/dvKYamAhs0EoTzpOQH8ncMMZe4rxdHEfdGiK7udSAfIdu0qH4OV652Cv\nhH+F65gcwf2pvesrKVtwSZzZlLwI+gm0h/saMyJ+3q2TeJnXnRBGAqUwsMFK\nh9NNijtUXZTa4FlxOCugbS+v5tsrlzIW2Spp7iMSy9as3a45enP7O80SE8Py\nrMgxu2aBtJishJyWdWHCFqvASi5ZFsmvkPcLWDFouEKhpXp2lfDhzM4L2vHt\nZdFa8S9E/+mBU7k1La7Ha851t/+1IVrw8iT/YMCs76Vz5DN2F3CpmSYFCAK7\nJi9vuWi8hgNQUDMFEuKmzKI98+xgEGKPSMF+28SA46LPjZsl60WBxIr93RWQ\nAOWchO5typLv/TW4fdvB5iFVcUNyY5TeJHa9kzKNcyQlV9pY8j1CrBesWl+P\n3Uft\r\n=tzSH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"396b66ccff73478ac662f95bc36087e71ae8d980","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ba78e8724.0","@material/rtl":"14.0.0-canary.ba78e8724.0","@material/base":"14.0.0-canary.ba78e8724.0","@material/shape":"14.0.0-canary.ba78e8724.0","@material/theme":"14.0.0-canary.ba78e8724.0","@material/animation":"14.0.0-canary.ba78e8724.0","@material/elevation":"14.0.0-canary.ba78e8724.0","@material/typography":"14.0.0-canary.ba78e8724.0","@material/feature-targeting":"14.0.0-canary.ba78e8724.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.ba78e8724.0_1639606409179_0.3575841431992035","host":"s3://npm-registry-packages"}},"14.0.0-canary.e3e073c00.0":{"name":"@material/tooltip","version":"14.0.0-canary.e3e073c00.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.e3e073c00.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b538cf04f8644f6e60efdadc35b075119f5e34d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.e3e073c00.0.tgz","fileCount":34,"integrity":"sha512-YfahgTBxzO2K07LfrUfhCxEMnJq/tiMrRmGqQ4PyAYD+jDUkZkUc0VaSDtT60gkE/ga2PqK5lQAX6I5nqNgfgQ==","signatures":[{"sig":"MEQCIH6H6437mOMFppsTzdUXDidKYKg1nn+Yqg8c3APT8NK0AiA1N1bhEzTd+eCOlruVaMT+k6WcZ2pgpawkn+Emj3k5mQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwPE0CRA9TVsSAnZWagAAtWkP/R430ixMHI+4UMNaRPTX\ntpFChY0sJnQqTsr9s4skKEcpSkqArHsUQESOQdeYlEzz7Ld/BvsCoejiMJdh\nO45p1U8jro23Y76U29jEi4AkOAI4lTxk5tMhcQUsTKt/PMPU9eD4ll9+C7Eg\n2Z7r85yfG7JOR7aQzEaYijQ3/98MO4gT/OU3tnaTFuvZkUgTqOm6EoLo/Jcw\n6/q17qJKW6gQyelRBza6ndt/XPT7PfcbLcawwVvKkoEMA4tvnNFXD6FCCzsd\n8wIVujNQeeHl48HcMZ6DRMfygf/h6N5kPJdyh+tBy8bkY1aqXIu3cH9M5ZqL\na8s/t4KwFxBHSXnnrQQIZyvKw4wvGdn/VlsLFzD7ccHd7md364xb4XJzCGl3\neIybLcebeBw2FjEEFsh9lOV/+SyjBtbcA0T/ukiF2Rd3N1C5xz8TvnFsu0/m\nP3+wXwTCBmfNVyIAuPMM9xYiWNtdYZKmYt5lNm8NAUFLjr82SnoZ73QUJ6t7\n7P7/RDH6XmMmcdMO0W7tfs4FGWE2lMoEAXIvj/GtAgsv+meuvwcDor9RVcH+\nYeyFvT8ODAQtuZQMhJ2tWEV4z+p4GhsQycYcQ2sDRUlWJyjzeAO3oto7CY54\ncpL+QkUJmtDJ4DpoDHWFA3zVIulvYukdC2PhdPgonnRa34aJdBgyzMAimwIS\n2oyq\r\n=pIPJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6ed0d4833cc10e9b5406989bcd66b072aaa259d3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e3e073c00.0","@material/rtl":"14.0.0-canary.e3e073c00.0","@material/base":"14.0.0-canary.e3e073c00.0","@material/shape":"14.0.0-canary.e3e073c00.0","@material/theme":"14.0.0-canary.e3e073c00.0","@material/animation":"14.0.0-canary.e3e073c00.0","@material/elevation":"14.0.0-canary.e3e073c00.0","@material/typography":"14.0.0-canary.e3e073c00.0","@material/feature-targeting":"14.0.0-canary.e3e073c00.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.e3e073c00.0_1640034612714_0.11849099653321571","host":"s3://npm-registry-packages"}},"14.0.0-canary.3366a71d7.0":{"name":"@material/tooltip","version":"14.0.0-canary.3366a71d7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.3366a71d7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e0f341a6c7d00419a8d043a8cf7f507f3367b8db","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.3366a71d7.0.tgz","fileCount":34,"integrity":"sha512-73iQZ9DqhuyB+FOUjeDJq3eG2luYamlywzD/IRt4rRS0O6r2rZgwLM+j2DShQfPNKCvLUCxTwxVTIbLpo2o4vQ==","signatures":[{"sig":"MEYCIQDv0k3XvP28m5fxEaZoT1D6C0nCWz239oHiD0Mcw2qFHAIhAIfZXTvGSdHXWnltRYVzqGFRynQJ/AFt83rPvRZTjH8j","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwxriCRA9TVsSAnZWagAAJwUP/ivPVGBiFlZztcANobGi\nbtVsNEivZ/fh8JEaICIfQRpmVtW9QUeVjj4+fGDYb1HF8kTRMfzM2J6KrOUJ\ngWq3+J3AAHTPQMeyhMEwVdcE9DjfHhR5wdkGYCTttf5i8fW2Ye8v6zNNldQa\nUU1ujLyIPcuwkhSvWqjSAxQHRfx+bWK7f/9i0i2k4UlAVwml+D5+vviGUHxY\nWYMEWYrszowUCuXmsPkoV54eao/k4LoKCvOehzDaFSjPqZGIGR5ZPcAJOKCp\nUQiC9ma9mTi81YISSPQRuILLIGmT3RYoFB3N4s0e4Mb2yIy/GdMpG/Hy0pHD\n20uN+LjGA7fZe0yXUeWSnFy0MJOP2MVZ6EUisOuJMrfCaAehtefQLrdMZ3Bc\nVqiobQudxI2uyJCBLnkrVeRjJMpytAMWd0p7xcWe+V9lwm0k6FEGy+G++hGx\nVxXklSl5Eo5bt3SNBBYGBKO5f3AOjAJ/zNHMMIG9UF/jjPGX6KN65nguZKyh\ndTZkRkC7u1HijeX6u/meq6xoSkM6Kw6AwF80LKGVuAz4cnzbjtMBLXFJVeeT\nzr7YP+icpfTCBLEmqmqxm06td+5qUVBSQ+eF1xneCgrvpUaTFKKkuuEhv5hX\n6asrrH9wj7lO4nQTRMdGM2NyM4Wz1CzKypkwJs64bpNFwX66mgNIVa7lZrnY\nb7l6\r\n=0Fck\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"36f8040c2829cecee06f5c8f52e08e9cabc9004c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3366a71d7.0","@material/rtl":"14.0.0-canary.3366a71d7.0","@material/base":"14.0.0-canary.3366a71d7.0","@material/shape":"14.0.0-canary.3366a71d7.0","@material/theme":"14.0.0-canary.3366a71d7.0","@material/animation":"14.0.0-canary.3366a71d7.0","@material/elevation":"14.0.0-canary.3366a71d7.0","@material/typography":"14.0.0-canary.3366a71d7.0","@material/feature-targeting":"14.0.0-canary.3366a71d7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.3366a71d7.0_1640176354500_0.5888995254995721","host":"s3://npm-registry-packages"}},"14.0.0-canary.c047f7c19.0":{"name":"@material/tooltip","version":"14.0.0-canary.c047f7c19.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.c047f7c19.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a1103aad3059d02e31c05b53b5a9727ecccdffde","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.c047f7c19.0.tgz","fileCount":34,"integrity":"sha512-sdjIbCr6G4Vji9IxLgfLVkso4Ypqx+31lQxcCWIH7OyDN9gjv8zEu6bMBJm2tmb75+mz2xrr0rSj5HRcQYDY7Q==","signatures":[{"sig":"MEYCIQD3HbqmChvmcKue+a8yOL1XVcFghlaDv4ORrjK5YAhY+QIhAJ22MX8U2N75hYL4L7xs/KaSMYlW13JPKyqw+bH2ghxQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1ctfCRA9TVsSAnZWagAAFWYP/i6PMuuAA7JBZzVxX2Wn\nM4oR27cTkAc7FuPqAfhHHUG/+yJ0dpMYK8R8G45YNPiTqsRrae25LRORVApg\np8LOJS/ZcKvMVhQ1Ni5SmSQNtvpRGF/4kLB/q82TRO1Bn7+V8mn3CqV+NAgr\naByXx/D3hIx75KBfdoNBS3ryGEtzBrgmWfqScxegafsAI1nVwEX7miozRAkS\nTKuZltLzH0uTFZfKjVlhb0pmaBhuGWuEJcU1aAUjPxBE7Iz4NHHyVR+KvaUl\nUM3wsAiOUSz24tqFJCWKa9PM0v8yqtDvAIcLuaVEBu/m49+UBEx2TqkOMkRL\nRGgj9uc8xwo2K2xCbhb0luC+ZEG4ZjYOiNQ1Z/2rmKNI0m88LXDBTE5qC2kj\nqxRaqZM7m7CRVQ98YZsR5to36Tydye0YW2LgovNOkO18/Y16UE3qykSSOBUX\njd21/FoorlixVzeGItI185vEebC0EtmaLygrFA4SBeVSSTn2dSmSH7KA1OPx\n87Jne68ouQNbE2K13DfyhTazIDraC/nCQi46NnN3VH1VdzviK8Ia4O1nk6Ix\ntVIILXr4nf05ssEqWQxZf9c4U48YNt0QljY9aGBwC+3CPaM9ufJn9JWuGpw/\nT2iMZZf/izT1YmW0nXJ+b7UVMHymerr1RKlX6+8xzwNJTHrgb/2U6bzKF18c\nifA7\r\n=id/G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f89c0e152ba1bb64d7b262b279d38cf5d93dd788","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.c047f7c19.0","@material/rtl":"14.0.0-canary.c047f7c19.0","@material/base":"14.0.0-canary.c047f7c19.0","@material/shape":"14.0.0-canary.c047f7c19.0","@material/theme":"14.0.0-canary.c047f7c19.0","@material/animation":"14.0.0-canary.c047f7c19.0","@material/elevation":"14.0.0-canary.c047f7c19.0","@material/typography":"14.0.0-canary.c047f7c19.0","@material/feature-targeting":"14.0.0-canary.c047f7c19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.c047f7c19.0_1641401183162_0.2189569365209807","host":"s3://npm-registry-packages"}},"14.0.0-canary.05db65ec0.0":{"name":"@material/tooltip","version":"14.0.0-canary.05db65ec0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.05db65ec0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"85c1674c35828f3051c71d3ddad523db3227cd62","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.05db65ec0.0.tgz","fileCount":34,"integrity":"sha512-0q3HQEk4EK+E3zHyQRt9J0we+laz1DcMh2A989euORdUzocd57B8gYRW6cUBtK8HYdehHeRyWUSkSOQjQ6SL2A==","signatures":[{"sig":"MEQCICLQn7jciQHf62AjneHxpOkt1tpM1UzNAD/1+hYmHwb9AiB5HK4BIKYQNmfVnZ2q0ciljAwlGNrJih5krMe7dHLXvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":809683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1yOECRA9TVsSAnZWagAAdLUP/ielHVlON1S/vzIak/p8\n2Q7imybf0S+AVhjOa7v33f1x/SK5cpKmBQ73ojbcOYsvuMyiTemnUyOwV5jY\nMnJSl1AjbelEquasBQpjeYCwnyOKQJcFvJSugnu2Td7o5EV40JJ3TX0m5WkL\nSArm9e9WNP/070oHw4OkOfK8L9gMLVeaOPmPrP64t8sCp7pDNNlYgOCxbpgx\nkSUE2yFZNZq+1pxuIqmkX/7T0YV1rg9fkcdCh/GaKoAOeufAs8PhTMcovfw1\n9VbP7oznXYewylWbY/281Mvm61NFqHrRhoB6WrZvQgmsEBuId+zdb1rhmLEK\n9z7HYUKJpoUTCpl9PvNg6UliN8P0LN3pF59PzjLjJE2o95Dt7neZ8331vcgA\nfA9gQ0qJCiwMhnax0+Je3Bh2JCdA8zKGaVhvVijKBEZy+AhJP3nAy9wDheG5\nr52ctmLcn1GLcLAzjj/deAIF93FCEVWWdpfSXVJQnXJ5kP81UHJle7LS9+1A\nccXMIUcgnXpMfekZ8tH6bHD7nwGvxA90PHdV1i8Zo/GLAcHrfRw+xnGzMJdh\n6A/F6l6isdnE3hqhH3nQCR+ovOnOUCGcaPTN/q/FiElVZ7/ORwl4eHzlnkFr\nyf+BCKcwRFTH00WTLZbTfLppG9+Yx5/ZbdkmK/hw1+TxZLoL482IC44r3YUz\nqGUX\r\n=I/rI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4ee3c4fadb795ccabc127e2a968744c5bed23d38","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.05db65ec0.0","@material/rtl":"14.0.0-canary.05db65ec0.0","@material/base":"14.0.0-canary.05db65ec0.0","@material/shape":"14.0.0-canary.05db65ec0.0","@material/theme":"14.0.0-canary.05db65ec0.0","@material/animation":"14.0.0-canary.05db65ec0.0","@material/elevation":"14.0.0-canary.05db65ec0.0","@material/typography":"14.0.0-canary.05db65ec0.0","@material/feature-targeting":"14.0.0-canary.05db65ec0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.05db65ec0.0_1641489283948_0.7325038779562396","host":"s3://npm-registry-packages"}},"14.0.0-canary.6ca8b8f85.0":{"name":"@material/tooltip","version":"14.0.0-canary.6ca8b8f85.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.6ca8b8f85.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2a380f8249ef05159395a3d5f484f71b45a4a9b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.6ca8b8f85.0.tgz","fileCount":34,"integrity":"sha512-f6ew0RvWqwH0hw6Nr4M5UebAANX0Z8kbctyZGJxqW5PIUNlSm+2x4xOINqlDc/EqDMdD845/z/t69Td/wCM07g==","signatures":[{"sig":"MEUCIC3IhPYohhhoVL3RMqpQ0fbnUCelITSbqjx52mmqMojGAiEAl60EO+TKQtBQ2NXkMYHswXoFLfSytNy95Ekv2I1zlUc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2GPPCRA9TVsSAnZWagAALNQQAJFPev2bdzsv1CPpQTRT\nOQMMbPqxulo8Boj7xyKkhrSyuBsGrUdt42k1W1dcs11STMKTMMngTHv+0csd\nQdb6PlBrU640dEVFGwlxeY41m7YWfFp2V30aLrQ0cTSu/RQxRNtx/ZacNdl3\nVBwBQ+esuofb0O3PGJeRUgMH4knAgQYDXTRUjOOGPVj03sH+34iv6hMuK9Hm\nZUI+ZHklyepxjdsr20uSh/lsfRQnhT2+Im4vdYdVOz9uucz3+c7RxjNre0QL\nAJxMp0oVx267TUtZKeGokcghynNtIXaKlC21aSO/+y7WtCFJPA9SAKJNLkuF\n0J/4OQePg5K5ruzybJ5XcTwN1G9x5Pt7Fv42ipqFXfonYVP5hfTKOTnasP8o\n5p61409HJnE9PiK2iSlbrTYinafNaxAxsTaKB4R2oTB9twpoS6hLg9KQNYyl\nBn4bXdPBPsk8gt9H4Jew4p5/oIVw2aAF/+lLtfj+WgX8O7s1byhGk+b29dn7\nmkVmEx/0EMR6N/WBit25f0ECWUW2Xo30HRrUBO6VrXthEHhJVatNL7rHvu+Q\n+sucMHs9N7Tl3dIzLHtYhGywsyIf7L540r7QPB4Dpn0OyPHtJCuShEzymlmj\ngqgfl/JUVATKlR07YP/+4uUGYuFmN8ePE7yDPHs+btISHgHnQbRF6b3bPyRt\n3HgL\r\n=I/tb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n           <button class=\"mdc-tooltip__action\" aria-label=\"action\">\n              action\n           </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b3237bcea052016fff824f201904a358e2cbeeaa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.6ca8b8f85.0","@material/rtl":"14.0.0-canary.6ca8b8f85.0","@material/base":"14.0.0-canary.6ca8b8f85.0","@material/shape":"14.0.0-canary.6ca8b8f85.0","@material/theme":"14.0.0-canary.6ca8b8f85.0","@material/animation":"14.0.0-canary.6ca8b8f85.0","@material/elevation":"14.0.0-canary.6ca8b8f85.0","@material/typography":"14.0.0-canary.6ca8b8f85.0","@material/feature-targeting":"14.0.0-canary.6ca8b8f85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.6ca8b8f85.0_1641571279128_0.3592627213488442","host":"s3://npm-registry-packages"}},"14.0.0-canary.173ee7a7a.0":{"name":"@material/tooltip","version":"14.0.0-canary.173ee7a7a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.173ee7a7a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c8b321998cd230b0630f02463c0e387af1ac7632","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.173ee7a7a.0.tgz","fileCount":34,"integrity":"sha512-7V6j8STekhaNK2spN9+jI/imX26gRP38INKPtiWhM42Gtcfm/+zN7vDxzOPmBCWtinqENtbbHB5DytPL2PAFDg==","signatures":[{"sig":"MEQCIGScFolqhCVAISR/BWw2NnoiYWLZLLsvNpAhpWplVL10AiAwv28rtYzKZc/S5B4NCYmB60uZAHxOZXiHKvMubWuCow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3GTZCRA9TVsSAnZWagAAto0QAJ7bji6t4ktb6RJnULuG\nK/q9HH0RWWg2YD7KkpZSXimEvGp8EbF4D68j/5d7x2k5aGRAEGkPcDnhnglM\n/bJpcDhpXWShKTdLpqdI3981hLRQ2Nvm/5vHU/7G0PuEOSZNGqAxbH9Kfx8F\nXnYxVxGmN+yJKWfg7j/4xrN98ICrKTdtP5tqGvdlxwd7CCh/3gRt8XrqEEI+\nvQwe6onrAHx+nQLvPGmkaVkDsJ/x/jIewYOSv5kgMCy+VLnFE7AmzkAbzoqR\nGz8PycseqnxMAk6r6GgCdAx/EjQVZLIKJ8k6vHL3uqZdzoynysHpym4LWLJs\nXSh0vOFjMaY4p+DuI3Yq0mramOxxSpOSlcBwqHzRkaQFJ6Qw0DimRhiUCzx2\nfc7dmsuWrDKYuWU+5SXfEA7jdhTHwqGG+ZdzY5gvzgdry7R+ByKW0cwv/X6l\nV4REful/pkHj1mNC7g00h9o8L/o2qi+sBp+UpXrg7TMgsMzD7LEdpoTnIY1s\n3lqK6br4Cgc3g3taJo5osxbOYPra7sx9HWPte/RDAWEmsDbV12Kfcp9EGq4r\nTK6PnVCUyPANr3K8e4zFgzItqIKvk9MJ99NJcuQigqi71+wdbjuVu1/pTGAR\nzUkD/K4v+hOHX/Bpy3yCizXnW2sE/CrjFYJbrB8SuDWy9vKN56RuoaWFrtlu\nqP5w\r\n=zHpb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f034f9d63d29784b9608c7c25ea586070efbd27a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.173ee7a7a.0","@material/rtl":"14.0.0-canary.173ee7a7a.0","@material/base":"14.0.0-canary.173ee7a7a.0","@material/shape":"14.0.0-canary.173ee7a7a.0","@material/theme":"14.0.0-canary.173ee7a7a.0","@material/animation":"14.0.0-canary.173ee7a7a.0","@material/elevation":"14.0.0-canary.173ee7a7a.0","@material/typography":"14.0.0-canary.173ee7a7a.0","@material/feature-targeting":"14.0.0-canary.173ee7a7a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.173ee7a7a.0_1641833689487_0.8863571168401345","host":"s3://npm-registry-packages"}},"14.0.0-canary.b704e4dfc.0":{"name":"@material/tooltip","version":"14.0.0-canary.b704e4dfc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.b704e4dfc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6739983f938f1e97cce699232bb75ced63e9e6ba","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.b704e4dfc.0.tgz","fileCount":34,"integrity":"sha512-FOBrxiwCYpKLfk07UkvzqY26f4MHEW21UmG8YzPomtvBSnf1XJDj9MCFQX6grc3EMBJibDKBNnYB9dXdMxTkeg==","signatures":[{"sig":"MEUCIA6A7Tpk5TrwUpXWVobT5XdSGHfI4zmIbpFjzlcpOD1dAiEAkN4NpxmMgvoj4D+GeonFHhreo9tYhVQdse0+bW0sjY4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3Hv+CRA9TVsSAnZWagAAJVsP/jQyEUjwpXMxLxax9ecl\n908pe7YfbfdqrwpNaTY4WmYKOOmQN/BwGOAelbj4BW4v/R1eqvCYON+PWitJ\n/ulAplurCoREHhaInKtHBa1FHRC4K+Af7+1/UQGwLGlIdgABzta0VJrYxvLm\nkr2IDJ6Rb+4FdR2A75t96H+n3K1uwS7zbMmw2EOE8vmTTf4n+X327uIH8fum\nw+ln4u4j3HWYZv4XngYhLvTdzOprP5QlR+PbN+1bCuD7bYrbCuz+p/6MXJn+\nf7HJN1w2VfDCrYpzRmMd+H24u+O6K9YHfKMKA1FVA6pFJAPOrTXKoa0d6QiW\nKvp9gm2GXQnfb8ZBE8gatLNs3Jjrzh+dHrp1TLAEhv1FPRiErFsgglusqn4v\nXqAnVkcIaanCerhIaUstRnYtwsFyXcX+eE1+CJDP9ibhjsGMPFBZnc2TPuBO\nrbWyNKqXi3xzKg99Nbpjatx2wN9FaunQpkY9VItLCEyuXpzsVR1OJYwhDbXy\nqSRmntehStCOWcfidHRSUtAR9K8EjI/Bn+wGCNG3Js0ijB7t/RBut/QtQYTO\nkGec78S8PTUJMoTmP5jYFXcYdEYwB+Zp/KVb07M0945rzm+8ovnXdk3JIkCL\nvrZzf5G3utm/C8gVELlUNWfl5wCMRdfeyyzSgXB76Z3fzXoeNowyrdgih3Yl\nbxgN\r\n=Z+kt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7aa8626c10b7e0fe9826c55e7f08c4ab0aa493bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b704e4dfc.0","@material/rtl":"14.0.0-canary.b704e4dfc.0","@material/base":"14.0.0-canary.b704e4dfc.0","@material/shape":"14.0.0-canary.b704e4dfc.0","@material/theme":"14.0.0-canary.b704e4dfc.0","@material/animation":"14.0.0-canary.b704e4dfc.0","@material/elevation":"14.0.0-canary.b704e4dfc.0","@material/typography":"14.0.0-canary.b704e4dfc.0","@material/feature-targeting":"14.0.0-canary.b704e4dfc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.b704e4dfc.0_1641839614562_0.6265595672056021","host":"s3://npm-registry-packages"}},"14.0.0-canary.c14e977ee.0":{"name":"@material/tooltip","version":"14.0.0-canary.c14e977ee.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.c14e977ee.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8da3b777af39ae23e94762bdf9e01d14bd0a249a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.c14e977ee.0.tgz","fileCount":34,"integrity":"sha512-idoKW+sK5o7CTfqafOroKKVz8Fu9HX8j92PesLYSIXwrAOI73HZu57mLvbFh5t+/qKlOhNkE97xLC8Yc75NMlA==","signatures":[{"sig":"MEUCIQCHeTgEODolvMDZWd6JVWvzL8Z3gyIALaRSQ5/Kuzn2zgIgEJmjCNfCKDO2aIq/HfZ5cEN8RJt9b2fb4IK+OBt1gXY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3ac1CRA9TVsSAnZWagAApqAQAIC3iYuEHNr4On8iDY3R\nMjQhchb+m41bet1LKpPW8jaMk/vFRW4jqTsy9N/vIr4ggl7VN96AyNVKuGpw\nuusyvZUBgrGA2TH3x4qy+lX+0YyYM11mPgl6uFeMPhJZOVNI1bLbGS4iYlf7\nMhEVT/j1YuzJ2/4rbK1VCHhkpY5AL91q19Pl8JV7eFeIIIEap4OgrqUk7MpL\nIrefkXb7NTIVYY7BtKSzmSmUgpusIeZQsvSF28ubQ/IpHo4DOpFvtz0CJrDd\n5N2drkl+IR1Emxy+yKscrDJ/5Lv4/tuGv6vLFJJEGnefxQ6aQiyVpOeGvabb\nK5XhmVDtUYgIud/wyGMjyGX0iLnZA5IT0ZeZk3CYjL+aOgs5kC3vgi3m+7C1\nFBL1QXrJ5nLxcEJRBYgcIKYPu8bM4euk314QHFwjXxwpAnzo4BQfXEpTn9fq\nPggH4Z1/TfcQxLCpxqmJAekCrt0xoOmtCDLBv9vt0fmXk+wkB4cki9VY2DOi\nDBoGztFrF84kMMXlPMZS2agzKiMgqpu8F8fJjCBnAlsjJ6I9w+lEHfFt5Ud5\nb/ywzVqduocsvHoSh3csYSxshsOtEkv/8P+ANQG8+veo/4W9zUsgnQUR1VOd\npfMW+KeJQkWsDJyQLy+vdIeBZ2e5fJMimY43WYMAZUhQT7WOHgTs3/NsScuU\ntlOw\r\n=UERD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9f7e1b7371c604a5d4692bdbe25aecc578fb16f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.2","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.c14e977ee.0","@material/rtl":"14.0.0-canary.c14e977ee.0","@material/base":"14.0.0-canary.c14e977ee.0","@material/shape":"14.0.0-canary.c14e977ee.0","@material/theme":"14.0.0-canary.c14e977ee.0","@material/animation":"14.0.0-canary.c14e977ee.0","@material/elevation":"14.0.0-canary.c14e977ee.0","@material/typography":"14.0.0-canary.c14e977ee.0","@material/feature-targeting":"14.0.0-canary.c14e977ee.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.c14e977ee.0_1641916213298_0.34580054661871995","host":"s3://npm-registry-packages"}},"14.0.0-canary.b094eaa4e.0":{"name":"@material/tooltip","version":"14.0.0-canary.b094eaa4e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.b094eaa4e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"538da5a1bcf3c6ccf2c99a4cbaf9000719de295d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.b094eaa4e.0.tgz","fileCount":34,"integrity":"sha512-HgiEOO15hn8geKeKejQf17B0ZcN9iV3bRnbPvfWAOyDA0vnQ2m4p3RYt0Lss4JCatKdNfEyFJ2+zyqOANhp4cg==","signatures":[{"sig":"MEUCIQCqDl9JQd5IbVj2Vacbf+ZqxmEPPOHgFIYKNvY4BpbUdAIgI9M/+sgFa7Wl7nBTuPlmF5hrXFrZ/qdjGti0zfX76eA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4cQtCRA9TVsSAnZWagAAiWoP/AxqBeRi59DXFm9Uk4J8\nISAFPv/tcwIKh21xgpCGTJ8FFnLu8tGGUdsET3Bik2MoteG6Etd1b6vs8MYX\nTAJCxPW5b2RdV1lJv83qBAek3/a5YQ7ELdlDfECtg93bV5JHEzEJsqQtAUyb\nV9uOaXy/PW3oE8/eMVz4s9HEjxwdbtReBogHOrdGB//xv/bC1zUP5qTOecID\neQLbNXnX0bG+3JBFqDcke1evpTZETPXqYZmLuCjaTkvQ+LYKrVjIxCeCRHhw\nSOHA97javMKX/dpjvu0ozq+UWTsgCZJblyhegHlxfZF437GaVK3b3CnOjENT\nnab1DP5f/WTNe+Il+j81VAgmisQ6yo5Y6ig0iGZn+rI/vm4Xs9P3enURrSCk\nHkLHdMPMM9I6j+U/ZjgMIKRvAehbNCuaEKvB95H+iaU7uwmmrj+W+Iemp2rF\nFt0nM54hHYQpIzMzHszezJt6Hk1QmA/s1uZ9aiOk6fhddcrpa9PMHbESo0If\n8nmamhUHFeKYpQQTtF65ztUY3TPziAWNSA+7wSry8Mu4ASOjdaCEFbmrnWvD\nq5eyFypSt6Tb96q0oKBqPLkytvC0v7CrNbVj/QpKqYhF+fBE9Ov5++UblY0f\nPG1M90cQ+TD1bnQsguaoT+ktaGASXPBAgpSZmYaTxHXGEpmKqcOEvaHx4LWG\nW9a0\r\n=3dEv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6b11b48b933746de14be90d79974d10e1fd48289","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.b094eaa4e.0","@material/rtl":"14.0.0-canary.b094eaa4e.0","@material/base":"14.0.0-canary.b094eaa4e.0","@material/shape":"14.0.0-canary.b094eaa4e.0","@material/theme":"14.0.0-canary.b094eaa4e.0","@material/animation":"14.0.0-canary.b094eaa4e.0","@material/elevation":"14.0.0-canary.b094eaa4e.0","@material/typography":"14.0.0-canary.b094eaa4e.0","@material/feature-targeting":"14.0.0-canary.b094eaa4e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.b094eaa4e.0_1642185773119_0.3869996129577704","host":"s3://npm-registry-packages"}},"14.0.0-canary.390220e42.0":{"name":"@material/tooltip","version":"14.0.0-canary.390220e42.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.390220e42.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a1999334c2b5d0c15b0b9934f3b2d0f3d182fd0c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.390220e42.0.tgz","fileCount":34,"integrity":"sha512-2S8a2QQngZqgN/c2cLF4b7ixs5/dv+JTi3lFt5uSLn60tFhQ1Am6Ia6G7xmXFj88voq2eOAUHz9K4zwd3q2Mbg==","signatures":[{"sig":"MEUCIQCrb3gex+0fuJ7lV2Bz/xQhegmAqfq/L01ckr7QR4hl5AIgR2UF+ih2OOtfpBibp4AJ5ZMoUgR5SU156EqAfPeiGFY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5Z10CRA9TVsSAnZWagAA6LUP/j4crr1nbjKOzzrxJRAi\nTgcIE/hekqmFalEeIPwdoJQH6wNk+Hqb4x1AfV29HovOpns62Fz8rGeFiKIO\nGwasTzhD3VLxJlLXdsNJyDMiHmO0sJSmNSv54y0rLbeV+ZmpAw+H897SvyIO\nGYuQOAf2udSX/BWzRjfYRV4ltX8pz7QJIgT8psxa8P/TcOj5RYkuMqYYFF83\ngemkebDZCMT0OyUvWm6nQveR0IalMOSD8qmsj0qOXg4OSFv55+H8bBXDBXwQ\n/6rlsTYIFdyrwi41pVqDeUhuc+dmR42RtL9xo2iKhZcT+UIiXcM45L3C6IzF\nP5mhZb9ExiSFHs3RXB304/F4mIv/tQlm42Qx9x9UJXZMFK7uA03AntXVhYTs\nfD/2sw9N8z4W6byPxkkliAbfaoOSEVS7qqdg/F0TDfK2z4LFviBlpM/Rd4RX\nZA3B/H18CewbhOkl4v5qhx7g1O2GchDplLPATQxrPz1D6qqMojZSfLsfkzV5\nMMnJLPOlY7WyEGSVop3opO0zTuk3D2Apl3PstqeR5zCNnQzkBzlJbToyt6Aj\nqg7kTizWIIDnJ/krgMERKVCQ5k/IlmR50b5GSgJGXbSC4NYhxjTTr5eA/pb1\nEnyI3ovJHoUDb5/YE2PfEjNvqPF+twNgNN1bHCvYEG8cA39UJgRsE4S8WuXT\nXP0/\r\n=ztr3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"dd9f4e499bf257838f40df3957ee3c321500fe37","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.390220e42.0","@material/rtl":"14.0.0-canary.390220e42.0","@material/base":"14.0.0-canary.390220e42.0","@material/shape":"14.0.0-canary.390220e42.0","@material/theme":"14.0.0-canary.390220e42.0","@material/animation":"14.0.0-canary.390220e42.0","@material/elevation":"14.0.0-canary.390220e42.0","@material/typography":"14.0.0-canary.390220e42.0","@material/feature-targeting":"14.0.0-canary.390220e42.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.390220e42.0_1642438004090_0.4456066575364057","host":"s3://npm-registry-packages"}},"14.0.0-canary.4b5391f8b.0":{"name":"@material/tooltip","version":"14.0.0-canary.4b5391f8b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.4b5391f8b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00b8ac97fa5174b07f4c175b5439d8ab4913984f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.4b5391f8b.0.tgz","fileCount":34,"integrity":"sha512-e+rtSYhXHv7zrKBJ0G7PS75oavBBNlxuaHIIMw3uSwvoBC3Ae7BCVL6QRK9rmEryOVgn06NWrKH8/1eni548NA==","signatures":[{"sig":"MEUCIQCGdsXMxezqGd8EdGX+x3WBWQKZcAZAVgz9j08JewvG7AIgFB/BRkWrn/I3P7H9Ph36TdLD25hR9lenmLPU/2PW41I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6KRtCRA9TVsSAnZWagAA8U0P/RD7MRJPC1yO0i++VQus\nYc9PEifaB27u+atdfJ/GNS65uJqttJf4TySkOcVVnPfJd1L87PY7sJoowmUA\nHym6EDlDYu2kJbhDMscwJrFszUyXZhYtrjqKCwibm5qpuFiMGinnlbMhYGkj\nHmOushecn36FQ+25g0VeLJUIM1RZsdeTtLYl6/ubFM3P4G4BEPCnj1cN6ocv\nTMQeNjxG37GiTkIiWlcP1z2VK8i7D8uC3B54qd/0LhDGqWN4H5Dlg7pZUNbQ\nNHkdySifSLtfXJFpSdpg8lmVctdYK1qq0p2apK79mGblRSYnJ6QfJFtAgCMX\nndPqigjlB5y9MRhv5HJz1ETcS3J9VLyLzgVufg0TvXWGZy/66ZOxT0WM0HQP\n8KCvV+uaeVKl2D9yPbp4LqGL0ShAXUSngcIATgceOK/3lNlU2fSDxVsIiozX\npiDAivSYk0PMQNfF8JGIJPJDpw0tZWoQ1QPRlxnVSVKOS9kINk66g4TQv616\n6xeTjh+HOER0DTaIpGeZjMTidgWZutrwDFaaRVF4AnxTAPqToPiFZod6eM1c\nJlnEUI4IFvx4JtZe0dtMW/9rx6mK808BuVpd73ZjoK7+ftmeHL/Qni86VNIi\nS7Lwex0DodouRijwDc0xP2aRALKajjD931Xhh5cfTISWkCRYE8wIogMBPmcZ\nMzfm\r\n=4Mgi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"09410b4524a4005be30dd18c47d4214d6eeffca0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4b5391f8b.0","@material/rtl":"14.0.0-canary.4b5391f8b.0","@material/base":"14.0.0-canary.4b5391f8b.0","@material/shape":"14.0.0-canary.4b5391f8b.0","@material/theme":"14.0.0-canary.4b5391f8b.0","@material/animation":"14.0.0-canary.4b5391f8b.0","@material/elevation":"14.0.0-canary.4b5391f8b.0","@material/typography":"14.0.0-canary.4b5391f8b.0","@material/feature-targeting":"14.0.0-canary.4b5391f8b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.4b5391f8b.0_1642636397422_0.8700174817509725","host":"s3://npm-registry-packages"}},"14.0.0-canary.cef6bc623.0":{"name":"@material/tooltip","version":"14.0.0-canary.cef6bc623.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.cef6bc623.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d8ed6212bb7dc76dc74a5c3bdcb64b0a4175c118","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.cef6bc623.0.tgz","fileCount":34,"integrity":"sha512-65rgV8sn1oOPXNNtAFyouKxA1PsQqJxk+G24rUTuc400h1l5z48bsmz/nket0+DND/LPVMRaf6ZdL+ODgFF5QA==","signatures":[{"sig":"MEUCIQCc1Xt7tGBD82ex3PFkLgE50B2IpREu6vhXgva8c0TbEwIgDd5i46fkFwPqbrN1ALFczgfeVQxdraLPPsc+c+QktvU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6Ko5CRA9TVsSAnZWagAA85cP/0hXaHWZ64olOUEp0YPZ\nUL4ZQW/zIl7rQzVgFV81tm+HhoKYhoewEYqm2kWrp2krNw4Y2QJ8QjPr7W/x\nu4V+rR6rAmewzKJZHPo3EhWJhEzr0SpoFcvyAeUtcGa99n5dRp8MWs3DRV1l\nqp/61zNbskxPWtFTbRMWWGno24UD1sn1QKWbzYPdTjaNwZ8iezY/iVxXoyp7\nA6+BcQ1YHf0IDwhG2Z31bW4Uy4OGx+OuFt4Y011LI+xQVwyeYPzEV2OH55kV\nvMaoBya824wovagDLjrR1WAyIUuIIBJCNwYckOON4IQZV+xtFih0+CkEDuhM\nbyo4qjdpyeBX4yOtD6y4BLY3AfHhNxP26LI4cHq7OhJtggd+ijEUWp0Qt8uw\n7b60D+Au2dCAkks9YuCL8KTm8bAy8csvv783unUVB9AEX9ScADLHwRW327GH\nzE/dhd8xGHchNtdzd1Lva9CKS6NvH3KqfrXU+cUxgxQLzU5roGgIU6nlPYMf\n2qUEq5+14NSpR4xMgp2EvjqUZZ1bIv7K0z49sVT/VI5zSzB2xDGBpEzb0p5g\npIKL2XM2AY/Wb1OmWWwhex5tP3aACLv3FEjcAnE6SqMkkSaoKuLzf0gDPfAJ\nx0qETQ/+thOnI0HAtNxMfmQ7CSvcCcZ2aYTRnLmYWzEod6zFysyE8+RbVyEe\nyzNs\r\n=6b4R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6bfb214d1f6768cd968026313c7de32009b2da1c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cef6bc623.0","@material/rtl":"14.0.0-canary.cef6bc623.0","@material/base":"14.0.0-canary.cef6bc623.0","@material/shape":"14.0.0-canary.cef6bc623.0","@material/theme":"14.0.0-canary.cef6bc623.0","@material/animation":"14.0.0-canary.cef6bc623.0","@material/elevation":"14.0.0-canary.cef6bc623.0","@material/typography":"14.0.0-canary.cef6bc623.0","@material/feature-targeting":"14.0.0-canary.cef6bc623.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.cef6bc623.0_1642637880993_0.061413020913892113","host":"s3://npm-registry-packages"}},"14.0.0-canary.0379179c4.0":{"name":"@material/tooltip","version":"14.0.0-canary.0379179c4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.0379179c4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b7502d707fab77d2d51ece5df9741bd326536b00","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.0379179c4.0.tgz","fileCount":34,"integrity":"sha512-lWJdg897DnnZVshWQOlufDXRGlCAzRbVbDlkBKKrklrqJ753oxRejIONTpIbsHLnvZ7fDRhZ5iPcTBMNLRk11w==","signatures":[{"sig":"MEQCIFE/l3UWRXn3Z6spdcQjYwTYGFLbysutxqPJiGE1K5hTAiBkzCzBQ0ABcfR7/zX7Pb5mJohp2+mSiw2TfvB7v8EMtg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6a/+CRA9TVsSAnZWagAAL4AP/0raJo1kKQDOfgOeNEFU\n3bKNXDlg+saUSikn7tw6t+DYMFiSav0xrlfBO/PxEjhZbonGQVe+EljR6hKh\nY/L5H2ujXUg69kjEOaUvenoKNAjDEXJYYFR1xkxyleajUESGwyGDSuv4WKNg\npmm2dTLRHETnl03ziEFtygcYOyqKSc3PabSS09pAH8ds9bul3mruTosxMSPw\nCcINSyUwdGUCyiMIX60Z0z+DqRmj2JhlxIsuphYr3N9pmCYChQjtbLT+Saua\nMikfiAKC0b8NdASYIuRMnH9YnGx508aymWSQlMo+2uX1OyTrgCVGe6AX3DYt\nJCFUvPvVEk0voupaQ2hWbDAOYw5De95me/98Od19oHZBeJJr+zsrkIrbTPDC\nHfjqEhPJ5bKgMItWEXEKWeOtN6UUYr2mqmEHaK2EOsXmr8E1G2kK5AGyBApw\n8T4JFddaTsSF1h86vObvDndsMoX1vy74MhMp60VdNmAhsdq1yAzt/6+KRG3T\n77mBpNQkksDMsduRj/XXhJl1RFF8Q84C7uLBmiYMhpu0Jw5Uiy2KmzqhTT7c\nwuT7bWc4UElauQXGVy/Io17SZuQEkXa7vkFKZvs+SNhr+4ROTCkwFgCv+A/t\nRncHqv5rExmG/3lEw/+2R+X9wI+aL7r3+sYgVyw/UmHqvfLmx80iIT0dDOo9\nDLGK\r\n=/K3z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"fd62b4e352900f807c8308b282906b51227baeac","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.0379179c4.0","@material/rtl":"14.0.0-canary.0379179c4.0","@material/base":"14.0.0-canary.0379179c4.0","@material/shape":"14.0.0-canary.0379179c4.0","@material/theme":"14.0.0-canary.0379179c4.0","@material/animation":"14.0.0-canary.0379179c4.0","@material/elevation":"14.0.0-canary.0379179c4.0","@material/typography":"14.0.0-canary.0379179c4.0","@material/feature-targeting":"14.0.0-canary.0379179c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.0379179c4.0_1642704894295_0.7010994670308217","host":"s3://npm-registry-packages"}},"14.0.0-canary.e62f3dabf.0":{"name":"@material/tooltip","version":"14.0.0-canary.e62f3dabf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.e62f3dabf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1f74b1f00a45f88bfaafb6c6173561cd0db13085","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.e62f3dabf.0.tgz","fileCount":34,"integrity":"sha512-d5ftg1sGNEaLFhs9wOswWq4+JmhvOz9KmZrpkGHpbc/QDCv9tdsZatGvzv45wIiOzngI+mdbrKJhUhSle5mwrg==","signatures":[{"sig":"MEUCIEGWtvy0BKrWuw5hlrGdMXQ6t5h7Ig//FCanVr0Kiy5GAiEA317/eiE5e/FP25nmHZfHik4sYi925FzWhfchBysFrsY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6zvaCRA9TVsSAnZWagAANrEP/01qpBm61zw9lIhd7yV1\nCCgbm/zumLaoEKsIn0CRbyO7YLo2diicsNJWauihIbf3DAyVETa7TogdSO4L\n7BG+DbBTcgfXiVQWUKbT/+22kYY9me+0ZmZo9V5+4egYCK+Cj6NiAGjPtIIh\nycsfnVeXA61dF8Q83tNkbjrR9W1tlbwPP8F89vCDzaDze1H6p+rMJyAn4OX1\nqk7/ZG5BA+81OQKzoBkEwarIy16twTydVGQK8gJm64Nzf0elX7BLndI+yd/T\n1mP8s5f/QvbN2jPz0OFzmcgqyn1MTyw5d6OEFcHP4M517l/WlQCMw8uzKl7O\njxJSrap3FW37mFxo2S1oV1KnXnz6VRjNBLDzyEcnMZLcwouWW/MXPWWKH8M/\nNPTEJ5lGIsx4fok1j74p2k9R7NQ6EJNKcuuf9ETstyXLkjJmZrwITg2yF1zY\nQrihFNiiylx9YYwbG8679R6tmhDZK5Fp/I7n5Sp1Tlsn2D6a5oCQqVMnjEuW\neKVxEPYm2mKjmCqImgaqRh91KbAXKscSM2Z1l5UzCcnNH5a9zHZ5Dzim2jzk\nJDz1+gfvk2wUOVzANQ7DCbDIZ9eyUz9pFpik9nkIrN4xWwzDuD3aVEDk1c9m\nYLtpfxBd6ECicmczzblKl5o+HQ2UrMtWvlvYEZTzb6pKH3yo5oHBwmmK7Y0R\nxvk3\r\n=SZ2F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7f7d12458af5eaac6bd913db605b5afc3753906d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e62f3dabf.0","@material/rtl":"14.0.0-canary.e62f3dabf.0","@material/base":"14.0.0-canary.e62f3dabf.0","@material/shape":"14.0.0-canary.e62f3dabf.0","@material/theme":"14.0.0-canary.e62f3dabf.0","@material/animation":"14.0.0-canary.e62f3dabf.0","@material/elevation":"14.0.0-canary.e62f3dabf.0","@material/typography":"14.0.0-canary.e62f3dabf.0","@material/feature-targeting":"14.0.0-canary.e62f3dabf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.e62f3dabf.0_1642806233896_0.8962639371233663","host":"s3://npm-registry-packages"}},"14.0.0-canary.3e20c1de8.0":{"name":"@material/tooltip","version":"14.0.0-canary.3e20c1de8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.3e20c1de8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ec588b5c7975663b78d5ee57654088b6cf2d8fc1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.3e20c1de8.0.tgz","fileCount":34,"integrity":"sha512-Q6fWytWv6aJK3hGy/nPCGH2Kp5vUB7HA4Uy9mVqOuTIDmXzLVBre4HIH6MU+zbEKu+sip6bk4atZVewj/ZF7sA==","signatures":[{"sig":"MEUCIEO1eodxbdq+Ud2Z+8+lS7SwxtWDkHI3k4PnctD45MshAiEAti+t2Wd9S2xJimUs75OltHmTFIQJG681qEcCXRxgHLc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8BgNCRA9TVsSAnZWagAAw4sP/2OcDo/oASNFvmyR8hnH\nVSFWViJMfsJQAPDlmqXHyo+OGg2nghHq6ucUPJrcsZhNOfskDTw22DSGRSoy\nm9oWqyltajCgyNR9ZOtJYcvh1fAtpWxvjbjQ/IKuQ5fsV2AEl0M0a2rLTAGo\nMQrCRvYmPSOoT1cwUbY9WrsTCZvZ/zsD270yZO5yvy5DdQx7kqp63UA5zUhY\no7n++diufaJLNSXfxXKinTHeVbWmXCteqrgHYKIeSWURHBwkkoQEL34j6xl5\niEtf4B4hDx6zaY9LrFwkq4I9aaAtpLqapedZ0GIjdI3wmwAydMz0ivNvrrE7\nffEhyIxQqrA5rJoFIdtBkkGIZkP+JKOoYiswtz4BsJww/jwUrDmvs5jYEv6H\n7wDPZa4xHblPhgE0z9aOXDBDeZLazH8f661Kr/QbjfWwh9LMhl31AfwLBjKJ\nHxmOcteg1181x1kREjY5XbJnw3ErmeI4eFcbPhfopo88om9q2qw8ciIk7MNh\nG4ECTwA0Lbf2UHUEN3J0WKNRslzvF8WPswqTPMrcCew5CKxdQvhgEKsbdumL\nedfdAMUG7eUy46XVl/xvxlmDxMT0WP/p2W1uDcfgbYVCtAk7ZWlaUFdX7neE\nv0JUlfbtJE6KKCFNeIDWlkQMSdjuQn03rFmkhvTXPaSKy8P9ZecSn5iYDqua\nvFaj\r\n=ECBe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"29fe61f3aef5a85c7a462638b6c2b809a3be57c3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3e20c1de8.0","@material/rtl":"14.0.0-canary.3e20c1de8.0","@material/base":"14.0.0-canary.3e20c1de8.0","@material/shape":"14.0.0-canary.3e20c1de8.0","@material/theme":"14.0.0-canary.3e20c1de8.0","@material/animation":"14.0.0-canary.3e20c1de8.0","@material/elevation":"14.0.0-canary.3e20c1de8.0","@material/typography":"14.0.0-canary.3e20c1de8.0","@material/feature-targeting":"14.0.0-canary.3e20c1de8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.3e20c1de8.0_1643124749114_0.3324944350683139","host":"s3://npm-registry-packages"}},"14.0.0-canary.9f9d928b2.0":{"name":"@material/tooltip","version":"14.0.0-canary.9f9d928b2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.9f9d928b2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3d9496d634f1a75392ad6615ac5e9fa045bc6c3a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.9f9d928b2.0.tgz","fileCount":34,"integrity":"sha512-WedsLTW0x9eqnXOWVF5bSeq3W1IAKExXXVU3WcnVUgliqeqS35NOcWbknYkb6oGKWxPHD1rK8dcxU8U51rXBVg==","signatures":[{"sig":"MEUCIQCduzK//kDIgJB2LdytTdqo1L9Io1aawr/AbEZ7HNWaIgIgb0p0+q36WuLTgvq/bKU3J+n/Em8U/QHVb8WZYVmG0t8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8uDWCRA9TVsSAnZWagAAl0YQAIpt0seMJmUK/ASvHrhX\nRMy5QxBaqwbFcADByn6TDaz2/cDUzNiWJehN1B8j1aGrOWcHOLfp5fC7/0vb\nah5H1bwU+Vci+r/UEtNK3JelfaU99JWtAvqezWUbcKXevZWk3+Kn0CX3cTee\nva9jyjs20lrg0VST9RX5/VToULudZFh8hO/lL/xGx0OnIMW+43Iw5gML4tf6\nQNUVsM9n6rB68aW3R2o94lq7+LVeMZ2qy8NPZoFqx0hmAxjp8iYXn/pomfBT\nyCkDTNC0ULZ6kHNB9hEwNI26Ysl2K74fvZhEClIYA3yfB60cdZCPqHyuBV6w\nI2MPgy+6ut2hzfLSt/S2Gj8rDgaDMe2mSkkR2sylITUXrsQaTHxI5Nbid/Wm\nn9lLvGLkvZAsqUipTuTap2lpZz2utJuCxDXmpVJxglIIqTcQtarkv3SCiLOA\nT93SmmUncEPSokM7UimnY9Veqh/T7AVyOQEZGvdvo++ltPrwvUasjvl1I+6l\nTIsT4N3U+KtMOu++mWcehNvL6VhzbpTbGGASp1aoV/f3kyXHFBDLpNWOmKgk\nt5ij+rXzCN0NPR8hP3sqpsfHhNw9eZXGmD8MGIH5+BOxGaZFoDGooxEkwfLw\np+r5isCVUjJdrA81Ww2pREWyfkTBHfqY4Y7tUY4ShHjeE8gqcMvCoJ20it/7\nnBb/\r\n=lDSc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2983c7f2f01e1912809d6004e47ff0c7c27de38b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.9f9d928b2.0","@material/rtl":"14.0.0-canary.9f9d928b2.0","@material/base":"14.0.0-canary.9f9d928b2.0","@material/shape":"14.0.0-canary.9f9d928b2.0","@material/theme":"14.0.0-canary.9f9d928b2.0","@material/animation":"14.0.0-canary.9f9d928b2.0","@material/elevation":"14.0.0-canary.9f9d928b2.0","@material/typography":"14.0.0-canary.9f9d928b2.0","@material/feature-targeting":"14.0.0-canary.9f9d928b2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.9f9d928b2.0_1643307221978_0.964676195103001","host":"s3://npm-registry-packages"}},"14.0.0-canary.a2bcb065c.0":{"name":"@material/tooltip","version":"14.0.0-canary.a2bcb065c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.a2bcb065c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebb729a2e60e330d45502f3ebf15b4437828b2b8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.a2bcb065c.0.tgz","fileCount":34,"integrity":"sha512-JwJ45kZ9k+ExoiDxENKbPzSnFSvdiF3mkNTU/bWrC6NhzIUZ6HJEJMNMrRZWt8njOKC9lk8HXzdRZS0gJprvfg==","signatures":[{"sig":"MEUCIQCRHb/4u9GKT0Y6UCp3bZ7qpt/jqvEljQZ7k3dtSEgWegIgM+2QbyVAJYOQdRBC2o+PjnU62c7+HTJE1nRA4YkRQPk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9EX/CRA9TVsSAnZWagAAHWcP/2EDokqMgmoay7gHbjG/\nLrdZrF2zBvG4GZsOe6StcyxZTtxlMSKZxEBK9ygIo/wRaPTt0cGpmbk/uspp\nnC426CesVRLTZaoOzwyX62exmwM5Q27eEQ5nj0I117jTh2mFAiDy9oP8W9v2\nUxev8HbarjKLb6dRc+QzFFukSvvXgncZk2Vo9yJFNubiVd2O9QajbzKkgV2D\n/J5Nr3YleCma4IWJ0LbBP97vFvkzMPFheCwuMZOZTfxxHoT72GD7bSfgK0lu\nCJL5mTv1XuTIhHhnjgXpilPqEUR8tJaDU1S7B8biyJiP6kCwiO9Hkl1hV1DU\nCF3hVCqmhKGB7ZLZlKiwSymXUw2/ChLL0KE0e00J+FybOm9z9V4DFlprT9uO\nSrWGvIWBANDyXh+zm64M9yZWaK+JN9xDvQAOvxJOCwj6H0gD/f13l6ie2oMj\n+GHuooXidVpmPL2hknEP6t1PAalNC88yhpHz1dvtVMyY3xHZx/HIG1tht9dX\nCLhebxo7UF4HfaqZTVMkvYboisW4KdJKjJSzXecDVWTZnZBFWRvHg5NhdeFL\nHle42dm4277weRq2LCFaak1Xf+ncyFn6bHpO5oY3udcLSWXWcAudA8XWyHwO\nsWL9Y6/4cqIyFufVJaqnaIkD2WjKN/MuRQnzpzQT/FqpKpdCP5ztUsz21EiC\nqx/S\r\n=s0jZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7f175ca37545bf0bacc2b94f7a18a2a3fbd5eec5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.a2bcb065c.0","@material/rtl":"14.0.0-canary.a2bcb065c.0","@material/base":"14.0.0-canary.a2bcb065c.0","@material/shape":"14.0.0-canary.a2bcb065c.0","@material/theme":"14.0.0-canary.a2bcb065c.0","@material/animation":"14.0.0-canary.a2bcb065c.0","@material/elevation":"14.0.0-canary.a2bcb065c.0","@material/typography":"14.0.0-canary.a2bcb065c.0","@material/feature-targeting":"14.0.0-canary.a2bcb065c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.a2bcb065c.0_1643398655705_0.6984937287619948","host":"s3://npm-registry-packages"}},"14.0.0-canary.4e66fb2e1.0":{"name":"@material/tooltip","version":"14.0.0-canary.4e66fb2e1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.4e66fb2e1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"afa7e6970d761dbca29c3d59c71e24f2ad3f9bcd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.4e66fb2e1.0.tgz","fileCount":34,"integrity":"sha512-yh8cDZEEaS0Pq6ALowTt+VWQ50+dZ4D/fXCSQEidpvYTkWtIEI8/2yjUvhj8fAm5fw1i630L9jkTsDWOAe9nBw==","signatures":[{"sig":"MEUCIQCcxd5BaBBFukH2bt3JE9SS0zXkVTP1iW5cV75M68IAzAIgWFPXHVTdUwQRKksgCKDEKrgmNPJn9aXHAB4oCKemMqQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9EcDCRA9TVsSAnZWagAAm0cP/ixzbX+vNcs3Xmq6tWvi\nvWVcwvd1GKaMbW5mZuZCN8+Q7twBcpWirrqCoOGVhxA+yL+/1nV4Iz5kYadi\nbQeLSK+aD120LS33pOQ41U4fDoEIxpzyxgEixkl0M446O31pcVVihzIvHQoC\n0TsLTj7Qny/qb8xuLObmpWEJkILZbxtpUoVYhf7H6bCdqz2rSLXgVQ5UrXwq\npMvmZn3p7QvgQk+Wu1zzEN9fXQSbAcDLK1JftgXkqUtiQitxe+hphN1DcOkn\nayAk2yt239AR9/YzurfW9hJP707GGBTrgdD9ujSjIsb80KIqkEpjySMGkkYG\nzNFuYYmB8RQmcuIxNFWnlkyrDsmelptF2jLVge5Qkj/jOKkWLjgPSfgWWhxN\nRTb26f9cHVUtejhfYNYhvnvH55wqJrH5GB6Gk/yaThXDm4Ul29O1FjBvycRV\n8s4fBEnza7LWxP3zIuSc66k6wtkcB08FHT14eIA2c3gg5+BoA6UfbnA5ItcD\nOwO1UgT0ZoZtE+E1uhjkobfEPTrASqGnb6zK0WIUaZAdcS/0TE3ucp++uAs4\nMAuRDwIGgOlovZydYYxJ2Gw3UsKdmG8gaQ255bZBsesZelF6kjloo9cWoW41\nh6BSj9CEy8c2I/leQyqzoNy6OVnCvpbPldHgaojPndtfUu5GFGMWv5q15dYU\nrKid\r\n=KQCH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"edee6a64c210815507bd8460fea3df2591cf0d65","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4e66fb2e1.0","@material/rtl":"14.0.0-canary.4e66fb2e1.0","@material/base":"14.0.0-canary.4e66fb2e1.0","@material/shape":"14.0.0-canary.4e66fb2e1.0","@material/theme":"14.0.0-canary.4e66fb2e1.0","@material/animation":"14.0.0-canary.4e66fb2e1.0","@material/elevation":"14.0.0-canary.4e66fb2e1.0","@material/typography":"14.0.0-canary.4e66fb2e1.0","@material/feature-targeting":"14.0.0-canary.4e66fb2e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.4e66fb2e1.0_1643398915226_0.7378920126951416","host":"s3://npm-registry-packages"}},"14.0.0-canary.9736ddce9.0":{"name":"@material/tooltip","version":"14.0.0-canary.9736ddce9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.9736ddce9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"59e5080c6f0599cc787c150d0851cc765b25689e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.9736ddce9.0.tgz","fileCount":34,"integrity":"sha512-EE9CzmIq9TJDUEaSpDFr9OYe4ZWMxamgp5qwyXjdXnMZS4Icqxo7fReygC9zoskWfwb9Y4k3s/8ks1weNZ+nXw==","signatures":[{"sig":"MEYCIQDZ+yZ4Rm6Ea3F7o4944Px/sSboQlpIlzdRvdEifBIOaQIhAIhHwZhe9V06Cg4Fe3M0EMg+suiHFue5jmEOa1nuGkcM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9Q3hCRA9TVsSAnZWagAAMz4P/3Wvaj4rzB0TvXK852gm\ndgoz6vB2tWQg9FAOobYnN+LRdV/tdtFisgCIhg+KyPGkdTjWd45PeTKfygCD\nrTP87hrqWY5D6Bw2enbZKxcRZgJUlggFNTDSffGnQSiccqAAqW7eiOlX6z2u\nl41L4e1DQNJrVL55mBNRM4KSx32djMyObmOHP6MlrqoBk+4IpWI395qbepQ8\nj0xfkwxWyCgi5B+TnPRxTavIfIb55IrCLXrxf5pc00iZ0BAT5GcQcYfK6jks\nT72dJ7Q2Oam7m01ZYQEz81l9x96caNHdZitK5Y+oPNyMOlAXCxJVY5faJ7Ps\nK5J7zZgpQ021Q/wPw7pS1198bUm9laXtnoG/Z5XArfYfrh149uIHMjAE9CU0\n6IIfBjJZpE+WfvJAOWsF5uRWRj58b1AtGor0QW3ux4yuKMD1EShpRoYbo3dn\n0xUXx5IQgUcXFtA/+Zosr5sm562GzlJN3PNGGy3RG9yK//kAriyCYp+d2H/o\npw7hDnWxTnhhK2BW3hj3/0BfgU4SxKoRQF4pSW+925TR6hU3lKcxRccCtqCR\nKecoIqgwom1daN6ut4K+MU6PTVs/TmWmiflnCgV+4tdt4LjUvcD+1TYw52Jy\nRSBKkkcYlZ/61Qa6vhbhAqxmw/gj47QKiNAwniSaIi+ED44/Tb62k3CV/cOC\nxKau\r\n=me3P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d76de36ce796a981bf5e48388104bdb581d17529","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.9736ddce9.0","@material/rtl":"14.0.0-canary.9736ddce9.0","@material/base":"14.0.0-canary.9736ddce9.0","@material/shape":"14.0.0-canary.9736ddce9.0","@material/theme":"14.0.0-canary.9736ddce9.0","@material/animation":"14.0.0-canary.9736ddce9.0","@material/elevation":"14.0.0-canary.9736ddce9.0","@material/typography":"14.0.0-canary.9736ddce9.0","@material/feature-targeting":"14.0.0-canary.9736ddce9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.9736ddce9.0_1643449825009_0.5312014803137235","host":"s3://npm-registry-packages"}},"14.0.0-canary.cc4ed13cc.0":{"name":"@material/tooltip","version":"14.0.0-canary.cc4ed13cc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.cc4ed13cc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c247acb4e1eb03cd157a9858969629f0b48fe5da","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.cc4ed13cc.0.tgz","fileCount":34,"integrity":"sha512-8myI4zv0qXhbyKneFDgjwJcN49VqkAQiX6tfV1Jcurqe0mmiQCNUaPk1cY1MGCePdKQD/j4Yh4FA6kcE6vfMxA==","signatures":[{"sig":"MEYCIQCMydm74iuJkkYmGM5FA9YZKKx7i74dhkaEgRenRBnYrQIhAMru+jrl8BJ2l+zuAFc+3RKPyC4cC6NL1GLEionU1yRB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/W8UCRA9TVsSAnZWagAATisP/0tQj8rGzEcmlxpk7TMM\nnRktsfG0SAVHHFrfcph5i0asfbReLL4ZiwPi/LozEUPX2Eif2Cybs/xQVJ1C\ntt+PboBxTb3UqnS/Y4LKtF8ZNXkjjPwNXtqYvJzmfM8+44v26EOHReytznpy\nshXa3BTyBZ+3O66Y8TgOIeCM4U7wg+54YVMOB8ojF/nZUMl72Z7wvDAAHXsV\nKJECF+J+21xAuOZiOtYPATKsqW77JOz+Di2a6Q7KjOULw5tw1xbxlaHm8+Dh\nt2bBYGY7AIO4D1CwpVr7KVzla79q4YKb6K0ySIkU60O3H/JR211rOOnIJnMh\nsZ2SWoioW9z871aVpdt6wxNLZL9cOj7sXH2PbAyTP0B2mI51/z9kdQ3+3u9o\ntUWOatIYFDXp1X2DdOJGdwAw0ZC0mb0cCJlhOoRGgi2agRW6lI8TDozCIggV\nZCZiatnsrPBPSeCAhHW8u+E7zZAVNT/YS3FqnmmIjY+vBvY4NYomDn0vY/Da\nS5tutr1mAiC84yE5bcoiDie93Ul43PmurNw6m5zw61j5vTNfSl/I62YRY8ru\nWg0kMJr2YkLm5jvVmP7aHhcHkV7MlyGHzxbNn7QmjuO/5lK7wBt5qH0aFbCW\njRiOjG6d+4jOTlJA2QC/sHlKdv7kuwiuOVqDOeY7QUllAXLhGWy03echCW0n\nu14t\r\n=yIl8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"15c769412cb0230363c372a7d45bc6bc10eff8e7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cc4ed13cc.0","@material/rtl":"14.0.0-canary.cc4ed13cc.0","@material/base":"14.0.0-canary.cc4ed13cc.0","@material/shape":"14.0.0-canary.cc4ed13cc.0","@material/theme":"14.0.0-canary.cc4ed13cc.0","@material/animation":"14.0.0-canary.cc4ed13cc.0","@material/elevation":"14.0.0-canary.cc4ed13cc.0","@material/typography":"14.0.0-canary.cc4ed13cc.0","@material/feature-targeting":"14.0.0-canary.cc4ed13cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.cc4ed13cc.0_1643998996011_0.0511791151362182","host":"s3://npm-registry-packages"}},"14.0.0-canary.dcba26fe1.0":{"name":"@material/tooltip","version":"14.0.0-canary.dcba26fe1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.dcba26fe1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e49e61a413b1e9238e3dd6473c78e6104930f09d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.dcba26fe1.0.tgz","fileCount":34,"integrity":"sha512-sg+CxShkWJEJznG5zjPhBvrD5YdYwCV8SZ3psDDFFP7KlXOhtixOvH9t26CRDCUXFDno1xbqStlwSKQCVq5pnQ==","signatures":[{"sig":"MEQCIHIndcpDUTfyqe5h3RxUcPvimDqLXyWy5R74xtQq0rDzAiBJIFvujVdeddztFkil4++JzSWnTDK+kYA/dZ9BKxpOAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/aFYCRA9TVsSAnZWagAAqsIP/0sLppmt6OpVSJJNS+Yv\nW3e7kW9Erchhbn1beSM56YTtQUDduJo3JjzT6oZ4dHxcr1z0z7S95V9Y+8iE\nS1VN8ESMjRqt2+HVTJHG9OvnLYt9wdUJRI96DT+2VJaJUw2N1oIdy4uDiayA\nqW4ZKznM9PbN5LpQehDmAkMIEwur6Ao8XcaD97RNzDQYi2vNk3qVih2tvLjB\nvKSkGjNaRGLGJwdPEr7UAQC76qIxiIUILJFumDMKnlxfOAv2IEOEXEf3wgfq\nyktukqQmnSZTiYmGZFeodSxra8lLV5VAEAmIoJWyRwjz1+o1lBRgErYZty9e\nh1zXL5bXVIAJ7v48ySMsAYuEHnEQwxmNZrz22CcxzXrCcz5VkUxJ+OxWD3g4\n5M55Hb24P42bYeiMo2JivaQrG4eOuWH9cT4V/lTapFp/pLidYSamqrpONqoI\n6cf8ePO/Np7BEa8uSb8pB/oHDTfv7ISJFPIAz5b1yp4xO4Sa1iP/KiCncMlv\nyhJqx1wxmZ0T9OnEuvt/jpT5fnLkTX9DUgRg4Mn5yDCemCrmF4wB1is0Mm9t\n8Sz7WURfJFAD84sKeiOr8okyaoVFDiVVkLlesUkMYRBGQHg3jjLUFeFcFaUh\nLZIMmrfnUo3lDQAh9S1C9t1I76Paky/cIPIlvtXAvRjU63vKHXgKuoCAyKpD\n4rmY\r\n=d7I4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ced7dd56d5d3b017288f0575d6e773c03f01d0ef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.dcba26fe1.0","@material/rtl":"14.0.0-canary.dcba26fe1.0","@material/base":"14.0.0-canary.dcba26fe1.0","@material/shape":"14.0.0-canary.dcba26fe1.0","@material/theme":"14.0.0-canary.dcba26fe1.0","@material/animation":"14.0.0-canary.dcba26fe1.0","@material/elevation":"14.0.0-canary.dcba26fe1.0","@material/typography":"14.0.0-canary.dcba26fe1.0","@material/feature-targeting":"14.0.0-canary.dcba26fe1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.dcba26fe1.0_1644011864382_0.6221989233272036","host":"s3://npm-registry-packages"}},"14.0.0-canary.ec54d9046.0":{"name":"@material/tooltip","version":"14.0.0-canary.ec54d9046.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.ec54d9046.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7b4eb46bc749360e4062daa4410c3cadb68a6793","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.ec54d9046.0.tgz","fileCount":34,"integrity":"sha512-sMMIW+D2n4+vz0wG7+6fYWytfygarTRJoQ5Nib+Q3fMhkqAMn4PybmzU3xFp760GRawPHopuhQ9oTqByxK73Kw==","signatures":[{"sig":"MEYCIQD8zH9SkShpYgMJdPQASOVjTlpWHdTrOaW4QmdDZDa2awIhAI7Fg6+9jPphhrWu9mprDCwFuK3azmISGtV50ruYPZKz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAT8GCRA9TVsSAnZWagAAu0cP/RrsDqQMc/yPkjf1GXOz\nMjdDLUyDA/aGRM+KYVFoKdnnJlVm832HAaLSaJytFy/6ApQ8TjlxtAuRei0n\nTGldeWswfFbkmj58Hn9VlEYt/70Yid5rGkBGjRoEHg/EEmhGX4VtVub9Zjju\nvB+0crVJcsyf+h7nOY2ceZS/jtBf+b2HKzsd2SiGjtDE7Yfly2D7Oq9OH7Kw\nKqAgrwzpdTj/XXg3AwflKmiqm9+OvFRwDOH11B1pQ9VWVHhZwfAjHlp6rw/W\ngX7DivOnbeRZXX36ZIK/NaMVbVYDP8BPo53LQBGH4X0CBBMpJcMOgMkBz2Or\nDau2ayrdaCeSi/XpUMB1f74YkuyIEWFRPnN9p9DaLc51Nywk+c/FvsoFBQ84\nMdUaH4h+zXTb9ekQCXNsoisvHKPqt9Sn7xdDIt3km4LxuwZ9zaqJoLUZ6dxC\nRQ+oXPE2a5EMZudfmBb3APB/QDomh0SccrhXTuNg5GjBUES7L8tvhkFl/8kK\noTWKWjFl+WOjt6iCXRYrpICg5BbyaOqa3KqIyK77El/sR9l81qHWBxV6z1Ka\ndwx+ZPPRBKYaPnfhWMoR+ecAW8g+ME9pG5vC3E5Doqe18iKQsvAMnsTeH5iw\noWGDmCzAZt3u/vIAUUCmKiO5gEQAm0D5g67gqPk/mkaQXtcUCexAG6Pt7KJP\n+fiq\r\n=hLOg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"68f6bb151595e8790d7092842d6c137ef93ed770","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ec54d9046.0","@material/rtl":"14.0.0-canary.ec54d9046.0","@material/base":"14.0.0-canary.ec54d9046.0","@material/shape":"14.0.0-canary.ec54d9046.0","@material/theme":"14.0.0-canary.ec54d9046.0","@material/animation":"14.0.0-canary.ec54d9046.0","@material/elevation":"14.0.0-canary.ec54d9046.0","@material/typography":"14.0.0-canary.ec54d9046.0","@material/feature-targeting":"14.0.0-canary.ec54d9046.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.ec54d9046.0_1644248838135_0.941344948497921","host":"s3://npm-registry-packages"}},"14.0.0-canary.ea9b5b463.0":{"name":"@material/tooltip","version":"14.0.0-canary.ea9b5b463.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.ea9b5b463.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3062a5b204b015b884433c64cd2e3df7d3c4b50b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.ea9b5b463.0.tgz","fileCount":34,"integrity":"sha512-QoJxQ4LM+oK4KhkMSUpcfVb0eehMxja7Z0s9OzR1uFm1yL4PBawDIoZC+rQL0NCML5aEfWqF4UQSxj1/Zq/oDQ==","signatures":[{"sig":"MEUCIQDlkklxznPspzioKAm3q5EC6H6vtvrYhSlKulfPhelHVAIgBvpQxSJFHuzn/nDePwO8wqQD9xfGgUj6HoSQEMOQ+to=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA//GCRA9TVsSAnZWagAACLIP/jfGlPFf71qXdaGnHKhF\n4Pab8NKMpq69IBwRKQXbZobFDp4P4Ccuyy8dMuSuUOHiTmSkwbJZB2/rUaCi\nsXDASEMyxpaZHBhF1WpD/UtrChysJxBJsxFU5eCkjRREljHD7LvLgGZvHLxW\n7Kj9VL0cL1/jJPmvb285uPvkXTUrQ/ieZWT5dGmYTQW0A/3PFXp2SZ1jRR88\nz+SDMUPtjmNm1bODWvKOpyJA2CGlKQAd4N18js+WNzLDvukUW5bNYpqurKk/\nBRH64VlF81kTa+af/ovmyH5jWmqWg7PMJib8O5o40Z7aJdXi9V5zGUk5Jc8W\nJH7k2aKobAuFCtZ0y3W7ICwyYj6Mv/XlKaJDfOX/C++5tcB3N/ATZtnoY31P\nMEEKx89Ahm5kLMOtY7LInDE/uHApzSlu4c1e+8e/tGbY7r6P/a45tndDAQ50\no5Qu/9VMFsZTXz/lBDrl0xvabzlh/PKonfpNqzf8YdWHlNGg/USbykgwhrwH\nUrn+mJEkMesII2fByoliI+L7qTcBH2cbMc7/pV6O4U8Cappq46U7KHUTwDlY\nLgo8dVwRg3QcpNObOG890emm7yxosoKFbAyMwLsoUuO1RWPjV0AsRI1eXu4D\n8xv2EvEyNKB9q0RLwyUfC9G9VSTvjPbcCjqj0VwftPgM1LNkGFTxOoxUB0P4\nE/0l\r\n=Q1B9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ee827dceb9fd1c47516461b8ddc28b66702f2c04","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ea9b5b463.0","@material/rtl":"14.0.0-canary.ea9b5b463.0","@material/base":"14.0.0-canary.ea9b5b463.0","@material/shape":"14.0.0-canary.ea9b5b463.0","@material/theme":"14.0.0-canary.ea9b5b463.0","@material/animation":"14.0.0-canary.ea9b5b463.0","@material/elevation":"14.0.0-canary.ea9b5b463.0","@material/typography":"14.0.0-canary.ea9b5b463.0","@material/feature-targeting":"14.0.0-canary.ea9b5b463.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.ea9b5b463.0_1644429254787_0.18513480555151962","host":"s3://npm-registry-packages"}},"14.0.0-canary.96ea061c1.0":{"name":"@material/tooltip","version":"14.0.0-canary.96ea061c1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.96ea061c1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bf2a4f0cdba9dc2cc2645281f5844eb8e7b1bd11","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.96ea061c1.0.tgz","fileCount":34,"integrity":"sha512-L97cBOsY1kHzwod9tzVKsLxLH2uikjRIKyUPVm7Q2cbXNruIoXnLAUSQDetb0CJ2Muwva3rMBzCty00+WqsFrg==","signatures":[{"sig":"MEYCIQCrT/FYWhr1gvj2Cnu+UqglYSRkzHjcodhs9kCs6Mv20AIhAKahpmO2TyXjK553Gw19MfGqkSSneovtBrGzTavjrniy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBA8JCRA9TVsSAnZWagAA/QMP/1bhDpMpmf9ZGHwGo3JZ\njEqluAv/B9A+FPCx6aJFhwxtaDacKK879BhFC+6CpX9i+gKK9ddC8QvkwIWe\nywbYpLJXbr5Y+xiy0wSzZzE1xMUdBhIX5sWddP9P4SWQSFTrXc7Bs4MWeU65\nI4XbKkPk85KncQbdiDLoV26AQ+S8gVGhlKak44Iq9n+f4rtxGfVRr7hurID0\nawV3cIcksvyUVL7vTk0c4tNqm9WbCSFzwTTpmJONgmtl7VzLp/BpcFxWtzmA\n6alDmSRmF5j5n3LnZ6DMT4y0nSas01cWGbjNTpfIq21N2U9l6CidSSmw2ckg\n67xDhafumM79QdvSD4W1Gsju+CkiUuWQFdo9ms64lFYH+pyA6+9KnejyvTuO\n25IrIpPHpV0R6hVtyzfnNIydx0Npm4nhjgM4dOXiK0c3oWAksNgXRxi7s92s\nH1Th0Vcf6EQqcerQfUqLvXNlycjn1jMXP49OeNssuH0dN9SpmEG6/r5vkBX4\nn6Ln1YilqwFsztKqD32K1gcgNT4fqPgK+Oxm6xD4hhkVcP6T1yQsf/7H0WNG\n4xRvdPldlaEwWq0ERu1Ax7gUudxAsT2YchnCHBZsy+kFc5OzgB5qRG56YXnD\nq5ztizxACrswL0OhEf8I2GUMXaQ4CnrgTdg9CvLh+Z621X51lhg+BIQKKUIe\nfTmC\r\n=4eIn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b1a410c21f8ac6405b364e437b5af7eec06a2020","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.18.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.18.3","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.96ea061c1.0","@material/rtl":"14.0.0-canary.96ea061c1.0","@material/base":"14.0.0-canary.96ea061c1.0","@material/shape":"14.0.0-canary.96ea061c1.0","@material/theme":"14.0.0-canary.96ea061c1.0","@material/animation":"14.0.0-canary.96ea061c1.0","@material/elevation":"14.0.0-canary.96ea061c1.0","@material/typography":"14.0.0-canary.96ea061c1.0","@material/feature-targeting":"14.0.0-canary.96ea061c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.96ea061c1.0_1644433161049_0.7494125426265932","host":"s3://npm-registry-packages"}},"14.0.0-canary.e00181e59.0":{"name":"@material/tooltip","version":"14.0.0-canary.e00181e59.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.e00181e59.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ba806c6a19fc6fda9e51c515b7301bcfbb37125","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.e00181e59.0.tgz","fileCount":34,"integrity":"sha512-nExcgm1nG7lBoJD/Y8h/vrlwugP1vopmxZ5+b6IjX8BgKet/iIHtzAtoTrZ/DQbs2KAOt7pi+k+x6QRvXgkEzA==","signatures":[{"sig":"MEQCIBugUZmrBbm+xLWQTVgUdPSlb59KGCZaXdVVwVWn1+FqAiBDP1fVi3g0tO6LI0TB2mnpmQietQHjIPv1J5mtdrmayQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBXBmCRA9TVsSAnZWagAAbC4P/3Oln+6dqKIv16DGie55\nP1w+va1buATqNDIfIRWpPejzKuQvrPntF6jeU31Ydfqrkr/0HTkWERDM5P8W\n0V2921NXESkOyWLeN6NRlIjHIBP00ut6CuvdTe7q0k8J0a6ITl8uUkDoomzN\nk0OgI3J5Ztdcy7xRYw5qrjwS4Yojsbk8Z0UtSz72HBbwW6whcAaY+nnL3UQl\nJEV4bg4hQ3SklPY/Z9sgjBdkOYtZJVp5JR/sDABSSuemEKlYG2ownoOd++Tg\nDKgRVmKDlOjzII3/9ZvTEWzC1GzY2JdrNt1iiMinSIBFYC5ZdPjO+7Fv8AXv\nWlfnsRQN8fiUa2EKy/pggra279yy5EQtpxK5AlJiMRotkzI2zjWoIZKOuQm5\nQp6ioe5s+hyQNQG2UjawK+pg1Vi7yvhUULBfzUb/JHf/1JH3eoRC3wZnN3bi\nHIoWytlkCR5aOVwFG1GMcs49T1GljC6wNMKXb8c64Q+3or3uDFjvXl03ybd6\nb3HJ4e4YidQl2yWg4AIck5hfMzTyYu/nn02SqADlbX7Ukn/wknAOhZu9veyo\nGgM8BiU5CCZIChNGXFfVGFcz482bt7iq9oSQY7vKSa9bfjYbMRxL/lP85i2k\nQumWMyUx5a1jYzpkjcPiWXEOiVbrA7u3/C7NO3jckbLNf+7/6yYp9XMhssId\niOyr\r\n=tDJR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7e9ce072e9ec1ce5820d347b59d99209542a2bfa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e00181e59.0","@material/rtl":"14.0.0-canary.e00181e59.0","@material/base":"14.0.0-canary.e00181e59.0","@material/shape":"14.0.0-canary.e00181e59.0","@material/theme":"14.0.0-canary.e00181e59.0","@material/animation":"14.0.0-canary.e00181e59.0","@material/elevation":"14.0.0-canary.e00181e59.0","@material/typography":"14.0.0-canary.e00181e59.0","@material/feature-targeting":"14.0.0-canary.e00181e59.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.e00181e59.0_1644523622386_0.3186809155863508","host":"s3://npm-registry-packages"}},"14.0.0-canary.037285f9b.0":{"name":"@material/tooltip","version":"14.0.0-canary.037285f9b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.037285f9b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"03429e89845fcdeff29415fa7a248422e0bab4c4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.037285f9b.0.tgz","fileCount":34,"integrity":"sha512-ki2nj/rrw5OB9xQIatRVswLyyrm8mX/rJBdPO/9AHpJLk/MulTAWVdTI26yiF0404XRsBjKCDcg0IwcC2ZKy0Q==","signatures":[{"sig":"MEMCHzZ3M0PxXhTaDujqtTXxS28LkcIESjjYmE1iJeuXi3gCIDvGf7SYN+PtiGwJsQoZt0a6HXQ0F/OUshGFpn797adE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBqspCRA9TVsSAnZWagAATbQP/3ZvImhIu0ggs76ajFZA\nfErrykkr3rsEvmKsWGmgvfJjLjWqC590nt5ioJy8dnyYNoQoQjDA4uwLXCrI\nY9XFVqUEr9EEM20RavSElrhIVt3Ac7oA7+AMg02tlqSooXe5MBuz7R1/CQA2\nJwormwHbxlHAh/cEoCEAXP0UyctPdM/nf8rk6bLeLRzUMQ4AKEZu2B1SGMVZ\nxvZknfT2fnjeXKVn7QkLYSovId90oG1bB45IiRozZYCo4FAavw3trduWh1oC\neG9IhoJWAZbIneXnz2wCfyBCtlBqwXuxRbiXR38ms4tV/iK/pVTwDeHw0y6P\nUP6mIq0vGTA1H3ql3Rxuc+UFeTyX9OjI9hX66QA1U9LvoLdKzZsbdkkPHLHg\n2v3FRuC1E97R7DSQ0CYqEGGjyHg4C+8Jvaa6ExjY9xckVunfyLnEenSqyhYM\n6x7t/sy9qws0p/SmaF5T1Sv2KS0ZKL8N+DpD/0xrxdLBQFwxwBMtOsvKX7k2\ntNjYzjk6sgOztTZY+7zcrL9ugwmOgnHqnMDcEOSQe+4LTXVYzHmIQ23//wP9\ntiaSrbmuCjvWfm8dizBUvel8YGcFdndTP/n5h1Cd0G9lRufZl36+vnKADzQw\nQlYkGc1AHw2KAWT966aUBeu4BTgEawpg3HlPlbJnYacPnZ7XtmBADZUSQSMV\ny9wQ\r\n=7Fut\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a9bca201560da3f96e435e6e070baee148bcabe2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.037285f9b.0","@material/rtl":"14.0.0-canary.037285f9b.0","@material/base":"14.0.0-canary.037285f9b.0","@material/shape":"14.0.0-canary.037285f9b.0","@material/theme":"14.0.0-canary.037285f9b.0","@material/animation":"14.0.0-canary.037285f9b.0","@material/elevation":"14.0.0-canary.037285f9b.0","@material/typography":"14.0.0-canary.037285f9b.0","@material/feature-targeting":"14.0.0-canary.037285f9b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.037285f9b.0_1644604201398_0.14902658631725818","host":"s3://npm-registry-packages"}},"14.0.0-canary.1aaa68dda.0":{"name":"@material/tooltip","version":"14.0.0-canary.1aaa68dda.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.1aaa68dda.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"08d5a9bb7402f9fa35258f581cc37ea9cb49fc2e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.1aaa68dda.0.tgz","fileCount":34,"integrity":"sha512-KQC4d1+87uyWvOb05gOB9oxs/iktl6RbIj32HUk911Yjq+O1XVOuRbIf3yrE8L7RTiLdaTPbK39Rr2hW3i3hGA==","signatures":[{"sig":"MEYCIQCbS0BTuQMeTBSWK34/tJ+feA52+4P8TSVvQJozMMrRgQIhANniWji3XfM2QR7F34A7tmsKoA4kGKn643hCwiQ0FlqR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDVVKCRA9TVsSAnZWagAA8QsQAJ4Yjj7dTD/XHdBpN7X4\n7eywW64RTZdXG2fefA8GU00eqinxwBbZJPOUkqPsoO3g4kNbb6HQVINVV8Jp\nHmya8L0U4wbJYGWZbuQQeB8MJiXAQhlimVl5QV3095Ry/4iWj4P6PCVZYr3r\ntREY2qTKxlfkRW+QLLEoRdAktCy81I4EuXuoHt0ObKzOrFAYKmpc5Kc5acJk\n4LMLT1zdAJY/bina1iKmGNC7dYBA5HJcoRaDY1L4G1R+f68yxXhZ3xMNa0Rx\nyILVN/QMHy1vzncVFDo27KWD+6aJosL/9zvxA83RFHzsMEBTMS4ZsVmUGxXB\nUh3gqHvXwgHOqUO9/zDr75RO7gmWWcd4bpUUBV+3SKnqj2Ua/Wu1gw1cJ2fn\nFEWXgNMH7doNYuWrX4z3w0HCVdGoNJ2qmpmSn+Hp6f12koKzYaiYeimiMDqB\nVOnnLqndVSYm1ijOG4dx/U/AIz9YSICj6VUp58WSyA+S9ormVr3V3ybv2kz5\nDkSdgNL/fYg2FNDaEAo2u66FblXmeTyD8HR5p4BRFznMNttQaXWp/ETHAjB+\nsb3rn2L/6Afbh5p2S9Fn5eku/r+RRoPkI6zq14Ibht52k15KKa31UFv/DHhk\nBcI//41a0X9+vNBBuR2xOPorOTeU6E+hNBmEAUtsgv5Fg88BZ94YzQkGTzwg\ng14y\r\n=58+O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"49eaedc3ce6f1f8db6a6929143c077e8f65694f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.1aaa68dda.0","@material/rtl":"14.0.0-canary.1aaa68dda.0","@material/base":"14.0.0-canary.1aaa68dda.0","@material/shape":"14.0.0-canary.1aaa68dda.0","@material/theme":"14.0.0-canary.1aaa68dda.0","@material/animation":"14.0.0-canary.1aaa68dda.0","@material/elevation":"14.0.0-canary.1aaa68dda.0","@material/typography":"14.0.0-canary.1aaa68dda.0","@material/feature-targeting":"14.0.0-canary.1aaa68dda.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.1aaa68dda.0_1645040970353_0.729384905602432","host":"s3://npm-registry-packages"}},"14.0.0-canary.ab4aba1af.0":{"name":"@material/tooltip","version":"14.0.0-canary.ab4aba1af.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.ab4aba1af.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"790b47de11b46d4bc05943ec8a3359a6b849996a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.ab4aba1af.0.tgz","fileCount":34,"integrity":"sha512-n58iaaiDz0ASsHsu8Blg1DnvdSc7B17PIGrNZ6393YGO0L8GvTvvoBqO2+qWnel9Gwcmt3Nn4RA9UsXbFml4EA==","signatures":[{"sig":"MEQCIAr7tYc5mMtigwJeHrjFdnunyS0hxSwbSphYIs/QD1tqAiBQcpnbN81XJJGfZ+/BNwggHqAs55rxkUrItegBYLXveA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiDpENACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrPpQ//buCNQMYxiz8/UjDD9GKLvA7KMM4AkbQ8/TCxOoK1ov6UWqmT\r\n7kawr2f5rQUojnnM7apsBte3SnPsx0EcYWkv1EqyZjR3ula2/uYzvgaYXx9t\r\neCzd6eiBEMqhWw7aGzwyHCe2PKD6FHEnHO5yGCSBZxc2VwdpyIziU0Fo6NJK\r\naakC84ennnR2Kc8OKceCc1KRFf8TjvjRa1oo3xkkuF1ndEJdkz+CCIToUaYY\r\nX2iIG/PIID8PIF6uJkk/WiaA9/JB1VxSfHIU/G2mrS9hNK5N+uWIXknFSu4+\r\nEUTp6i5TCJ2w8Qr1af6OO4q6GPuxxE654yNINYUNBAo9lJaogYnhaWzKng/7\r\n0mVosEpiXcSk3bTSSTaW6ImYMXHo3xEjDXubVeehPuNdUsBdQdh8u/CzCwYt\r\nNsWW/6XQjsz3qSIn7jSC//uYIMLuD8imSiGuFPtzPaswYZ4x9aYP88qaOOiY\r\n4n2+Hi2q1frJlmeJu71NPB+jv3HTQ5fQ9aGBsgg8p5PtUMaTRwfTWBJ68L7U\r\nnsrbYc/nBFeuz7Q+xxeovX+OHnHUZhEc7lqiGpGyuBNrLZ5Xgynnswy851Ze\r\n+n0kN3+LNiPOcMcgLr0Ca4J3enn85AldIwZyH/ym5a+JzgsidV0QeY/Sb8aa\r\nhfeJ10/VgGkZHacROgei7VDwk8J7bMRVwIc=\r\n=2Km+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"89aa095a35d4a006012f1de893cf181c5725f676","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ab4aba1af.0","@material/rtl":"14.0.0-canary.ab4aba1af.0","@material/base":"14.0.0-canary.ab4aba1af.0","@material/shape":"14.0.0-canary.ab4aba1af.0","@material/theme":"14.0.0-canary.ab4aba1af.0","@material/animation":"14.0.0-canary.ab4aba1af.0","@material/elevation":"14.0.0-canary.ab4aba1af.0","@material/typography":"14.0.0-canary.ab4aba1af.0","@material/feature-targeting":"14.0.0-canary.ab4aba1af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.ab4aba1af.0_1645121805763_0.011518112285415327","host":"s3://npm-registry-packages"}},"14.0.0-canary.e58552c6e.0":{"name":"@material/tooltip","version":"14.0.0-canary.e58552c6e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.e58552c6e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bc4c53b7a8fe5d32fce2eb55e8eeeb3b6c218656","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.e58552c6e.0.tgz","fileCount":34,"integrity":"sha512-z89l8ifUkWCmKA9BgGONVi5N3Y21E5nVr+QrMqEtA3E4Ql0cIeuz5ZKi96NpxY8mHZEjj/u8+RTSsuFK+JI01Q==","signatures":[{"sig":"MEQCIGeID+71jOnA+V/X5RVTofNU6P4JuSdKECMwxv8JHVetAiAguXK55+etK+xvvvRJMCri0HAwEnUry1uITiu+CPFsVw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiD9+wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZgg/+JCnPsUE3j+/FI2vhSLk2lorHAyGmvxt2RBiviKst/bJeMLPa\r\n/qM6EwpxJTEcaoDtCFP+TKddvs0LTJnqi0hNv9jzv/w9d71D3dRJMUWOhrV3\r\n4VCvygo0ZeGqbV+zK7ooawyxbZzZQKokB59stBwnAXk2AR1PMyEeet84Y6ts\r\n7ZdZ7m/nCwzrxkUc0WqyLid4dbzMpGr6++MPxPgUlSMXgRMaz4JtFdsxe5SC\r\ni5AnSurr29sQC5OugiR7m/iPd6lJIKgp8s8lQCEbpt2ujJ6LalnZ1FlyEcDl\r\njCQrrbKga38hRTM7t73U/hey3zNBGCatDLuX/apexhLin4m+WPV4vGNcTbaF\r\n7QCCUeLeuBPNK3aVaYPXAp+cHmv9LmN87w8i5PSSTTPz3cIMScLOYeq907WH\r\nBpeuGVbxGPqNR3fbGkfu7AS6GgeBZcdA1pKoNCjGIRr2YWgOhPXhHNj9cOLv\r\nj72T/kbEgo46gqlb0aebZCVo391GBUhUmhpq3R9Ntg371JI27KeltXhWYhZ5\r\nkRjQ/iq24E38YvwZdhTJicl4Xc50l32wvNTooa4/s8U5Sm36p1xJ5+3GJ0jS\r\n3VHxxukmt8JHcbuNXznqAuHR5fmGhLsLRwuI0fexQxP771A7ooa57B+oI19U\r\naRwqkF+AR6X9gQaF9T88sFDA4/EXC1JVuuo=\r\n=iW3b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6d5c1a026de93c3896f05529594e5b025f79a060","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e58552c6e.0","@material/rtl":"14.0.0-canary.e58552c6e.0","@material/base":"14.0.0-canary.e58552c6e.0","@material/shape":"14.0.0-canary.e58552c6e.0","@material/theme":"14.0.0-canary.e58552c6e.0","@material/animation":"14.0.0-canary.e58552c6e.0","@material/elevation":"14.0.0-canary.e58552c6e.0","@material/typography":"14.0.0-canary.e58552c6e.0","@material/feature-targeting":"14.0.0-canary.e58552c6e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.e58552c6e.0_1645207472677_0.6668664027831481","host":"s3://npm-registry-packages"}},"14.0.0-canary.868793776.0":{"name":"@material/tooltip","version":"14.0.0-canary.868793776.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.868793776.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a086e3c7bcef31e6c7a15abded4ca4418e544d50","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.868793776.0.tgz","fileCount":34,"integrity":"sha512-+VrXHIojGtcmWJacSuqbTf3dL4ssaWUu1vgQu/SXAIQpHNYot6QNR4ZiCZq73/NACTRw4uWRI+NpJawdrhjEyA==","signatures":[{"sig":"MEUCICglIg7ge8jUHqSuolQdC5+5a9VbuEr5CI9hFQLH3z+PAiEAzkVYTYqeft1hwYSbpbDnq8CJxKedIOtRMLJ1q1Zwy/I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":811188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFTseACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmooURAAkDL5QVe+obCMpX9OjHYqGGr+uPUjlvoGzyduqExzL7sWhAi7\r\n5eOnfbD85bwm3F/fohDPhTjp4Ncg0/k833R2pPbRh0lxTbkU7d6e8n2NMbVK\r\nd5sT4zNfCk/f/gUwzRUxQNLLtq3qEtTYgFCct/tbhg8uT4SS+dvPXumL3MZH\r\nODZbR6S3A+zQ21lgQrQFwQ8tDM1K8O2JvHiE2HWuEehiBV1Jj3bfUeelxrS4\r\ngWqHuq5A9CYTMoQhd5jcPaqD7N47PFLkGLGmMSzLrQh1sZd8wHCcLykSUJeM\r\nvcqlzeDSKqX+Y163BdFyO04vM8PE2OAnfAn7aaeY4gzbEjW4yxP2X1U8HeMM\r\noNWEYs4ujnDIjIWqPtvh4uJV25nav3cG4BiInOg1XdPlydJm2SOYOIdcbqtS\r\n2ZyWZTPjFUs/89989NW6tdDLCK2fNo+PYuwRtMa3o6cO16ItYYHc+pziI//H\r\n77hsEsWUF32i45SMZCns+PQ5cD9mnd/a5tSJ/jOOf5tWPJG2JsyXePQADcGD\r\nOPibpXEza0siJo6sk6gM2ssRFFCaH0DAT/4xUU9SHM03KCGA64D60rnyW4a/\r\nNW3PA873uBUneY34Bejst8tjKRjojsHLyf57Tl+s3tMIUMntvzPdmE+u2c4j\r\n5RGeu0iRAysG3C7aysNQ1cVHf20uHdlHZz4=\r\n=QdVc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"78272b55e375cfc80b8f288ad4bcd4bba3d8493c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.868793776.0","@material/rtl":"14.0.0-canary.868793776.0","@material/base":"14.0.0-canary.868793776.0","@material/shape":"14.0.0-canary.868793776.0","@material/theme":"14.0.0-canary.868793776.0","@material/animation":"14.0.0-canary.868793776.0","@material/elevation":"14.0.0-canary.868793776.0","@material/typography":"14.0.0-canary.868793776.0","@material/feature-targeting":"14.0.0-canary.868793776.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.868793776.0_1645558557838_0.14001098672860257","host":"s3://npm-registry-packages"}},"14.0.0-canary.fdc37a445.0":{"name":"@material/tooltip","version":"14.0.0-canary.fdc37a445.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.fdc37a445.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f70821c8af5d91e0fef779104932602aac52c7f6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.fdc37a445.0.tgz","fileCount":34,"integrity":"sha512-4bHaTp9k0KIm8TzDlWJT/3FzLD+A45FQD6ilA2pfYLK5XSSI3dYQWz/d/790pk6oJGZawZ7g8D2g3wVXGUtUew==","signatures":[{"sig":"MEUCIQDsPcOs28+9q/EY/mErdXw1d1PK1x2TBeum6a9bUNgrsAIgXUc+3MZhtK9OpL//mak/z4Sh5z1v/FBQfGS7r2BZovQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHRiIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEBw/+IFnwHSsrP9f14xrMfD05OkRtXtvq9r89PTHMUm5ZFhkVaisU\r\npa8bk7K0yitmWmR42gkaDZsdzV2QHkRQ5jQp1qZn6L0O4PN+Yf36iHWpI50Z\r\nS8/1P4GMK/zBe75IXZPY+PHbKsSdTztW+vMhf1Z15G5AcIxU32E0bivhBSZ7\r\nmccIxnDsZ1ZjlZ6gpxSl8LKatukvvLTX2H2rbH6w23OHtyBd6Aww9nVN9Ur6\r\nzz6iU+2mzZrlAIIi/cgIUkG4sHt69CuRh7Y7sBZZxGhlJi7iTQrZnONE9fDK\r\n0Wh9C5ybTjGacKRBBZW/RhEqNcQEMvrC/AUO56yVwORjT58rCbmp94DAXn7+\r\noi6J8WkmZLKpKSJvUJ3UGCk7p8jhgi9pTbxKqI8/8l0ty76H9HCvrBtRVF2a\r\nrIgS07OsysiZXH//5aUNZNmCh1Is2J3Ct1qUPfu4404bn/z3CaTHfFcj3sQ8\r\ncGrTZJNlOKFYbXcRY2CwnKyqWANuBTLSMUu7b6NvxjlWddytxcAHenh9jQwh\r\nPbb9pUobb9JyD0rxeUBe7qAkv72gt+LWvL1dDdCTlhsau74TZv/h1VQeahfb\r\nlceQ9SQiPRU/wfOQSiD+NWeT6bQV6MVSatjNa1bVQJBGWeVwa95rTmoyW0m8\r\nGG1YtaJqFJEV4UU8plAs+ITIK/rG6SD6sTQ=\r\n=vy/A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5a8fd2fd927d036e44b0b22f48d858fb848e504d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.fdc37a445.0","@material/rtl":"14.0.0-canary.fdc37a445.0","@material/base":"14.0.0-canary.fdc37a445.0","@material/shape":"14.0.0-canary.fdc37a445.0","@material/theme":"14.0.0-canary.fdc37a445.0","@material/animation":"14.0.0-canary.fdc37a445.0","@material/elevation":"14.0.0-canary.fdc37a445.0","@material/typography":"14.0.0-canary.fdc37a445.0","@material/feature-targeting":"14.0.0-canary.fdc37a445.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.fdc37a445.0_1646073992786_0.7913512776862914","host":"s3://npm-registry-packages"}},"14.0.0-canary.43c7d87dc.0":{"name":"@material/tooltip","version":"14.0.0-canary.43c7d87dc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.43c7d87dc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"48adc4857751b1db8357fcc2c032f3735af22359","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.43c7d87dc.0.tgz","fileCount":34,"integrity":"sha512-Zp2C/vBWiOltPxRqsKyZN1hPlM7dU3wjaTxfGXkI2x47JTSpxovgJzOCuD/sjfUd17JqIlym3EJau2GRVBZwtA==","signatures":[{"sig":"MEUCIQCWVJ5Oe2VKCPrSJP3SQH3HmizBF7olFyswlEuK9QWkLAIgTuQJ6osgy0OVzTpnGvjaj7afkeNm//o5i+yhrkSr+ks=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHjzNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmowrg//X+6uYMP16VVQHW7l9m3T5W2IDG35+DR4vzSMrOr62q9lxuwR\r\nGS0h1vyMUUm1FalQ3epPDTooHNvAV+/o/6nYWWKJQRh3sks+icprbi8Ysykh\r\n3VH7VdZY1XuAtjfBMjjrPifP6SkDMNQY/+ZpXKiOgR/6HWhU/qmIA9jrAdOU\r\nOwdf2V1j8yyUcuXvGFY+PgXBVIQwblaWOIFDXIq3v+IYkOtPH8csOQs78u5l\r\nv5VwOP1Mkgph7N8fTkfj8d6NuOWg5pmZgsnbRg5bb59LhJaG3is//ikRdp6+\r\nasJpQP/R3sblI5AGfeB6HdqIRU0vtrfrmi4vYYJUqJNbep6fOav+ppY4hpf3\r\nRDLL3nsx+Mxi6JPU7GgnYge+v+wfYVDxN2rA8NZJEMTI3SKDsCR1px84AYPP\r\nnfDe2oQIa34q20j9IDlfM0mnJ6T+xTwqOx1SNDBLD1u+OZ4U8rhslUWjh5BR\r\nsBlpISElaDJamt/k3uJwF2SmrI1JdzEvK9pjj5JqV2QGwgAc5da4sKf5xsUB\r\nhjySK5NHUiAUCZfnpVXCcMJRzgDCV/30rA0ZZHtNe3Ihxs9p4Op7gVLYwW81\r\niiYvfe323k9Qa5F9pb2Of9Ysj5T4xvqnp8nYRfzH2wdmvR5S66b0TPSsBp8Q\r\nqjzUytAJFbAwsCofTLm2Cp34jD4IO0+rQvk=\r\n=1cyu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c03dfa84e200bc6d570c73762d7ce507d0659e76","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.43c7d87dc.0","@material/rtl":"14.0.0-canary.43c7d87dc.0","@material/base":"14.0.0-canary.43c7d87dc.0","@material/shape":"14.0.0-canary.43c7d87dc.0","@material/theme":"14.0.0-canary.43c7d87dc.0","@material/animation":"14.0.0-canary.43c7d87dc.0","@material/elevation":"14.0.0-canary.43c7d87dc.0","@material/typography":"14.0.0-canary.43c7d87dc.0","@material/feature-targeting":"14.0.0-canary.43c7d87dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.43c7d87dc.0_1646148813700_0.7824486772045469","host":"s3://npm-registry-packages"}},"14.0.0-canary.23043acd0.0":{"name":"@material/tooltip","version":"14.0.0-canary.23043acd0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.23043acd0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db0bded48bb175ad76018b2bffded9aafaf2199c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.23043acd0.0.tgz","fileCount":34,"integrity":"sha512-kVNqUu01l3hzu9VeLp+hitLzE7M40j1ADYIYiC/jv+xQVrlTPvJ/OmWC4KDHZejP+oxvmX+ggiFwy3xovEY8bw==","signatures":[{"sig":"MEUCIQDkEIt7ywpGGfWBuUwPwV+J0ZV+kO4INSrWOo2cJ6arJwIgZpvSwe3kX26ISVC0we8RafAx3h1WzLiKQaLtbrNldYQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiH9NDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLiRAAjydoydGtSRztudqoDM5W2uR/NZD4IAa30yJqxAZHkAUngFP6\r\ni2dXDdHV2BCu50O/1nUKJr+Rw86EV9zrLBpPuWeveHKguAGW1bJrvQpGVjkU\r\nDloi0fNYipb+ao4YZIHykxx6sNTI7KOlCUOYQEnYjQAT9+WpsmsCCAfjBStF\r\nQehznLPcgGeUJLyzdkfULzJ8UYQYewnPLo80k2e676PchEorXst50dir4O4p\r\ntX+TT2in0tsRO7RKkjA2RemJ2Z08OU8m0e69y+nfhY3kSdocTUbjk6C1yFiW\r\nTgv4bCis9CVg4V5g/LGU6Thx+kZRQ7/895yIFnHEayB/b36B6ffeVJLA5F3X\r\niIMLOMvHlV3jcKRMwlzRGyEP8VVRePtAqlv9dt5kPfX/mu/8WK9s/50mSa9U\r\nguvwXMb0I4IWPoZ1QNsFQrr0PTyoWvGPKDehx5ZdBqxcME7h4YklOoG1dmLo\r\nfYb4fD6rYkVEuggcblJYA3DbmWJ4wv/OnM0vOiZ//PA9KHvYRmUJc7cwPlxz\r\nUu8gOm98gyqlgApZcsBabx95W4V8JBEGHAPY49PdLN0e/ZArwMQPe57fIcBq\r\nRmdTbZ4Gb4bZIsk6uPhKb6hS528E4PjkPM3NOZS4kmbE/ucyYLYDVo+UZomI\r\n/6WcERfM0l57wgt+CVadFBD9rXc44I6LeR0=\r\n=Q5Vp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b1cfc3908c111a04a69dbaa90966642093f79e86","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.23043acd0.0","@material/rtl":"14.0.0-canary.23043acd0.0","@material/base":"14.0.0-canary.23043acd0.0","@material/shape":"14.0.0-canary.23043acd0.0","@material/theme":"14.0.0-canary.23043acd0.0","@material/animation":"14.0.0-canary.23043acd0.0","@material/elevation":"14.0.0-canary.23043acd0.0","@material/typography":"14.0.0-canary.23043acd0.0","@material/feature-targeting":"14.0.0-canary.23043acd0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.23043acd0.0_1646252867711_0.47863078802956704","host":"s3://npm-registry-packages"}},"14.0.0-canary.6505e61c5.0":{"name":"@material/tooltip","version":"14.0.0-canary.6505e61c5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.6505e61c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2cbdf94de15de5d1566d75464da5132ea9a516fb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.6505e61c5.0.tgz","fileCount":34,"integrity":"sha512-s7PwS6liUJpxZRsCprbQnmEK+A5CB+jQdy0RApTtg461uDgGb98kDHZnrL4xzNHkNiRbrHZQgusO/+UO6t1CAQ==","signatures":[{"sig":"MEYCIQCPjEPHv4pTx95ioRS4Z0NLyUAKXUx4hNxvnd2nd1lhFgIhANaRshaPuvr7Yis04EStQZ8dXzZB/JQ4aLA46pLMBQg3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIR5/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAJxAAnaeXjC0cYrrsUwX00QXiCxgaqgsqrFclfxeVP+fTI8faPjn4\r\nz7lNBg5V4MOurSBHsIru3lhlOy4AGuk6BSBrVE9IwvsVPbzPxNODmhEK0G9p\r\n5DxzgJDMkAS7XhcfAnXKrzXNGg5VhcL4s2qeENB8QnrGQbBzASGZDqVPmRyG\r\nYRVQjTujAvfYDeGyIf+bEC444bENn2ue2RmE11B/q6f9Uwv5vm+LRiIguUEm\r\nuncIMGCxoHUNM7SdKrOfQXksCFajEajaXY+toGDaW90u3katMMOsUc22Sxow\r\ndGoh9U9LunV6YaUvj8Rxl6mawvCsT5hMk02DuTg4Lw6RErTi7l/GbxBDZf8i\r\n3SIf9oOdBsnzW58pe30UUtFmopNPBAbrHu9blEx63QpW3xgTrexQ0DaoRK9T\r\n588EToDi7H9mUccL9Wp/fRes5NYu9omHIPSLqPbws5Ge65EWZwj6CTld49h2\r\nATF1jn+Jjf705dKzU8sE9bRaYIfKgXDHQeoG/+PiJCrxBjSyd/1nuggIgv+o\r\npbv3IzmJSHEQyLfYmH/CkPNA0o0zL/msdyEWce4ewvBjJTWzE2fApBLKFwJD\r\ntQ1tTc/IbjXg/Un3o3mqc/NWhi/os1v3y+L2amZF/ZlHY73lrEEvOMw0SWQx\r\ncSt7QnE+pNLgcRzs/NjtE/VxRxb+Tt6VkmA=\r\n=yonF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c9070f0099aa35dc2460994d2d83a8330b996c5c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.6505e61c5.0","@material/rtl":"14.0.0-canary.6505e61c5.0","@material/base":"14.0.0-canary.6505e61c5.0","@material/shape":"14.0.0-canary.6505e61c5.0","@material/theme":"14.0.0-canary.6505e61c5.0","@material/animation":"14.0.0-canary.6505e61c5.0","@material/elevation":"14.0.0-canary.6505e61c5.0","@material/typography":"14.0.0-canary.6505e61c5.0","@material/feature-targeting":"14.0.0-canary.6505e61c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.6505e61c5.0_1646337663164_0.49388520567164007","host":"s3://npm-registry-packages"}},"14.0.0-canary.16c166154.0":{"name":"@material/tooltip","version":"14.0.0-canary.16c166154.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.16c166154.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"80ea3102e68fd5b70abb47136f292fa21732b518","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.16c166154.0.tgz","fileCount":34,"integrity":"sha512-Mk25F8caS3+mBS+xHPMbHwFA8ZVlZed1sKOXpTKR0uYV/eTllM9aV5chSRXf1PW692oA14O1P2eE+dY/5HGgqg==","signatures":[{"sig":"MEUCIFmALyf+xZFOvDHHZWAsCMxeG4eNSPmRHC2kMVJA1LJhAiEAj/BhL3mO7HwDIWQRoOHmEAFDgBR7WGm6dQuv10wpYGA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJ+VEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoo6Q//fU9MUVC/68fnVKuj1TpT2IvQh+3dIKoml4avMCYY5sAgu8Jo\r\n6utkZtm5Q/kUj+zuaXeuU8ev6H6sDK3biqbka4feLTAP1fSDyCdkQa4CoVCJ\r\nqbCet8sfJjrimAnPwGWvN9N47kjHUiqO+F2lRMhnkaMpwxv2kS89ZEe9YTCn\r\n1FY0Njs1HOsVjiCTr9Uq8rRuy8Qo17RpJ0l6YDd3kneap4D2slA5LZ/DebY6\r\nipeva+MKQc5VgfZ2XH9qVnD0fxsHG2hWfdtybtoQP3lbDCUpZUgSl73FUcgs\r\n0XnPyGHF52qStGm+iQpqncVHwxToOXkTXFq4hAr25vibGtBkmIE3ks5eva/E\r\n2zK9PxC+odY9L1y42RERNz1pMcEKckNa8C1uToGxZSyTR1zrmBYaUHP72chO\r\n8r6b9x3lmO1CvSCKdkinC6vZdYrugzVZWWu3gY/cvSxTRJvgkK/Sn58kXzWW\r\nSeBeO693u5T7mCxeSEoJMg5B3oCV5yGTn4e8np6ouVkTA+zI6wpTmk80VaQI\r\n34M8rL1o22zXuhNBoSo/86AvmYTfg+Jy9xj0U1j4V8+AAFgsByvnKbKB4OTv\r\nW28JT3VwzNK2OEhhlRxqeb8Hjpwn/h1xSEC5XOcSn1EZtow/AZdeE3YtcTQN\r\nhp3xlKV3M3tGD4DL5CGQZgs/5Jm6Rb0NR1o=\r\n=bSB2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"dd1bb8b4a67220dc0120ba2dbdac900e51002949","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.16c166154.0","@material/rtl":"14.0.0-canary.16c166154.0","@material/base":"14.0.0-canary.16c166154.0","@material/shape":"14.0.0-canary.16c166154.0","@material/theme":"14.0.0-canary.16c166154.0","@material/animation":"14.0.0-canary.16c166154.0","@material/elevation":"14.0.0-canary.16c166154.0","@material/typography":"14.0.0-canary.16c166154.0","@material/feature-targeting":"14.0.0-canary.16c166154.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.16c166154.0_1646781764580_0.7102256641693125","host":"s3://npm-registry-packages"}},"14.0.0-canary.bdf1d3771.0":{"name":"@material/tooltip","version":"14.0.0-canary.bdf1d3771.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.bdf1d3771.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7ff7bc0d0bf65031c55da40ed2c2386467169750","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.bdf1d3771.0.tgz","fileCount":34,"integrity":"sha512-1q5Rp8IRn6qQaTEcXAgvK82uRSzAxnA7iL7qprIZDr+efNbiPyqjWgyH+izCN8yWb9WzDb7ZInGGSU3x4ojt/g==","signatures":[{"sig":"MEQCIGdyvJJvb/zvhkcJq33KodbVP6uuwwg18obOYUmvJiPYAiBNrRhVGyYPOevMAQidlAmRNS1QY++Q05xYKWMRTw/KUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL1ErACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoM3Q/+K8QS5iAsd1/St9v1kiPl1Z0uE9D/kzLd/dGxUSzfR8tHLtm6\r\nbWDK9L2mjdafNEvABdd4lIngTGxdQf/PHKpvUBSDmF7oQQR/UEiByfY8QyNk\r\nl3op7y+969U7qT7j+gOiKAznW70Pj5uqGvOsvb29RUETvmuoO+TOd4UxOzcd\r\nQcU4KEf8OxJ3JczRakWWm7UESPE3vJGsRkdjZkf0+zUrcNDtX8BIq9F9iVij\r\nlb3c9oruSnQd1atQYo3HqVLWT1kHwlEBU1WUVCB9AdCj2zn35DZhiozerawt\r\nv0affcn6nxR+/VCC/+tK4/+8UqZJadSNkqgrdLcOR3UiWG26IZvxNt50Xlio\r\n7zIISZ8M16qEwOg3quwNG/Ps1+QHkXdFtEGgJ983KSYUczc6vImoUz/zAt/G\r\no18RFfNhcudOnC5lzZcXsEVh8lIglE1DinHUM9NCxcqfNjg4Xl4lnns/rJr4\r\n2dSFynnmJtWJ72O9yZ94UarGgilqJ9EE7bKDemoQjmNKN53VIUQgMXdDJA25\r\nEqg0jhcrhcb517W21e0a7gPMjHnPepNMi+y5xC3VbBRG2tA8aEhHlzyrumCe\r\nBjNpNMHGItVGrFvOr7RSbBX+4YWPelRGdmanzuk0hZ9tu7IZVkR0gPwEko6c\r\nwmvp/qLd/jp3rlxF7V1hcaOwI2XfcNo1+LQ=\r\n=Jes1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"bf598649c7389f49207c410e58144f75a67cc4f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.bdf1d3771.0","@material/rtl":"14.0.0-canary.bdf1d3771.0","@material/base":"14.0.0-canary.bdf1d3771.0","@material/shape":"14.0.0-canary.bdf1d3771.0","@material/theme":"14.0.0-canary.bdf1d3771.0","@material/animation":"14.0.0-canary.bdf1d3771.0","@material/elevation":"14.0.0-canary.bdf1d3771.0","@material/typography":"14.0.0-canary.bdf1d3771.0","@material/feature-targeting":"14.0.0-canary.bdf1d3771.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.bdf1d3771.0_1647268139307_0.05063198829049864","host":"s3://npm-registry-packages"}},"14.0.0-canary.cf4292778.0":{"name":"@material/tooltip","version":"14.0.0-canary.cf4292778.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.cf4292778.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c91f2153fcf7859f4b76cc6ce1a5afb6583a5484","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.cf4292778.0.tgz","fileCount":34,"integrity":"sha512-46Og8J1HmnUtisXOBL/9eEAnihndjFapK6cLXAm4FZVWCvrsxtJZB+WqlLau8UFaGYQoZsnMs8Y0A4kqScmyWA==","signatures":[{"sig":"MEUCIQDdQX8Mq5j5AqRQbEDA89s775u0zT92pkp1/lndalYPEwIgQcBV868Y+scZNSf6J56/GpwuoMVwl8gTCo6fHgVP6Wc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL94FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzDBAAnE2wMtQMQRiKGWzhZTeiBrZd2kZ9ARqbUZLxhKyDYHAmFv1c\r\nZRecRdBU9XmT9XskMtR8WozSov5U3FSQdFbpUFINAPR4TY8bnYw3HJ0BM7OX\r\nyI7YZorKTipU/Y/6NddLL9ao/WESqpBLQ3UlEcX8v5R9Fz0R6ihvCWFsyL42\r\npJY83I0vw4TsAVltRbPJi6VwjvS+dJLKeL06POMNDVmO16SlzKuEAdCiEI7r\r\ntpGFI+ztJiF/6Sdts6Zgv52E8YyZq4JGzx4nD39sWqBtn7lw6Pej4MoMYukf\r\nnLuMAn4ZT02o7Ap0Glo7k41ixseA065u2gMD6D/dRrb5iDcUwT21Pi2TuoD/\r\nWTVzSImTxmCjDYEdOcUjj7S31dG+DdSwOrCNh1CxxoMR1gqn9QNGw31O573U\r\naU9xUGAOBp5wnFrYHz1Giy/Hu0ZqIV3LY5sDk32ldl3Wtfyj4olDMkaZfhTW\r\nVUDijMD5F1v6EKozqa4SmQYTTCgxjdVEK3fkqKm9lmDaWgfx+F7ZskaRY6jV\r\nLti+0qJKCe7uELsU4q/4Tb4JAA5WzFzRrZbz7RsuAh+6qOWeVb8uqYRcng25\r\nx2LEz8pXWC2wEA+nxOOUtxbz0NfrCK8vniJuF4SM099YpSVEXujosluVXR7S\r\nY/enGRok+0iJ8gXMTjfC5gYV/fI6D2gRlaA=\r\n=K8qN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"85b1d5db9650586ff51d999fc12531d07489d13b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cf4292778.0","@material/rtl":"14.0.0-canary.cf4292778.0","@material/base":"14.0.0-canary.cf4292778.0","@material/shape":"14.0.0-canary.cf4292778.0","@material/theme":"14.0.0-canary.cf4292778.0","@material/animation":"14.0.0-canary.cf4292778.0","@material/elevation":"14.0.0-canary.cf4292778.0","@material/typography":"14.0.0-canary.cf4292778.0","@material/feature-targeting":"14.0.0-canary.cf4292778.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.cf4292778.0_1647304197689_0.20241455285153043","host":"s3://npm-registry-packages"}},"14.0.0-canary.bbd43e0e0.0":{"name":"@material/tooltip","version":"14.0.0-canary.bbd43e0e0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.bbd43e0e0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"518985b414d723b72733de21414778ce1887549f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.bbd43e0e0.0.tgz","fileCount":34,"integrity":"sha512-Z+tpX/JnKvPrn4e0Eo3qexUAp39+DEKRJ1zTcFRu6PfMkvcjcPAPpauZM+baWpYGZrSexAA4klt1rghdY2WiFQ==","signatures":[{"sig":"MEQCIAL/NremBAj91kyzVuw7Yy0vlY7efwvmZqq6tEI3gMjsAiAV2yCeW8D/YZ82xXhfQ+WJtMaCOEPKiiI5ABftoRrOBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMk2SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKAA//TrzoSIC2ncOSk3acxDoHqrr3d9Q9AP8t89J9bGFkPrvpFl/t\r\nHpC1VAdMsPT+Y5s0ai1WxEn30SHfegX4feL3oTh5aKdXcnRJKImGFHEt983r\r\n4+iWQQsiFZHfOS1kI5bV0iy254GHHvG0FSZoL2wY9+YNTrtML1M4QVqoFtEz\r\ne+9W3gNSbqUdPSaXC8z7z5KOaK0rceuvf2dTez/12RuchJ+yN0BKlAEUKJxd\r\nSEAuawEQy0Rl2RVVRKJ3KNLELqxDS9Wu8aI5L2yzXd/U+aLceVBTr3c0fagx\r\nDL1AaSSqNtPLN7td+LDNbk1c1TYKgo53DARqunzV4Swr+nYFYdqGIWFPDtYH\r\nvYVB85H2YsGOMLTykF/QJI6NqKEQMcsNlNfiP9O1k2BBAYHMaRu0KroM/gMg\r\nJGPM9Hlvv1vrHfSB27/grGRfEkI6OOZqOWJvRL0RX6XGqc41AucD0zP29c6H\r\nhk8z682izM3wQA0jjJyTkAS9+lN1uEoRof6Pd/hOcyVUdqJyCT9+fhTyVbFm\r\nO5j+OyOuX4Oq9VHC4uYZqJZB0t4iIucHLAdL9TrlDp+BseW1TEBHScEQRw8w\r\nC2eqEYMwc/dbuYulA7SmIU9l/zd1jmf+6ZrD4vEhZg3S0TSKA00CgvPlVlnm\r\nAwlFwBcJM1KWkjmSnYIYDfCCFaITj0f6yZI=\r\n=HUID\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"bd60ebc6c6267688058726d6f98421b0e815336d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.bbd43e0e0.0","@material/rtl":"14.0.0-canary.bbd43e0e0.0","@material/base":"14.0.0-canary.bbd43e0e0.0","@material/shape":"14.0.0-canary.bbd43e0e0.0","@material/theme":"14.0.0-canary.bbd43e0e0.0","@material/animation":"14.0.0-canary.bbd43e0e0.0","@material/elevation":"14.0.0-canary.bbd43e0e0.0","@material/typography":"14.0.0-canary.bbd43e0e0.0","@material/feature-targeting":"14.0.0-canary.bbd43e0e0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.bbd43e0e0.0_1647463826366_0.8800314687654209","host":"s3://npm-registry-packages"}},"14.0.0-canary.1b6afad86.0":{"name":"@material/tooltip","version":"14.0.0-canary.1b6afad86.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.1b6afad86.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef3d06dad2654cd393b2f91f6430b7bc56a51d0f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.1b6afad86.0.tgz","fileCount":34,"integrity":"sha512-ZfhqPMjS7os/DoDDZfA4rEnuFQL82h18gYzcsBp+3lBsZlV9VzwJCITjiA+Ygnsv1cGz9Zvw6jv0T3VaiAM0HQ==","signatures":[{"sig":"MEQCIDSdATeMpAZZ4zkMMK5gMyUkSgMM/FD/AVISdFdCKVsqAiBiPsavZc8q0+sV1UFApwjgMHCkBy3qIaCo6QHDb6/QAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMlC+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMZw//U2CBXGdIJ5KHPi/3rYYM0hdeyd4IGfNy6byNn4et+UmeAsdu\r\n61UoMEQDSkMwnZ1WGQ9fwdFcACykYC9pWxgfFRdhs4Xp7qL0ahphdLLW5mwF\r\nP/MlUq+R9AIbNGC79Db2dpEhYeLouErabvVe/JRmkklAJlOLsGEce4l1wTCb\r\nE4szjR0EqqUpHPS+9KrCdGdRYp+9OumMdDEPkZ4tKYQm/GCpARE7H0rLERdo\r\nee2rmLw3bZek9jbMFhCbkcmd1Gqyls758a08lgQ2Dw5kudPjNs/Kai2Ftz6N\r\nGkuH4cBMsuDftGeJTfGtQ4floqQymvdMjmM3/6USehF3gDnATRVwoqSLOfZd\r\nsUg5tq5j7CNUonmYfhMra2xYRQREmrrpGtflI56gGBehK3UqcBKUKVpKMXGl\r\n2KIyDOoI9a9TlYFK0x9MwsYKgPMK8PTECrlJM3f8qI2w/7YEHT8MUOY4AYVT\r\neUxRKg2TmPlFZDeKZ3dzi9VyOkvijC10S8TrKgyn1Fh8aZR41BubHLu+vxHD\r\nz3gyaRFOhN78DTDQC8ERudSWTkrP6a1hFREJvfQo3hZPz5L1agNYr9qifpsx\r\n3fuVuDZMRQ2mEO64JkKVPmOUfmxcIveR3t56+TxLXWiFca43gs78+ZL5VuQ3\r\neoBd3xrgFtC8sMpgZYvnSu5qBlKZaoGJGQU=\r\n=dy6M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5e32cc72145fa47fd2155c83c81cfa7ba5e27db8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.1b6afad86.0","@material/rtl":"14.0.0-canary.1b6afad86.0","@material/base":"14.0.0-canary.1b6afad86.0","@material/shape":"14.0.0-canary.1b6afad86.0","@material/theme":"14.0.0-canary.1b6afad86.0","@material/animation":"14.0.0-canary.1b6afad86.0","@material/elevation":"14.0.0-canary.1b6afad86.0","@material/typography":"14.0.0-canary.1b6afad86.0","@material/feature-targeting":"14.0.0-canary.1b6afad86.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.1b6afad86.0_1647464637926_0.8091261401942731","host":"s3://npm-registry-packages"}},"14.0.0-canary.bdf9d4af9.0":{"name":"@material/tooltip","version":"14.0.0-canary.bdf9d4af9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.bdf9d4af9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7d1cba468198076137b5194c33ad9143245dba1a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.bdf9d4af9.0.tgz","fileCount":34,"integrity":"sha512-a8BXoZcGdZ4AW5QZ55iw53S+6l3u9JzdjsPlOLgc+2L5ISR8wncS/33K+JEgMcYiR96h9+d1mOtgZ2+UbtxpFQ==","signatures":[{"sig":"MEUCIACjO7bT94O1+oYw2lFpph0UcZtiebuqfRoPtGuTsSgGAiEA/aUTlz1s0rRDGrzjux0GWSnd/8m4liXTaJVjN/nv7P4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMlQVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7dQ//duIJS/VNM4gpY+u6DvMb4DNGLBf1NH9aEGhOGPLeMZI6Xe92\r\n+7ECRX/6r0LdfN/KNdFwdVGMFECamxuJI+0IDDf7j0/Akl07CjnG/g7PlLit\r\nPj8+f+5vUlcVLkMxarRppwV/5o2g8zsa19FFDDxl3itzPtK0eVUfuc1otmFs\r\nko93K7ZRUCVbdrZ/hIp2zB04jDaOCU2D/z2YXUOYJdmkhF+3Tu4YqxrKGjap\r\nbZbFAU2iqjyKBrIyT8KjpZWQqIX8KCYDnGKRsgkaS1XgA1kV18fEP+KRLldo\r\nSCRn8+AjxpCuaOhZjkTYa/LB3YHTeEbFYZXw3bTIcPXkp698S1BrMIDiD+WN\r\nzSKE5Ub4uY7TtnS3ysA2/oSzYw3UU16RhGbK+phcX9Aw5KLqhsnMrq3pPw3D\r\nAR1BVL/235JOGlPXirzILnBg+nZ0r3DtkBtoPR9urUM5iY75TGzprvLBk5VZ\r\nSTd7tjnPwBiWs1mDz+rjQMAocR4SJC9QrWl62IIAq/XDmwuUEM0ehVzp5mUJ\r\nX6YIoulpqhAmRBrRqrOOncUY8+rKf9yr4jS/avZswKap45V0YmXQeeSs5Z1B\r\nKK3577iQeXLVO1bBrOM3tZeKHrv1TuaUJ5U0utoxfWF0JMS8HFLwy/E+YLyR\r\n/wBv4MheCN868LzJqx2DS38z1Kz0r/of2AM=\r\n=yZEd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"413f4cd271111f1b118401821eb4bb38e7fcbad9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.bdf9d4af9.0","@material/rtl":"14.0.0-canary.bdf9d4af9.0","@material/base":"14.0.0-canary.bdf9d4af9.0","@material/shape":"14.0.0-canary.bdf9d4af9.0","@material/theme":"14.0.0-canary.bdf9d4af9.0","@material/animation":"14.0.0-canary.bdf9d4af9.0","@material/elevation":"14.0.0-canary.bdf9d4af9.0","@material/typography":"14.0.0-canary.bdf9d4af9.0","@material/feature-targeting":"14.0.0-canary.bdf9d4af9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.bdf9d4af9.0_1647465493708_0.7000972512266859","host":"s3://npm-registry-packages"}},"14.0.0-canary.32b391398.0":{"name":"@material/tooltip","version":"14.0.0-canary.32b391398.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.32b391398.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"89d010a20b754fb41019b9fdaa9ff50c1f9b7a08","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.32b391398.0.tgz","fileCount":34,"integrity":"sha512-GICqET4WzZldmqY0ItyT3MYHtKCIb95nnc5CRowhTaecIBwcYGZaw9HHnKSp4D5iUK5U7oLBqhN+RAg2zu+XMg==","signatures":[{"sig":"MEUCICLSlAozbYIK0AZaDy+AMvMn0YcRUZEfZAeUsEXzG3n9AiEA3zwoOPd1lMQDF3J6PB8Cr73LGk6fxVMzV5T7v7eRgt4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM3cIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomCw//SHrToC47bjwKrdtahr9LPsupmh1QFTMxMBDoSb3q2UxfmgeN\r\nXJlMJEMpAwmpn5ayBrdRRJOlwF9nZGSuk2yNsKtWuT0GbX9rC+6utA/Gts0f\r\np7Q282t4cBoMrFrL3EI6V4SsCQdc8RXi1LTmkYmkMn9VzYzgujdZ2rcFbcub\r\nmtgKUUVOB1eAxX9ynxRCHeiBHpVfiWQLa+IGnGYN4p1avTOKATbDYqnDWcjl\r\nKrqRLCqI5B+mKI1lQZnly3wfW4r0FoG2RNH1mMICqQ4hjQyoB/H634SxeoZC\r\nq90UynMZESpthqVEhe1l+v482Vr+PVj466CHf9WWEFxEI2Q74aQ0kjp0mptO\r\nMmrPq+gNslaXvE5ih+xa/6GODYKhGhrERp2WSomcMGtwv1ILIgB2QF4FTCb7\r\n9FN+5lcgQTW5ZVuzw6WqYwcvhiQEkf57KQv1byA1H+tT+734/4m6q+04mqDm\r\n9voeV34zTHJhzM5rzdpPpkhxHVhJ53jcc1VnUDVLFOx6nUtFnaEfCO/PDZbx\r\na9+FWjsqaoLj8RnCoxwd2qsgRvVoMxruVfVyKPFiheNJ1UZ21ekIxMDwmFMe\r\nx6dPBAV7CIUFaLkjc2M1IHBK/vrk9DcNQBTFAhL8kL4VLeQuOvwuPT7k3AjN\r\npTrtBv7ITWaFVv9VlZfkzpvKGP2DTj/J6EU=\r\n=P7L9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8a457bda7a5cedbfaee9da752ba2dbc093b45ac6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.32b391398.0","@material/rtl":"14.0.0-canary.32b391398.0","@material/base":"14.0.0-canary.32b391398.0","@material/shape":"14.0.0-canary.32b391398.0","@material/theme":"14.0.0-canary.32b391398.0","@material/animation":"14.0.0-canary.32b391398.0","@material/elevation":"14.0.0-canary.32b391398.0","@material/typography":"14.0.0-canary.32b391398.0","@material/feature-targeting":"14.0.0-canary.32b391398.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.32b391398.0_1647539976254_0.1865223850673119","host":"s3://npm-registry-packages"}},"14.0.0-canary.ae8a6a3a3.0":{"name":"@material/tooltip","version":"14.0.0-canary.ae8a6a3a3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.ae8a6a3a3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"94ef236d021c0c918aa080ccecc774ff32443fe3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.ae8a6a3a3.0.tgz","fileCount":34,"integrity":"sha512-5rrQ2lO0mAxyfcro7X7+NtYc3t9b9f/Sq1qm9CEzNj2xDnGJ4YP3SEp2kp7LL3RIvkiw3CZyEyapNdw+tIzj7w==","signatures":[{"sig":"MEYCIQDneW5T0t+Un20r8TyxelknISmioYO8roqT0090PNbgFAIhAJIAA5s7VTZZyefU9FLSKLCWXh9kKGs/yjP3GNGz1dp5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNLXIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNVw/9EiIgySY0PC6W6IwqGdxnSxfk9PeZWbOIxAbbaxJApOJZ0qpj\r\nWVOzudnePTXG7kObBdyXTxo17B2+r587/6jAOYELm93+dtJM32+QW8t04sTo\r\n/kBuCSXXlMGQRqC7xgzxnsD+qVDiZdfqrsjMaxIVuu0YYGOMhw6lFh5oyQc5\r\n+gjUGs9yWl3sC5JXcyOPmQoWIIMjSnKr46Zzpge/BLBDPLr/5JKEOUHcReOQ\r\n8OMEaThSg4W20l7alSVq8DHZPqG9evWQhHjUeOrWfkKez36L+HGUw1oeo547\r\nncIi2krXhvNOgx7YUAyH6X6wjQpno763B7lM9UrCRZyzKa7hEQsdm8n8+V5e\r\nxGysFENFXnVpWFnGd25RTOLU4LojA1zxRQ6dOcXmIIqhi/inDhpzuCouykQM\r\nz8QNXd5FQB7y2CDOMuatr6iei+wGE6GJsgL6gr376Pgfh5MHSmSzguwJMi0h\r\n1DIEJzAHp0vIM7VO7wAf6MWGTl3n4CFkf5tKgY5mkFN+cOqOs6pHHe7MUOKo\r\nfswaG5CHq0vctqA/rrBtXxLNJr1zM8zyetQlb1nmj8X8cF18vOicjkj49zCD\r\nxqTX0ooIkB/Mt4Jkh7U/L8gDQdJKZl6YsFhcerVsLCm3Xut3eaN/h9qOc74v\r\nJSYu32L/hxZdhp90zSK9kqG8l6exrKNHw1A=\r\n=Skj4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"783283a1304f941e05b3ef25b9a589158368c595","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.ae8a6a3a3.0","@material/rtl":"14.0.0-canary.ae8a6a3a3.0","@material/base":"14.0.0-canary.ae8a6a3a3.0","@material/shape":"14.0.0-canary.ae8a6a3a3.0","@material/theme":"14.0.0-canary.ae8a6a3a3.0","@material/animation":"14.0.0-canary.ae8a6a3a3.0","@material/elevation":"14.0.0-canary.ae8a6a3a3.0","@material/typography":"14.0.0-canary.ae8a6a3a3.0","@material/feature-targeting":"14.0.0-canary.ae8a6a3a3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.ae8a6a3a3.0_1647621575597_0.0461671395417973","host":"s3://npm-registry-packages"}},"14.0.0-canary.cbd9358a6.0":{"name":"@material/tooltip","version":"14.0.0-canary.cbd9358a6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.cbd9358a6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5e162c94b75da1232573b94a57939f726c45433","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.cbd9358a6.0.tgz","fileCount":34,"integrity":"sha512-GiDK8D3OYLbdEO1va84cKWa1Ce0SZykHnpxZOU976XARTrYGEXn4tLgerv3IqOUYUoUSUdpz3D4mAnxjnQH/DQ==","signatures":[{"sig":"MEUCIH1L1VCo+DbmLUrpTmDYCQR3wNx+fdYdT9GGZa7l1qyGAiEA9azgy35JQR5DKPP8Y9EQPj5owZ0RyQzItEuf7XsQAGg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNQ0mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpAPQ/+JoOvqL+NChkAFfe/oieYJZ4xDjREqqyDt/+EnaypviUGQm8G\r\naYMsaXWchFe9zjBS0HcIwGHpylLdNLxSThee/yy1ZAn3fWbJZIJgdJdIpclU\r\nhIVKIRu1jtLVthWrSgPHovHntCjcNJpdAwkJAbdpXBNcjV1b4I/vUdJg5eca\r\npDCtxjU5I+UDbHY9R2ISXBOo93X4S+uXMg7nu2/MmGApBwLixszPyJKtAOXG\r\n1gGY7jzXpY1Tn5vU4lhQhfxnYw2IEQXGVAKmJS05C+VjUp5xd9I5dYFaIxup\r\nLRxGJXFR8LyKG8IrB/s0a65hRhPyvXh/ct4QAQdKh4ONGkb9IHZoXkv/6Uai\r\nicccMulutmOYaqrvVeHJa1tbfwVqQOkiPU6UE0lRR64OgWUjAdlNPjEeqwg/\r\nX5eFO50KFZqFcHDqLLajlVP3R4JSyEm3gwLbz1k7mNrv+81l2DuZj3C3gNYc\r\nvlIe6xHqOD5tOYgRisYHezwfppsdZJ3XF5eewJ7a0Y6qI2xgv1Ws9x0VOZO4\r\nRuxR1/KsIb4uSl8Y9tiN06S/xjcPaQdCfVhKau01ZbOMUTcmqSYoyIYSAkDH\r\ntYHj3njDxWAFolttsyxqYqzNFeF8AXlJ2oxzYrkWQaE+a5bMVMwWPEP6r5RO\r\nrP5bPvt5z8OmVH/Npm7UZpcN91aeumvGpIU=\r\n=jHWD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a4296a048e6aa0c1ab8e8d2cc6cb8321c24dab9f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.cbd9358a6.0","@material/rtl":"14.0.0-canary.cbd9358a6.0","@material/base":"14.0.0-canary.cbd9358a6.0","@material/shape":"14.0.0-canary.cbd9358a6.0","@material/theme":"14.0.0-canary.cbd9358a6.0","@material/animation":"14.0.0-canary.cbd9358a6.0","@material/elevation":"14.0.0-canary.cbd9358a6.0","@material/typography":"14.0.0-canary.cbd9358a6.0","@material/feature-targeting":"14.0.0-canary.cbd9358a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.cbd9358a6.0_1647643942207_0.027842953206837828","host":"s3://npm-registry-packages"}},"14.0.0-canary.dcfe49c98.0":{"name":"@material/tooltip","version":"14.0.0-canary.dcfe49c98.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.dcfe49c98.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ab22347585676eba4a40eb3a7a141941d8c3017","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.dcfe49c98.0.tgz","fileCount":34,"integrity":"sha512-9LpmXxgevkEh6cdGbTCyqBWeiLS0CzKVvEYni6KIQSlz6zKnhYhRA/gskXmqUbFt2qKXxtFRBbJByJh9fBf1bA==","signatures":[{"sig":"MEQCIAxL9IG94Ooj+Jvvv10IUTYzL9EDq2tOYFPmBKgNII6aAiBaEYMohPyoQPCY8UEx9y+Nhp6Hx88mgM3/zS2DqdkLNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOMeKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8RA//QcQ7MDWs6n2KtNVRfnB6OqYErs+gvzqBjqscWizUj4BoZAfR\r\npgUJDLCSIUD7u4oZf1rJvY88Pn+O5BIBhS8SHMJZBjInnGdXLcCNB3X+5I0V\r\nyn6zc8bT8EoRrYjF5PJjCI71PYSBCrtgdCy1Hfx0YRZUsxT1kn0XtuEXy+ls\r\ngBsPR6YoFv8A6pTxevLM/rN0YcgU6fqco6TVROle5QGWnFcmwP4AWklzVUAM\r\nZc43jTfIFqOhKhR5WwsozF3dy8YRi70prXCNjUdjhMhewtUsbdBecFC/15h0\r\nnKvOhty7h6fwG8v6CTDQO1s44RF6fZOcXehslkb/w5JzqjIjtpipVHr4x45u\r\noACiR93lOSZfB0jWDI0k76D/T9jUdxvf3VrIQYm4Vp/Pd+//ugwRS/Np5UT8\r\nk1ywgBBMD27wz5q5SuJqu688k/mtQTRzBQPHklkaeLcU/n74750CHnhCeWHZ\r\notGLlkdXNLFRs9ElTpoUy/a3cTtb2x2CrfYdj6+HBSsq+/p1NZMYx3KhmFg9\r\njkpquj+U1TMwe0ehbL8y6x6NfJk46VhoPtv+PXjs5RJOiBM3fXjE9jaNsyhr\r\n9w5gqfv4mgqsyPyJsVlloz0V+7VS0fxJkrZtzWrEvRJvwYnEtHcVAekrSZO0\r\nPxqcQEBQS62pdXSD7kVs26In7ANd+/FG51A=\r\n=pWO2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5b68455eaf6aaf2f571eb64a1d8a5edaba58d37e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.dcfe49c98.0","@material/rtl":"14.0.0-canary.dcfe49c98.0","@material/base":"14.0.0-canary.dcfe49c98.0","@material/shape":"14.0.0-canary.dcfe49c98.0","@material/theme":"14.0.0-canary.dcfe49c98.0","@material/animation":"14.0.0-canary.dcfe49c98.0","@material/elevation":"14.0.0-canary.dcfe49c98.0","@material/typography":"14.0.0-canary.dcfe49c98.0","@material/feature-targeting":"14.0.0-canary.dcfe49c98.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.dcfe49c98.0_1647888266514_0.4377848833510043","host":"s3://npm-registry-packages"}},"14.0.0-canary.f31a833fa.0":{"name":"@material/tooltip","version":"14.0.0-canary.f31a833fa.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.f31a833fa.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"99663469cb90b499259f05f2525ac3a7e20cf034","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.f31a833fa.0.tgz","fileCount":34,"integrity":"sha512-fkKhbi+53Y+ect/3pclkzOHrNZrlP0GqsO9fZ59MrLcOlOZEEB9zTLWfRVEusve8xVlUbAjlIrl2W11/8Jnx8g==","signatures":[{"sig":"MEUCIQDYGowxGo5hZXAiOJX2wZEudIItnxW/eDuXczYHKqmZRgIgeR8jRDvTxVH6d2ucfrPAY152lIqgorepMragfs7pRaA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOm7+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZGRAAnGWmw5WGJoVdamWKYD7T8Dk7yMxC2XbL7MxhGPC9vXRIifZi\r\n+GsZWan7yhiOgoyFPh+tJBZKkHVCbEkhI8Wy/hnb20uWtHq487+cj3np+3F0\r\n/yYznzRyOeQdfs1Bi64CK2iyutzWHslaCmkK1+Tt8oh0iM7hf4kpaHVGf6NW\r\nem/Qdf2jtdy6+ga8uu9O1gUDtkoMnH5pWmzJNlEdsrE3xysNxWQZ7g3CKyrZ\r\nHaOmGxeeP8kBTeYHN3B4vJtEp2Uw2GcQwlT/lTjNO5/QXP1QuHgZWsPcaEoY\r\n0Lns0GT5G7XchdBVUbyn2JJ91oyxMI7XEIvfZDbr5v/8/X8TjD5+fHqeBmtR\r\nXiDdj6XACGMBvNGVADBZw35kXGZCh7jpyoZOvWb7e1BWmEmMyQSsuEdnkadc\r\nDVYfrf1P44pF80+1KiMa/WWmRs1z2lfz1byGRPaEEjqiY9V2QpEJuvnKf4X6\r\npBc4YlworloB2KZOKRYBEcWVnfIAmwXRfluvtuYQASHmAHd56daiO6swe9VM\r\njJ5X9RTHi6Mht3Ml81r7CE8yGmlLwkYbgdCE12n9xXTRejUi6Rb1XCURExy9\r\nYUau9A6GKyv77ftkhRMe/CbHJwhol0Z0pBZ7nXm1eWaI7giFdABEBGEImg1P\r\n1ZcAG+HUqaz3kavJi4HpGMFPcRffi6VShfU=\r\n=ol69\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"28572f217366c634964a133bbf0ee0b8e88b8126","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.f31a833fa.0","@material/rtl":"14.0.0-canary.f31a833fa.0","@material/base":"14.0.0-canary.f31a833fa.0","@material/shape":"14.0.0-canary.f31a833fa.0","@material/theme":"14.0.0-canary.f31a833fa.0","@material/animation":"14.0.0-canary.f31a833fa.0","@material/elevation":"14.0.0-canary.f31a833fa.0","@material/typography":"14.0.0-canary.f31a833fa.0","@material/feature-targeting":"14.0.0-canary.f31a833fa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.f31a833fa.0_1647996670265_0.121063300626026","host":"s3://npm-registry-packages"}},"14.0.0-canary.4b92e210a.0":{"name":"@material/tooltip","version":"14.0.0-canary.4b92e210a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.4b92e210a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"885333716dc06967681c976c5bacb89c9f44ddd3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.4b92e210a.0.tgz","fileCount":34,"integrity":"sha512-wGVUcqyGu8625CVNzcN2tu58+EJSUMSDRNU/TXLgiiR0nN15u8vjRgETLHewLq1agPd+G3mSFheTtSgDMCLs7Q==","signatures":[{"sig":"MEUCICwmTw7BuAxw3s1/XWnj4P2Wc/8XcUv2cPnwLEsi9Rp0AiEAlgP32ntYY7rvdCqilUmdJpLKEEXe1hzYiXWlqbV7mUo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPNIvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpuUw//erVMZJGx2is5PInZ+EBryhw8sYABA76/0rmxzDKeSCOi/id8\r\n5JimAP1sAWFHGWYXj+t95sp+TxjiZ+pwt7pjRcGRfDuOCG0qvu/ezIiB9Ahc\r\nqpmv07hIXhNSiJA5tocgPAfEtfstzxuHQrgQOEUxPG4M5ff3Z3CGzkV3+GsM\r\nZiRH1lTU72iH8V+KgnLVfrw3ylkxgGM1XY6vI798twAHx5EG1G6atfxYvJ50\r\nZAnN6PiX/UwPaQWPIsmUou4ICodVhIgPlGuoie2ZKS2b/IgBzXCfFxdLKwSQ\r\nRKFT1cJqo2/YdilRAxKIOpm/rJcz7qdzsyCHHZ0OWoZviiNEzUNPORSh7qaM\r\nbKj9vYbQcVPqREHi0gdX96bQtRBEMj6gSP4KfecbLPoUCUAuv2z2nac/eDdb\r\nwsWbRxGyNrUZzcOzqYLqjXqdv4MsFUd5xY9JGQ2a2M+C+OxWHx3u6wog9Q9b\r\nw4B4+yN2PqoHeFHzoCU+51AhAwjObmVoyQ+MJj7nlgEfDIeoLY06FPBYzUlo\r\nXZIquwahaLC3r+2tBHfDxdmA57HqoqDIY4j+iXYd6PicOR2iyBN4iwJyLQW3\r\nUkm3voQBzmKMiYl8k6HaVpFnl1QELqzqcBwQotqgTNzhRgziNs1qQavGH8RX\r\ndtrLXcSHmDhJ2SLixtb6iZx+0V9ZEJbykoc=\r\n=QKU2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e9fc48f242a1815183c2b4c74ea1f8bb9967004b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4b92e210a.0","@material/rtl":"14.0.0-canary.4b92e210a.0","@material/base":"14.0.0-canary.4b92e210a.0","@material/shape":"14.0.0-canary.4b92e210a.0","@material/theme":"14.0.0-canary.4b92e210a.0","@material/animation":"14.0.0-canary.4b92e210a.0","@material/elevation":"14.0.0-canary.4b92e210a.0","@material/typography":"14.0.0-canary.4b92e210a.0","@material/feature-targeting":"14.0.0-canary.4b92e210a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.4b92e210a.0_1648153135802_0.062393435481380655","host":"s3://npm-registry-packages"}},"14.0.0-canary.a657abb61.0":{"name":"@material/tooltip","version":"14.0.0-canary.a657abb61.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.a657abb61.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f4f408d11f0cf006af782e449ee642581a782b31","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.a657abb61.0.tgz","fileCount":34,"integrity":"sha512-cmBENmydrfz2BL/XmvhgA1ltbTqdR4uaZdbnJIIyT6WHZZybZCY9Ui7+8VUbdB+7YNLs3QJzSojvspzs1PHrjA==","signatures":[{"sig":"MEUCIG0H3WF6hnnfve5dQEkSayqEOznEuZ33FdL4fz/RA5OtAiEAihptHzZKe4vPkQaJpeDyCTVGXLLUZFeufjhhz3mY4K0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPNcyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/aA//d2eamwfd6mUVTpaujKTdt46kS7TBiyVmxDzNP+ZNVO+62KKM\r\ntVvJYqtc1q3k2mBe7M11phoZiC9Q9Wvd41q3mZHbt5w+aJHcpkcHdu6gfmHx\r\n8yN0QLbhFw3mS5ZbDEOut1ll8nPdfG7ZdStyCXCfja28juFB1HJxHYIUZxAk\r\nK2eiBDDnzGUZHzpM6887EZItiHsUloOqSyi0QNtF2GngYNrJaNAEkWTt3ecf\r\n9EWEr3v4ph3seYgQHpnWcvmHL19hMx0y45ru6gRgMC4fsMsAqUXieSI4gIA6\r\nSrfbL/V5SA1tGm28PYCmaapXH729kVAFyDDbNZ3UOlO1CG4MdaX/wVvSUGHX\r\nX+t2M3VAcEQGIVIJJnRGOoaeDcKp4Mc9AHWx8NgthyOpfn1A8HEClJvxPRHA\r\n+Typ6YMdAPPjAKfBf/r6ZgrjjxB42NUxJH2kpdL4tuAim+UitFQno2qUdZxg\r\nE5n6Rha8xEZ5p/6p6yEgmRLvm2dOw1Fh/SLFvkX3C6UBdy5iNbas0qyOnGPl\r\nLHjskxyPPDEcHicNSM9TLuunl63foCzrtqWMux+XoyKDtj7yWW2eE0J/py17\r\nyZJ3cOZ20XzAbHX+nFg77Y2/ib5VDL21ijesvl0BuBTXT+/+iIIqdzrjCf0t\r\nslfpWHRutyoWGALrwtw+G+NJu9JGn6PtK+Q=\r\n=HXQJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b17ff714094456afc14ac1ac896e38f85e300743","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.a657abb61.0","@material/rtl":"14.0.0-canary.a657abb61.0","@material/base":"14.0.0-canary.a657abb61.0","@material/shape":"14.0.0-canary.a657abb61.0","@material/theme":"14.0.0-canary.a657abb61.0","@material/animation":"14.0.0-canary.a657abb61.0","@material/elevation":"14.0.0-canary.a657abb61.0","@material/typography":"14.0.0-canary.a657abb61.0","@material/feature-targeting":"14.0.0-canary.a657abb61.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.a657abb61.0_1648154418015_0.661705228139212","host":"s3://npm-registry-packages"}},"14.0.0-canary.443f63f50.0":{"name":"@material/tooltip","version":"14.0.0-canary.443f63f50.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.443f63f50.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e6e0840527757ab31168e839d64791765f7a5825","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.443f63f50.0.tgz","fileCount":34,"integrity":"sha512-Y1Q/1uYDH+RPO3LLVOErLIC+o8fFfNLrlSEUeBGtO0Yho2pXDL2eitUCidYbyd399JfwlgvLymYo2coWP6VUew==","signatures":[{"sig":"MEQCIF/PfrphNKHnvJy4tI1tEfv4+9xfsO6zVkJ7tgPb1lLaAiA5WRysp8j2RD0Qw+LiLHXIxcguSzJ0gjOF6cYb8d23fw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPkqZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxpA/+N6xjh16X/FDuzX0XgYyAcMaNrbqxHiO6iEOnm1F96wPJVR2d\r\nRYIf1LfQEj+FclsjYiu/G8KjRZYAnHwb3tGF/qDd/HoGdDqVCQTqk1DBfr4k\r\noVK/hT1Lwx0mgJ/rAk9YpppJKPfFIMk4cSQ6gqC0JgV4ZOxCAXMmOZ2QDSBh\r\niONqg0fW3A08ReKMB8s4jG6ir+a2/02KuM3VGmVIer0PZcgX7v4kW/+1IEHf\r\nh3qW9SrfSzoW1lTjU6+1LAcTzxYDAKfiywQhlqxniyFQDEhy1iHqStl7ASSy\r\n/Mr13RVHhnVHWhqsDda5geTrC3BgNPU/CZ9oNQuFQexssqBssL3N6CxQEMx3\r\nj9IM+NBWfwIOUIvg6Z91Q2ZDjsaQwlawU6P7bJ0/OrpqPobJQCfFi+fGnFE+\r\n+YWx1JX3RfDREXCaTYs+Znp9p6nLA4K8KOmOETdSKEmnA9ZZVMIZhlKnRnH1\r\nXxxOE4gJEWcwoP+mwXOIQ7AwhuJKd7UcRNIx09UUd9rpMu/V1HjIKH7dGsGh\r\nHsABsnpb/qh/vZNiwtJ2MTEgayTPq/2fV8dsSECQLAr9oAYtqIXFRO8MRRpJ\r\niR+Epvcl4MUkXf4Z4CzSiROutC8d9oVAYNu6tkrGdObo9ut6H4btN8DMKfbt\r\nL4DUv/s5PSmCjxv63DkERGxE9Wfn6Nr7tG4=\r\n=nJPE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0a9e4a4d027bc972dd036582cbc94abd30d3cd60","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.443f63f50.0","@material/rtl":"14.0.0-canary.443f63f50.0","@material/base":"14.0.0-canary.443f63f50.0","@material/shape":"14.0.0-canary.443f63f50.0","@material/theme":"14.0.0-canary.443f63f50.0","@material/animation":"14.0.0-canary.443f63f50.0","@material/elevation":"14.0.0-canary.443f63f50.0","@material/typography":"14.0.0-canary.443f63f50.0","@material/feature-targeting":"14.0.0-canary.443f63f50.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.443f63f50.0_1648249497580_0.7455433755153624","host":"s3://npm-registry-packages"}},"14.0.0-canary.eb382f318.0":{"name":"@material/tooltip","version":"14.0.0-canary.eb382f318.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.eb382f318.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6f4e67e5a4d837ee9d949da9a02eedf8620c989f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.eb382f318.0.tgz","fileCount":34,"integrity":"sha512-auYni0WbQZwGr/E7xaz0PGytcXOEnV9MautynvvfXOf6jyxvCzLSgY81Hgdgc9t2LqQkKxJXMpaFBdAXoGK7uw==","signatures":[{"sig":"MEYCIQCtKFZcvDV7DpmpRSF0dossEi5EezOwcNiJJ2mLpDfN1wIhANabsZWxmChbYXu+1iCUybVASBu6CpGSnPZ7gW6eJ1Cp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQ0NWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqaDg//Ywa+cePY7WIy6syopQQybKVwvbbtVoe9U5b2FUyXB4FMiDqP\r\nC0JZJ918x6LN+Agt0KmUsfpoC1MtN7BX82quFYYYkot01NJgbYEhusbUBFxf\r\n/z2JO3uxrnUkeoj0gYf2OlmFgfZjYfnt4qxcj9AXH58gFJauN3eTxs4ktTyV\r\nr66crx8dC+rcMHGrQ1tHoeMUn+JutMNszy+K3iqkKNdRknNEAtiN8a7JNkUB\r\ne8aS4PT5TMVWsWafRKctp94eb3XyL/3Ds16UP9j7gWmCjgu/tbbsB/hZaP45\r\n79xdJinSK+iufATSZblwEKr8q0jz7W3G4Zjmtg5+unsw9C2QI1TIVHFipRwU\r\nTkVT9lysEEE43hWb7cuwnfjGYYSUM5xiRRpHbNBk+wvLAT1MnKK8Jo4RHECn\r\nEEPbGvrjgKYtzuxpA3TefLwfTS3HuCU1yUfOjNtLsd1IxqRmShasdjDPdYKo\r\n5TT6o9INGDlmLymfzvjMz/KXA1KeiMwEfQqtS9vHU7Hxk69QzON5AQixOpyX\r\nWJGQwT430mQr9QbHyCO+SG/Wztv4wqPyetKqLG8URmQh+yf2GZ0nCxtMbW2y\r\naBvO5IzzivLI97XD88yp6xEVXnIHkXuqRVogtGP/r4o4QxM0DCxIFlDJav6L\r\n3Eh/CpcoxsgFD5vnLNhAVCUhDeLk9aewcGs=\r\n=oYlj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9aaa59e82abd1f56fdb3d963213242fe4f989c89","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.eb382f318.0","@material/rtl":"14.0.0-canary.eb382f318.0","@material/base":"14.0.0-canary.eb382f318.0","@material/shape":"14.0.0-canary.eb382f318.0","@material/theme":"14.0.0-canary.eb382f318.0","@material/animation":"14.0.0-canary.eb382f318.0","@material/elevation":"14.0.0-canary.eb382f318.0","@material/typography":"14.0.0-canary.eb382f318.0","@material/feature-targeting":"14.0.0-canary.eb382f318.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.eb382f318.0_1648575317862_0.8407357443826753","host":"s3://npm-registry-packages"}},"14.0.0-canary.344d52823.0":{"name":"@material/tooltip","version":"14.0.0-canary.344d52823.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.344d52823.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"84df0b21759b6fdbb47269013795bf8d1532a8ec","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.344d52823.0.tgz","fileCount":34,"integrity":"sha512-bOcGelyj1qKmqxARjVOwl6BrImRd09ibaTvwkyr5e6xqqfo91PlqoXjDc349lLoobaqfPMEj6ldPefU9GUy7KA==","signatures":[{"sig":"MEUCICLLIICrmeDS4M+xQGIJLTQQPwrDkUmBgM/BQRCYnffNAiEAh6gbDoToL9hhue+cBwW8xdwzaI5CNYBXJYvbkpjAtkk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQ1NaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoj0Q/+PHA1CPCHAnoT1TTFcFMOhJjrkRL61VnTsju+fI7LUJA4hhnl\r\nmJpVdb4A5fyMnoAH8xKnJHLojlfmk+V5UDK+xW7hqtUAU02sDpDxoRiggINu\r\nJxQQZJAz5ngT/zzisPZiWY2+WRomY++aNTHmX4ilNW74GjI2FSAmU8FW3KHW\r\nBAhnEPu8ksJPvngvV4SDDcCTL6fPw4FSztJtqhONtB2ku72P6AmRzG4XHOpr\r\n0IfMGnhcWJPcpRdjDy51+J6ORgKsg9t93RNp8NBp369AHfZnfZXaR8p7Xm9K\r\ndKzRgUWmqmscjt0mQKj8mhgdm8PKTrAdyo5Pvi+axh5q11Plg+E3gKm+M3gQ\r\ntHTZJi5I+n6KYB/4sy42zTsv3DrmdoFzxF/HBR3Ki+nOqfSBCg6AvTIXRC4K\r\nVZqw+PpZvWIJMVaOKEpPcMDZDGr/KhW5tDKwCrVXpYahmwOCQesTP0J68d+A\r\nnjvtjzsu49H+o/8JaSz0ehSwW+xQ0lOAUWvxlQ3+wmWgH4DlpJTwEhSBBq6y\r\nOsOS05STR4wTx/AfExnlVRvX88y1bnYM1WSBXWhTcz/ihG+TFdQXA9Ldh9xv\r\n6SEBhY/KD502Jnm0MsI3bx3LXVbhgETON4z2k/VE7WPSM1K1fWJzVprGuaki\r\nNZKpHLsQIw9z2MtedQSFGeXyeEJhhNYNgWU=\r\n=U5Nn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1d0b3e3b77ca281daab88499a03131363e8ce97f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.0","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.344d52823.0","@material/rtl":"14.0.0-canary.344d52823.0","@material/base":"14.0.0-canary.344d52823.0","@material/shape":"14.0.0-canary.344d52823.0","@material/theme":"14.0.0-canary.344d52823.0","@material/animation":"14.0.0-canary.344d52823.0","@material/elevation":"14.0.0-canary.344d52823.0","@material/typography":"14.0.0-canary.344d52823.0","@material/feature-targeting":"14.0.0-canary.344d52823.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.344d52823.0_1648579417749_0.49817574633118067","host":"s3://npm-registry-packages"}},"14.0.0-canary.4e372fb49.0":{"name":"@material/tooltip","version":"14.0.0-canary.4e372fb49.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.4e372fb49.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8f925a98e0b92572fae9c6321134a99d2e711ecb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.4e372fb49.0.tgz","fileCount":34,"integrity":"sha512-kqzbEedZB4m+BwqaYcP7VWxx7nGaF2FD7CbpAchLgGpQiNyC3mrg2w9TVQCQw6TW5XKnY6noiJ89hQcUcnyb1w==","signatures":[{"sig":"MEUCIQCr6yXPMk44AN0dTRikXFozAyRLwy5Bk0bOjBmgRLVDjAIgGn3thkW7zSnW/dEwUkCwTXQLMsxgrpRoiBEMcvWwZNQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiT0qPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZ7RAAhBuMxQGIrgjFihDu2tu2FS473Hx13OU9Oq07eheosuF9RduB\r\nNvCkHVLpw6aTatq+gfZRzzE3Nzh0/vzo+nAsTGRsc4J5JgbjON/StukkCS3c\r\nrQMNbfO76jKREhBrRQrwcuTfa1bj7cawLtBbyvoLUaRFIYdZ3JnVZ57Oe3BA\r\nh63u89fA36Gfo65EUfgBf3M1SMW+HDKvnkvp6TFyoSxx47OIG/G4+9D1IEB2\r\nXGABybQbXTdwNmxFcc+igW/ZzeD5Ja0IaaLxsGHornlFFWosJMm4TYLDKgbM\r\ntUdDCmMI/ReQaSzb3agEau7MIpoR9HpLqFZTb9ii6HwoMsJ3VWXMIdDVE6GZ\r\nCSbpnOVn+4PyzHtyZBR07UKztGJW0Jo3YpYO/FG4bJva5K6Ail4+w3t3A0oN\r\niwrEYET7iVLR/goPiFFohdd75jxFp/v2/gi1BE6tvKbkOHngoAagC8yjziXr\r\nkG2Nug0ycJSw5XqrL6OULjHUmn1U/EkNr7Zjd+C/i7zdkBHI9WGlUO3XdGgK\r\nmjbsnycAmFVN4ZKoOJysMWgQr+lSJVW4LpCKCdyTcqN/ZBQ9GM/Emeygops1\r\nHVCP2UqWsTE8Zz3nCyHwoY2tKUTLLwhdtCw6aogP/Kh5nNMP82Iy0nxnYuMr\r\nE8YwAgnYwNuCJLGjiym9HH7ufxWrH4GTpNg=\r\n=tkah\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"013d3cd7cc6d83c59581f40ea832529343f43047","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.4e372fb49.0","@material/rtl":"14.0.0-canary.4e372fb49.0","@material/base":"14.0.0-canary.4e372fb49.0","@material/shape":"14.0.0-canary.4e372fb49.0","@material/theme":"14.0.0-canary.4e372fb49.0","@material/animation":"14.0.0-canary.4e372fb49.0","@material/elevation":"14.0.0-canary.4e372fb49.0","@material/typography":"14.0.0-canary.4e372fb49.0","@material/feature-targeting":"14.0.0-canary.4e372fb49.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.4e372fb49.0_1649363598858_0.8843085984968004","host":"s3://npm-registry-packages"}},"14.0.0-canary.3e30054fb.0":{"name":"@material/tooltip","version":"14.0.0-canary.3e30054fb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.3e30054fb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ed62d66a97fee5effc654f25e7f78e951bbd7d07","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.3e30054fb.0.tgz","fileCount":34,"integrity":"sha512-5NSfXm/rSp81IGopgi+hzsPrAILpRiAhrk7cNgSKCAql9ULP1U2RHMpf+QkfM3tl1/RRGMFlPjnPpOS4V/0Ncg==","signatures":[{"sig":"MEYCIQCgBdvbpwQOeuat/1W7RA2qCSm84T7RYkSA8IdBIehGxgIhANUFy4k84mw7TUlAqMQtLLiRWWYO5cmWw7R3cy8ng8PB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiV0tOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoVhg/+JMYyVSvBZRnixZtG4Akurih6JBNQcpERV+Ekbias+msbJV0v\r\nODV50h3hXmV2sx2Ia6CP2opLb5GJLHldAKIrDYrrjJNHnjmHWfQAxQkfoMnf\r\ncE2UaFC04lFqsZOQ3tl633NmmT+Te6vnWmNfvkljRIYa7x+/6Ug5EHmQc1l0\r\nALM2PXHJnfx6aS9n6t2FVjLDS8CMFdV+BStUPjmQKc47LloVCHXckMG4fp8v\r\nxKADLfPEBjrSgsKi66y23ZG/q0HEOQKveIYX6cfAt12+22uiJ+iEGkbF+1aw\r\ni5WajmDussxkezl8lm1o39Ctt4owJJkjx9167vlg6hKUbCiO+jRvyKioJSZZ\r\naEffNBkM1GfKUP5xNfOEqNWNwST7dXvPHn/G/voXBcCKQzBAmALiiyVoTuhO\r\ns7uPbNC9sud7g9VeI7KyxBlr1I9gVLbHHRzO2wMxDMntxw1GA4o61nSGPokE\r\n57U6+h/SfROWH6C46OATRStjuLAP++k5U57SEbyv9oLUEypirI4U0XM5SMRS\r\nhxU8Ity+TUcCDqH2C+VcWTyUKE9lqwDcFuCfPl5RosQEbtE8nX9ORaRZIaCw\r\nzoh8ubI8OsrEgAaXUTJNKCH09Jfl5Po5djclLZhql3lookp/Qceh8At+xawH\r\nbE5KLdyYxBxN90A+gxC0062kQzkPFozrqHo=\r\n=W0GE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"04d79139861b90bf3488ab3f74e4bc33e6af1c8d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3e30054fb.0","@material/rtl":"14.0.0-canary.3e30054fb.0","@material/base":"14.0.0-canary.3e30054fb.0","@material/shape":"14.0.0-canary.3e30054fb.0","@material/theme":"14.0.0-canary.3e30054fb.0","@material/animation":"14.0.0-canary.3e30054fb.0","@material/elevation":"14.0.0-canary.3e30054fb.0","@material/typography":"14.0.0-canary.3e30054fb.0","@material/feature-targeting":"14.0.0-canary.3e30054fb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.3e30054fb.0_1649888077818_0.6275615584430072","host":"s3://npm-registry-packages"}},"14.0.0-canary.8c4da223a.0":{"name":"@material/tooltip","version":"14.0.0-canary.8c4da223a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.8c4da223a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"42ab8cc3e7e2b9f25edc35dede84e83b7a87f3b4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.8c4da223a.0.tgz","fileCount":34,"integrity":"sha512-igxN6lr8hK2comsVMwNOhg1qCqouI2vqTV/LFb5fbQwKiq2WmaQdBogpCyvYWih3eaNsJnYP422TbSPkkXOlBA==","signatures":[{"sig":"MEQCIG+v3/n8D7n+VmgN/FgGH8jG4ymP+NRLkkiOKuKSFud/AiB5Emu7lI9RvYnJiD8tE1MQ5Eq9BZFOUMRejTIlVGJLZg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXtQyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZJw/8CBDZ2ljv3Vk97GUl9s+Hj95y2dl/BJGmMAyhuH7BvlYekhIH\r\nFGj3F9SEKSZoSJIN14Ugs8Y46Vwd3M9xv9vnK7fz/TpTG/H5mJRTbbFiiQwQ\r\nLRE9RHeRMabpL7MYzFtKuodxF23NRBIANH0RR/1+zrLne5e0QPtNKqlJSIA+\r\nVRh8D4sBD6dfTgR2bpAaMEFJtOPae+qZ6CYS54Q+cN67Muj+O9Bd4oVhstzo\r\n2stJxHcF/SOICHhGx5wXqHUC1T1uV+/My9oJNCA+2XVZZGoG01pCOYiVEk3D\r\nmavUpgQFeHri+BDiu+W3dqw8TTHuUf9iBcshdW1AaemtE0mFVa40NBZfx0yv\r\nv3MmzSXNqAJl9ydakQGsDdKroWTnFJNayPvWbhWq7L4fFtH/75+ewdbmdEno\r\nl8JyUw31v+w2y1b9P4oIsAX8HaQV09PzSuC1pPaonH9WvOFxmZVZmSKS+SpK\r\nRO3fO8d7k41v4NtnFyz/dXk7eC6uS+mciH2HIixccXHSBqNSVe9ga8k4yo+2\r\n8Ljd8Khs5nibyUn5VqgYwgWKrHSYYYfyldQyMPoMP9jjEguelfgeP/H19rp4\r\n5vYGkXexYzVsbQ714E28agglv/hcx8sOHBeMuFijXqevrLM4UY4+VYUpJRzN\r\nIn/YEudj90Mf4pbHuOqNUZ2xbGckb/H7e0s=\r\n=X29m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a5f798a752de150dd0a004bdfc90979ab4185d1d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.8c4da223a.0","@material/rtl":"14.0.0-canary.8c4da223a.0","@material/base":"14.0.0-canary.8c4da223a.0","@material/shape":"14.0.0-canary.8c4da223a.0","@material/theme":"14.0.0-canary.8c4da223a.0","@material/animation":"14.0.0-canary.8c4da223a.0","@material/elevation":"14.0.0-canary.8c4da223a.0","@material/typography":"14.0.0-canary.8c4da223a.0","@material/feature-targeting":"14.0.0-canary.8c4da223a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.8c4da223a.0_1650381874718_0.2345977459821429","host":"s3://npm-registry-packages"}},"14.0.0-canary.7de8965cc.0":{"name":"@material/tooltip","version":"14.0.0-canary.7de8965cc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.7de8965cc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2c9f706dd3713b6f32e775aa2fe610597f114a45","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.7de8965cc.0.tgz","fileCount":34,"integrity":"sha512-b7Wrxr51boggqdM7hYLnaj4yTgRThT6d6hYqwTptG4P1sB+XOEKwwp14Veu40C93crc2b3SCt8PaVRnr8y9mVA==","signatures":[{"sig":"MEYCIQCRBPt06pdSIxEh59XFxgN/2oxkQma/wODocA87fKl/tQIhAJ088CW/iFHGZb//Mnu5aotF9JaFjwBpyQqAAYB9IOl8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXxpSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHbRAAmwaPMovrUUwJ5HluTiiWOTf7zokxmdqw4/99dnKX5UjAXZ+w\r\nIeL0ktmS+pgNxFqRifmHv2kk7F4xBcb53Hdm7t/ywMf7XMWlsZHXPXqDyab9\r\nmG+Ej746OZTv+Rmx3EtjGf/wNmeHoP8cvcnWZrD1PO/QydRe9FVSj5kOP7eU\r\n7YYwZplV6qSJn7cKH5NuVp+eAeeD7SjKgU0iePYHnD78+dRfSW1u1uCF9N7I\r\nVr0vlfau/CYhZOD+Dst29Cp/i+g6yMMdbBOinzW2NyPRClqoL9RzfXIZ0WTA\r\ncr9pFENWRUPq34DXUUc7QWOVKIrbrcsnQ32gMzIqmyaBsuQ7D9nJJtHFiL9R\r\nYhypgkbc5S6JhcxCD3r1RPn0jiEKvTn4V5qHmQCaKDLHhnva/qxDjX8TEFIY\r\nMFfs/I5iMCWH/y7kMVJpKWJkFu0QXgBHWv2npV/RzGW8E5cW8vcTS0r51Y8e\r\nNlUTzEeHj8KIu3vBozfmC5vyR/F/RcnbVISItRi7trCJ6EUm7dQ1wMDeCMsx\r\nwOwYH7VnOCE3Jb7zlIR6Evx0FMduXy4WaPWxU5mgsf7dkjxKybkMLDwcXGY6\r\nMouhgl/k+8vyznWYfNsYpOOMT12jQylxlCeZrBus7BU+52Of6zaAeVkdKYtM\r\n4bE4+purwlSRmtwQVSRXUB8OOhvjlIjasR0=\r\n=S7Bo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"538ae755c197f0d9a1fd3a2cab5000c498987584","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.7de8965cc.0","@material/rtl":"14.0.0-canary.7de8965cc.0","@material/base":"14.0.0-canary.7de8965cc.0","@material/shape":"14.0.0-canary.7de8965cc.0","@material/theme":"14.0.0-canary.7de8965cc.0","@material/animation":"14.0.0-canary.7de8965cc.0","@material/elevation":"14.0.0-canary.7de8965cc.0","@material/typography":"14.0.0-canary.7de8965cc.0","@material/feature-targeting":"14.0.0-canary.7de8965cc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.7de8965cc.0_1650399825823_0.42971794102329675","host":"s3://npm-registry-packages"}},"14.0.0-canary.641ed0851.0":{"name":"@material/tooltip","version":"14.0.0-canary.641ed0851.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.641ed0851.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b468c6f1181206c615134b8b74a3b73b60386c0d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.641ed0851.0.tgz","fileCount":34,"integrity":"sha512-f9gLXBfhXflcmj1CI6+/3MG1iZgw/FXRfIHLfh7p2ttwd4fE8xRLd76HNDEe5Ln92GqrgKpTxxrpk0XtwA0+Uw==","signatures":[{"sig":"MEUCIDpe6S20PTMxuxTwUG7fDjHLblUnFa5DwIp45UpmP+0kAiEA70nHd6lqITPo7YPjF0G5OyNxdjGtHXIVPZ3gQDzH52M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYC9uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWYQ//Qxpri5et5Z0Op/h2XBj8hFsG/wQhnL9meWdBatTn3d4+ldyS\r\npRz1hUjHWcoV85FoFW7e3yudq5bGUKf5OYZcOlQCAmyVa1I5tdvGddRkfU/f\r\n4vd5upzo9npPqx/x6VqCtdzOJW6OKIqt765ZSVGn62GJmAuUVlH+PCCeVtVG\r\n8SKQaWjm7WVFUbNFCVfIeyKo8WzuQCs5zrxrpBzjH2rmwMaFvU2qZTkzaJlT\r\nOyPFoWKfkI3B19vxsWSFMZMLNyfBUCeGpVuWalNeS1PFY2qZkY9TUYrfE+hE\r\nMjVmFaJ7l4NVFDlS2Bhf4DgN9AUhP55NMxvRERUA3Ip6K84S2cqJoV/NLinc\r\nwB8VDY1xzxm0pH+9YIoVolBEFqjW/BdwCRbTS7L4os0RjUTTWY6qPE3+CqdZ\r\nKU8HP4Mu/2+N082NSq3FcaWcGk9G+ippA4MUCx/jKXIaTvgkIWNVNoQtI1Rh\r\nP4UwSzTk5H4xIwPXvxdn2oXk5+aysbW3PSfXGYPhyJLhil5xo6oAq2q8lK3U\r\nvWbZFI0GKV3tjhbsioRo1JinuIXATm4YshBtHTWlsVLJSEx5zT4kMG92Ffyq\r\nHHmf2LRfh3+EvvNkj9O9Wyb3bOGZHmczJd38mgyS/yptrXDBpaFgNjI9bBgV\r\nH4scQgIJ2qSot69j0tXDpHk5XYXbr2k8TF8=\r\n=by3i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b45ef0f6764b2048f5027d4990cd48d6bdce11ec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.641ed0851.0","@material/rtl":"14.0.0-canary.641ed0851.0","@material/base":"14.0.0-canary.641ed0851.0","@material/shape":"14.0.0-canary.641ed0851.0","@material/theme":"14.0.0-canary.641ed0851.0","@material/animation":"14.0.0-canary.641ed0851.0","@material/elevation":"14.0.0-canary.641ed0851.0","@material/typography":"14.0.0-canary.641ed0851.0","@material/feature-targeting":"14.0.0-canary.641ed0851.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.641ed0851.0_1650470766111_0.14617103685857247","host":"s3://npm-registry-packages"}},"14.0.0-canary.e88f83024.0":{"name":"@material/tooltip","version":"14.0.0-canary.e88f83024.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.e88f83024.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0730f9dc78777d6b8b36557c668415ecccc105a4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.e88f83024.0.tgz","fileCount":34,"integrity":"sha512-wQufudceVYSBD1aNAFNA+E1UE+e8JAcI/efnPaB6jrd/ay5SebnhDRQmjLf1ZTYmsQJwU7223cmEngTAMbhp1Q==","signatures":[{"sig":"MEYCIQDrSb4GKLAzaKbOqKg6wRSyDcsb4DM3ZJARCvRcNS/sYwIhAM0xnMbI0VvDdUPGPmC9A8AZ2a52Yq5Eh/EJCKWNsll4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYEdUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrmew//fzeBCUvY5gurk389ixvnF1Rs0AHU9cdS26JBu/YIJLhsADFE\r\n6WxElUgesnragPdISksWB9TIpJ17tvpdUNPamx3ttufK1+ZoHZQP5Qr1Dw63\r\n8b7XvuB7upaNX9Sv8AVa+/GoQbPWEJwG2Q4uYacgxVCPbvBk4W+ZLxhX94Qr\r\nPDOOJWgo+zMHJ7kfg6j4e4jlgypWuYjhASSt9P76ndRqgvsf02M0a1wQZR77\r\nqDKc+Ra20NJcWsAuKBW/coGPxggv8vK70+AHEPZyQpROsCqlP9J7+4W0rOEp\r\nb/93BY4CbMTBIZXHh6EfB43fbY3Hl6ao/WJlRtlZbeOHCcxJrFs4PPbethIf\r\n8GAztQquYl8WQZaXpnyN/PxoJyBWEUqeXEASvbHUVQngUI2bVCPwJYUfe9LA\r\nNfO2zzfN+e4pYEWc2b82h1FBsG3FEp8hUVIn3uEe/NLGatuPfsa1SmjNYG8A\r\nw++KnAV6tnjUjOVINSwYUKe2qI1qnWEQzcl0MzxNJKQjqoWfgFPFliTYRk+y\r\njelgoH8wnv1zorjL42cQSksoYWTmeX6zVOtMR2scjUO8Eipm5ufCBBjm8tqp\r\naae+qrQRsdr8P+Wy718jYPAfi+gYPjPPwWr7fdbZClOoKPmb7r8j7aucUKgu\r\nuIJ6ycrRed3iJEyAidVlm7weCWydmFRkHYE=\r\n=I+VN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e9fdf51ad2ddd3dba754b98348bc356126b5640e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.e88f83024.0","@material/rtl":"14.0.0-canary.e88f83024.0","@material/base":"14.0.0-canary.e88f83024.0","@material/shape":"14.0.0-canary.e88f83024.0","@material/theme":"14.0.0-canary.e88f83024.0","@material/animation":"14.0.0-canary.e88f83024.0","@material/elevation":"14.0.0-canary.e88f83024.0","@material/typography":"14.0.0-canary.e88f83024.0","@material/feature-targeting":"14.0.0-canary.e88f83024.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.e88f83024.0_1650476884544_0.14334444993632767","host":"s3://npm-registry-packages"}},"14.0.0-canary.7321d6254.0":{"name":"@material/tooltip","version":"14.0.0-canary.7321d6254.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.7321d6254.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"15d1374db71295d2fa936bb931728a12192a81b6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.7321d6254.0.tgz","fileCount":34,"integrity":"sha512-YbYC06pah0rRaEos7e4CDt+wNrhmBxTUemFoCr/dTjaj95PqN9Clh1qRXvXiZfBcNuNta7vXGgqh+z3oy644Kg==","signatures":[{"sig":"MEUCIQCNaJ7HpJHKpTD8/1keeciHmHrAUgPymn+cPCCeLnZLLwIgUaY7a68c4s0qnpyCWPf7bhvBCpxeZiFSTUg4Vv+yi0E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYGj+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRcw//U0ZAHkHkS+LqXCQgKCK7yzio39TL5MvRapvTn8eIC7XObYHS\r\naBmf7m9NIib98ZxHcp3St8c5PbyZhoYGluCZVsMoOz707LmGDhKmhLrV21VM\r\nNFyZytkaTDSiwqG0lzFG746muFnZG+XgrfSXLAdKAhi0miMq2elfWMnyao7E\r\nvl23kXqOcd97bJEq+tqJ9p0JPDcmYgNr5UOKX/8HTLCXv+Hj8pU0OAKVTuQt\r\ndzN6ZXNoBpPU8pXBFNASXwdvpk7089pNV52m4CMvZ1yNHMqknKARa/WaD+iN\r\npiLZjgk2tdMMuzoRdmpAjiyBbAjg7z6pLDZwjyzYFR05IixMPaytcntzbUOU\r\nkgU5cmg6JqOEFR5/wcMdbPeuzhxFPUqOyDZGFwwyP+/J4NFsuBwnnj523pHM\r\nYTa+IvT2iaIhrRz6O/fI1uOO6tToc/M+lIwy9W0DLTqnLCRke/GXhWpCCF6k\r\nb9qniFsQKJ/d0lpEgppzJSE9jsKJgOS7kP8O/TMgLSWsvPYTI6mewiOSe3Al\r\nBSaztfKd0TeKmjX0VL5vfY6T99OkFNtzScnAsCU1vhxW9wIq48NoIIoryaW1\r\nToa9LZELtLNt7sIIyH2IbE3XH5tXymli7lIeyhkK1tMxt/0CnTcmP68jICSq\r\nVnQGbAayMj2KEu6Xp7lY04dMH18h8eQmzyw=\r\n=1DAU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"981be270463043c4b45845cdc3efce353eb53b30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.7321d6254.0","@material/rtl":"14.0.0-canary.7321d6254.0","@material/base":"14.0.0-canary.7321d6254.0","@material/shape":"14.0.0-canary.7321d6254.0","@material/theme":"14.0.0-canary.7321d6254.0","@material/animation":"14.0.0-canary.7321d6254.0","@material/elevation":"14.0.0-canary.7321d6254.0","@material/typography":"14.0.0-canary.7321d6254.0","@material/feature-targeting":"14.0.0-canary.7321d6254.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.7321d6254.0_1650485501952_0.8369150572980668","host":"s3://npm-registry-packages"}},"14.0.0-canary.3ab956515.0":{"name":"@material/tooltip","version":"14.0.0-canary.3ab956515.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.3ab956515.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f225d44933b4c69fab76796b96eee194d624b220","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.3ab956515.0.tgz","fileCount":34,"integrity":"sha512-6/L32xsVrOgw6fXji/hMsX9QVeVzc/Bnv8yl02IMutHKeSYFjPssbK9Am97a3S+paQbOSY6Oawk1v1QKu3cHAg==","signatures":[{"sig":"MEUCIHz7cDWE6vFYr9B7fVrpmniZqRdjB7c7tpqO7bziAwSYAiEA9z4CU3fHZboOQVIgMtzvklGIXXaIvyHyp5A/vlotIgU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZrf4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHCw/9HJ/h3spZ3PfMavI8ToQpOBR1Gs7yOCE8RegAc/ch7z1SIOFq\r\niDmfXr4gyASYvMxQmz1lWfjFGaboMlEnhqST85JWeEMN7onbHuo8/zhvpP7S\r\n2QpkSWQS807BcOF/Bp/uJcCjP8eA8Ceg6lGcEAEEY/B3nMLFZVFhjHp0l0ew\r\nG5euX80E3xfmcQbeFLqUSKuSy9uvLEiP7bVwLeoLngUO9Y4kYJ21YCIit6V9\r\nDHDF/4M5fZFlKXvf6MfHEgXSbQcnlpm3c+6k9xmupNkHGFw9hEl805MGFmzI\r\neHXAdgNX2jDVzaezYGlwRettsBlPdImh5Xr2NTasyegt2exegzafje7OUS47\r\nqvmFwfED6y2Hq0hcczXTaJti8o9FMMD4Kfo2pPC5j5gHQgRg0vmK0KHqdg5+\r\nbpkqkRKiKKlprOzgQX6TpuLeiIkrcQW6ZjPDNVpkHcufL74TTduj3qBYEK39\r\nbGLE4hwvQNmQqIKwu3zYq4gYA4KbEGn+7qVOHwrgSRR3FlS/ENqinLQTn7pV\r\nAFFfnr33N0VG0ToLgUQJILmFXhqkshZez8w82YQeY7nWfVVqche14nv4L7zU\r\nfhW/7TCvP/DdP2yxihk1T6ODt5XvlB+l5vESpQkciF11sQKQJfx6UWuQzXGC\r\nmfxQ2/B1EafweAMV6rFXNauolix4kR4dRAI=\r\n=K++i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a09484c5e8d50e8b042d5367972a9111e0432c38","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.3ab956515.0","@material/rtl":"14.0.0-canary.3ab956515.0","@material/base":"14.0.0-canary.3ab956515.0","@material/shape":"14.0.0-canary.3ab956515.0","@material/theme":"14.0.0-canary.3ab956515.0","@material/animation":"14.0.0-canary.3ab956515.0","@material/elevation":"14.0.0-canary.3ab956515.0","@material/typography":"14.0.0-canary.3ab956515.0","@material/feature-targeting":"14.0.0-canary.3ab956515.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.3ab956515.0_1650898936084_0.5429629083503111","host":"s3://npm-registry-packages"}},"14.0.0-canary.53b3cad2f.0":{"name":"@material/tooltip","version":"14.0.0-canary.53b3cad2f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0-canary.53b3cad2f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dc379a88f4cd12d6ceb48e19e68bcde4688eb8c8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0-canary.53b3cad2f.0.tgz","fileCount":34,"integrity":"sha512-5550H/yjUKq2tolMJ3pDVSSvK22p4BjFoJleetsJId78EzfrH+SfH0WmXg1xQnCyfoR2ha5Q19sL/fl34bDdfA==","signatures":[{"sig":"MEQCIBPrWWjDErA75j+CLjTi02QQfCfxqY6zRK1u45J2UohlAiBRznwkAmNAZOMqf2IjLZS8YPXmbx05iZWj9nkdIYYusw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaTr5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSBhAAg/xO2MMcjQWs8TRTSc2j47Kj4oSkxOzTuK5e0Sms3gBp1oAm\r\nC5IXw6bClbTXkAw8hQZeKp5VLank7g1kILYekUtCOwnNNU2aWUsvzx21B6N1\r\n8i252FgR4PJgyaxtwcjMuZzFvdMbH63LrOR4u/xsSc7L6rWmMOSyM6+7RQjm\r\ndDIIAN4pMYeROCbaHrw/nHnrm4EvGz/x4ONizTrT85xbgcu6qdjXPOU1XBb7\r\nrSgIuS2n3UUBc+m5hqmIQy8XCcH0Q46z7vH1+hD4QYEGFXxwEjCyq1QJsv6C\r\nIBom1bb8YW2yGP+iVdtY7blS2EKtRZljTsYIjAKtHimKdOnpz9QNlCAJkkWu\r\nx2ZuZ2AVLkjkP2Q2R8ladmdpkhFCSeY4P9DCXp7AT0Nh0awi2jb+58Pk87Rs\r\nHLw4ETmh7ZXEdz8LLJUJJntvc7kuhxw/9ba8xzAWt0vO+oZqByN0PvF/5U51\r\ntnE3/NTmhpQtJvGNHI/M50M8taJzQ4uUHTEJtODN4MRyW+3FWmlO5rxjRXYn\r\nLzrVbLR1KLryYYw9q5IyctsT24z3EKyIAE4xtYTLJv+U5Ke4fU2fPbObw0VI\r\n6JIdvLVc7T6RJLD0IqPCGJRtwK4j0XC+E0Ap1rKPYtMjP+WoNdzeFDVCvCgK\r\nJbVRZzis6KwWS9xim1ebm+TZFRq3hWfytGg=\r\n=tx+S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ebeda2e23436103241b0e82afd57b60f74599133","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"14.0.0-canary.53b3cad2f.0","@material/rtl":"14.0.0-canary.53b3cad2f.0","@material/base":"14.0.0-canary.53b3cad2f.0","@material/shape":"14.0.0-canary.53b3cad2f.0","@material/theme":"14.0.0-canary.53b3cad2f.0","@material/animation":"14.0.0-canary.53b3cad2f.0","@material/elevation":"14.0.0-canary.53b3cad2f.0","@material/typography":"14.0.0-canary.53b3cad2f.0","@material/feature-targeting":"14.0.0-canary.53b3cad2f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0-canary.53b3cad2f.0_1651063545394_0.2840463964228337","host":"s3://npm-registry-packages"}},"14.0.0":{"name":"@material/tooltip","version":"14.0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@14.0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"16bc9277bd347e581c0fd23da29ef9ff3a463431","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-14.0.0.tgz","fileCount":33,"integrity":"sha512-rp7sOuVE1hmg4VgBJMnSvtDbSzctL42X7y1yv8ukuu40Sli+H5FT0Zbn351EfjJgQWg/AlXA6+reVXkXje8JzQ==","signatures":[{"sig":"MEUCIQD+UhE2wIrn6JdN01d0M82ioq/nJZZc9iR3TteY5DqZ9wIgRXwhSxkS6+ggXuFvpIQ3k2j1pn3vE+bQ/i77AKPEVJo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiasczACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsBQ/+Pc3PUflKeNPan3QO6amC2Vf9FB2yA3uLnyXvB4tNJQzU6rRV\r\nvG/wD/H5H8XrRiedUGpzzaz57+D4ALjKjI68YnROwXBZ16Gab+X0Z7z+MCH9\r\nhoE7kJ7niljGxsNM5wtHB9rHXUzEQbX3g0dhQ1CbLMsn9m2fQBE2GnEEjTUx\r\nm9UK3FcOTUo4L6A+YBOBwrV+suXSN5qWCuT2L1SWrsNVNUVGVKPGCMJSRrX+\r\nfHBgcgHI1DEmztcmfkcFqpI5uV1Pkw24s93dT01v/BZXtvw1tOr5nDzHUNNN\r\nDEW1CZzhPAiykebahcMNQqly3IAfDa2O1UytbjUnaauMYWEAlKOYdo9odI1y\r\nzBjkqQxBpGwM2IyR5VzXO5Htv83ZkzO40cFPKfMVSLlPJohZ8gcLhmMVvNfi\r\n+drQ0T7UlhsKyQMQt4SIsnIwTqzeEJvtmwN6cl90ldgLXeMLYSjOJ/jFhNz3\r\nMA7b/UClSULsU0Ij0DhponvhP933XVwXwgio5+PojOOf9sE9G++lfpBioAoM\r\nt/EXvx/zARz+JKbbSLa7BHRj9nsT9gR47IWYBtb0Pu3jyE/wdjyIa3lGDadN\r\n1RMEWkxn2zaPyn7x89J2PM9wfvZsq+7Ht/eL/Taf6FqNuSlfD+nZbOfPAa1Y\r\nHbDruLpjIRHNbRId8UE0jiMSV/cshICgGEw=\r\n=/W0p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","gitHead":"432c815e58d61a257742836f816cf95e271e6ea1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"^14.0.0","@material/rtl":"^14.0.0","@material/base":"^14.0.0","@material/shape":"^14.0.0","@material/theme":"^14.0.0","@material/animation":"^14.0.0","@material/elevation":"^14.0.0","@material/typography":"^14.0.0","@material/feature-targeting":"^14.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tooltip_14.0.0_1651164979705_0.7426180384324863","host":"s3://npm-registry-packages"}},"15.0.0-canary.432c815e5.0":{"name":"@material/tooltip","version":"15.0.0-canary.432c815e5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.432c815e5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"34d13267376c1afee9ec08887fe0edaeed97054d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.432c815e5.0.tgz","fileCount":34,"integrity":"sha512-nt943qfGIjB9ia+Jhs2Lx7YiSyavPu94frctPMaJgRMoRn8uhN9sgHKQ4pcv+dxSZAmzpjX2/DQJVmQfDsppxg==","signatures":[{"sig":"MEUCIFhf3sXrYCHTyYN7uWYaeJP1uZBMKru9qPmZYbN2CTXAAiEAiBSJaftwQKL4nKrMWCWfrkXQx9hSV/m+GtyYjJCHq+U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiasd1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpH5BAAkJ7uq6yPC3ikJgcRBQE4h1bk25TNLZ2UJia7RG/Hj+S1xdZ1\r\nYE40vUPXC8rVCfWgcMinKvxiBDN/TTtM1SlKFg+8z7BCQSr45rNtn3Z3LbGz\r\noBoTXAFnMJWFrS+6zzZHjQTMHlRGjricxDYKJ4WK5ZjcaXFskJwtwoxZTYaE\r\ntUi4Uzhrs5P6A8QDalfcfBro/vawyqOEbQJLLFbwZA64zMGtDWpEvfH2UveI\r\nkIy5qzdM3UAzIxpHrNfiOw5YBjVTVugzcHKkalTD4vLTMgEAHjL6IqOI7ue0\r\n62NYpPjdQaOcLFU8V83w4YTjw6jysPgxWpxkPD3duQ8VhB/z11XUn8BiAGZd\r\nRYK/mrZai6FZHsH9CZw+GosVJoLibVEA2rMXZEnHHwCdfBAiGFRx+KNQjtpl\r\nS+4K1RexrpPRY0SwO3LnLlKAgfSTxr6Iic+QWSc9LH57H6DclX6gMS9ZK0D9\r\nQflYPDBztZZoWd74vircriDEr/79ziztNZ642G72kz4rUyZ2E7xso9aOwfA/\r\nK0bckKrv97pH29aLq97ZnIHV73MWFarGl9CrccfEkcNBMR32aiGtLr6SPEtn\r\nWqc+PUcEUFIPy/vH1NPbYBbQ/k/fWb6gb95vyrAET+/eSQDc3hXb6+C9245O\r\nAq7ia7IxgWyHq0YTPVNwHlDIAf5UO+l30b0=\r\n=FOzL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"df8af7a4f190284cd9f3bb1756b2f443509424df","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.432c815e5.0","@material/rtl":"15.0.0-canary.432c815e5.0","@material/base":"15.0.0-canary.432c815e5.0","@material/shape":"15.0.0-canary.432c815e5.0","@material/theme":"15.0.0-canary.432c815e5.0","@material/animation":"15.0.0-canary.432c815e5.0","@material/elevation":"15.0.0-canary.432c815e5.0","@material/typography":"15.0.0-canary.432c815e5.0","@material/feature-targeting":"15.0.0-canary.432c815e5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.432c815e5.0_1651165045172_0.903915930736183","host":"s3://npm-registry-packages"}},"15.0.0-canary.a0f01f669.0":{"name":"@material/tooltip","version":"15.0.0-canary.a0f01f669.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a0f01f669.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"685f4d15777dde986c4710bca34cad31c8e1b52d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a0f01f669.0.tgz","fileCount":34,"integrity":"sha512-BM6VOkJ3pzFRpUfz62kvKV8isZwu1fK0o9VpKNaU8fceJmvmcOoFFd7swyp618jrF3DFzztnOutLKzNQT5RyWw==","signatures":[{"sig":"MEUCIF0WPvi+yk8HdRioW47+lwZowprABMl/s7xjgO2nYUmpAiEA9Wu3EvlfS4y1kwHtYlSNtTPpup2/K4+lITctgxmEURA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidYHHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlWA/9HvRkhywqWGZprrrDFGbvWYrRYcGNP+s2j1ID5D++RpAX7Biw\r\nzwLn/WsM0nTByDQf/c43RVGchr6qZRmxXqqWahlXbN3BSmA8+8Qulorm4OZn\r\nIUrYpVxLVC9oV70+eWyUzGw7Uutx8HJ3XaldYFzEoTo+qomBQZTFn3qYxaZX\r\nXQaIIhdnZHmJ+Sg4MWhTrSROs6m+XTSSKTEfxHYEzTjQ7xMpDIWmgTVLLT5o\r\nMBSQZO965xG2dLjzy9kQOp7Sw9gWaVs+QHiITJ9NpVBwOk4/m4LD12mLKdli\r\nKgdpJTJWWm+ft74WghRX/BO762raQBKeNMsnfoBoTIwOILBlgZkOgZtrRB3r\r\nAzLP+7wEox7pzhgJtrwMpwh6qOm12DHRbnVNIiLL/NAtRWv1N70cqXEgM7F5\r\nUToCy7X9vIPzNuOUHuWj++m3cofRSLHMri9/nb2DcPxIemuaBdQfMlNBDgyc\r\n4kNxCAq+v7wkSUwSXe7KlXgDKPgQtlg9xHeYbX30bawfmdUA9uZM0op5y2R/\r\nf694Lcpv7TgJfbPhnjqZ5sIhr0OICebV98q/cGd/flnKymVI2XIVGcBtneie\r\nEBnlK248kbLGkIo/VQBYrQHM8JZFRwV3lvRsDFIdCGtd0DsyfdAHxERCTZ7m\r\n0SVF84a/4QZuLpWSOKeYSl1JuhES3DBpLps=\r\n=qdb4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"51daa70df3212a8d73c545c86ed1c57273d41688","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a0f01f669.0","@material/rtl":"15.0.0-canary.a0f01f669.0","@material/base":"15.0.0-canary.a0f01f669.0","@material/shape":"15.0.0-canary.a0f01f669.0","@material/theme":"15.0.0-canary.a0f01f669.0","@material/animation":"15.0.0-canary.a0f01f669.0","@material/elevation":"15.0.0-canary.a0f01f669.0","@material/typography":"15.0.0-canary.a0f01f669.0","@material/feature-targeting":"15.0.0-canary.a0f01f669.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a0f01f669.0_1651868102989_0.896525393169366","host":"s3://npm-registry-packages"}},"15.0.0-canary.276cb39a4.0":{"name":"@material/tooltip","version":"15.0.0-canary.276cb39a4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.276cb39a4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1486accdc569bbdfb4f06be46a99c903c9d35d70","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.276cb39a4.0.tgz","fileCount":34,"integrity":"sha512-vmRRDkm6fZPj9R2YQVK4+9qVam2opmZZ8bKXW/T50QGHZZV0mUJauF/LNoCegaDaKe2P1RZP63Cz2K77d9mtOA==","signatures":[{"sig":"MEYCIQCeXOI8OkzQVOFi8ZkTPgtViIaSksH+4PntqPS+5++ObwIhAK1YRpwWhc5XbXznhYugzcgNQV8J27PcSgjt36BfMyhY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidZPKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomtRAAhZ7nwGxwrOv4omZEMpbQvn4KUPgiCPqRHYuPI/o9Au/oN5hK\r\nD8yDbxklmcr9i/Rui1oHmzNCHZkce4o7OnNshTeaiNTeX8xMr+o6yupoZ8yQ\r\nssEm0SsaIUcfEh/3QSzmo7fNBgha78WWNOJu3j9eNRHzvLDCaqjrgx7MelYJ\r\nm+ysxzLljK7Irk39NllAKWkuisIFYqPLlBcaXrgRYcVS99qGu8EPxrVw5rRv\r\nhItZSV6RCYy+LEce6yeg+k6bDl1QiDOd8iBPJuzy3cK25BIwodeF9vxP6Vo7\r\nOGtYDAsIu9SpnqSZMExeccvMWef5v3pMcue+8Gpb7oRIvEcLdC3epeXaxtYt\r\nlRUAzUrsP8SPl8pu8+StI63iqwgj5GmjnfuVikkz2PU2bltQQdK4W4ynaKY+\r\nU/jpjpQbo9yORgu7/kyYI24v2BBmGZqavbcp56Zvn9FLZwQDuFrlVSOfdkaS\r\n1pblEa8E7tjBTy8EILAOlgXby3pI7noYYBFXK6+yNIS5ep/fNCCHGz+XAora\r\nPt3w63vMUEDt2PjL35Ee5JqfDvKDUvP5L9jOayAHHznkG91FMNv2WDAzjgQZ\r\nb/AN486+TnZjv/DHcfFu/P0ySluKYe64vvZpoSXa4flylma2Y86VbhdTQq2j\r\nYEfg13JcejdcXLJ8uHD8CWcGyIikb2Lel7Q=\r\n=ZW5n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c57cd64760098925aff1fbf0bc2a73d32dd2bed4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.276cb39a4.0","@material/rtl":"15.0.0-canary.276cb39a4.0","@material/base":"15.0.0-canary.276cb39a4.0","@material/shape":"15.0.0-canary.276cb39a4.0","@material/theme":"15.0.0-canary.276cb39a4.0","@material/animation":"15.0.0-canary.276cb39a4.0","@material/elevation":"15.0.0-canary.276cb39a4.0","@material/typography":"15.0.0-canary.276cb39a4.0","@material/feature-targeting":"15.0.0-canary.276cb39a4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.276cb39a4.0_1651872714396_0.5181329860862158","host":"s3://npm-registry-packages"}},"15.0.0-canary.4fe98ed70.0":{"name":"@material/tooltip","version":"15.0.0-canary.4fe98ed70.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4fe98ed70.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dc3327bac1cbe20ceda28eb5553e8709e230812c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4fe98ed70.0.tgz","fileCount":34,"integrity":"sha512-lRO/yY+z8fRmsoF3tlxOfXcbJb4nLkMd8PReZGMeQu/Qlfd7KeIHT4cb5Zal0vY9Wwb2WnkcPvynsB35p5jeGQ==","signatures":[{"sig":"MEQCICOGybQid+46HJV7St8nGD87qNofVLXptokEHdduCwRIAiB+AlE5DyBoTbt17Xq7tLnUnZ70gW2ypBBYhsvSZ3OpsQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidZmIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrA4A/9FuhCiKrML7ilYd5OKSsbsQ07Kfgl9Th21KZ9ORPwB5gBFgxY\r\n57dUr2lCDmMj4AYa5jHL3u2LIM/KvFKBto5q7P6oTgxmiKn+SVd9NHgihcfJ\r\nW3LjFVun6iwf2+c/C7Xi2/PUZ26PeQSbo5yomFLcApMNE58UMEl64QmamQV1\r\nBhVe4ko9RdHkQayzNI2dBoBwPfVCank82cJO1HD1A5AhtFHv4rBxE54tHuXQ\r\neEU9tnkhZ5tOks08AaZmJxmDCz/ldOivlaYBgwb8afVqH1IEWANqJq3iV5tD\r\nJmAUJRlpIe8ZbcPF8lnOR9mhMtULfVMeFlDYpfkyG5jcK0ngby2jJbjZlIBK\r\noq45u3RaaDxpmGST2DEcZwLTzmoruREqeGaUf0X0G19CmFYv5aaRvRjps67d\r\n7wkbyJ+HK1AW4b0PJkhbHawamqMglnRDiT6cBmPpkkx1aJ+yGRe7kCx6YIJc\r\n7Wt7gRz4S5DetRflFMeBSo1kgQvlvDwIKHJEsHv3tw37aZGT9ZFih8Lpa4qA\r\nCMEhxoPTELLUAwnfWy1lEjvkfpnmElhKunv5sUANvF1HFDeaFGOHlEF466BK\r\nUe+DOwmDcKDIlrIn0XOHM84m8GdC3CcwJyDLSqWhF/geU9L8JqyiZ/tl9IT1\r\nSQYIeZacg9UkI5OTo6Arpvzxhy7hfZJBvA8=\r\n=vnhM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"353fde061dd090ede4416fc2477bc050587d6367","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4fe98ed70.0","@material/rtl":"15.0.0-canary.4fe98ed70.0","@material/base":"15.0.0-canary.4fe98ed70.0","@material/shape":"15.0.0-canary.4fe98ed70.0","@material/theme":"15.0.0-canary.4fe98ed70.0","@material/animation":"15.0.0-canary.4fe98ed70.0","@material/elevation":"15.0.0-canary.4fe98ed70.0","@material/typography":"15.0.0-canary.4fe98ed70.0","@material/feature-targeting":"15.0.0-canary.4fe98ed70.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4fe98ed70.0_1651874184558_0.27983701155383867","host":"s3://npm-registry-packages"}},"15.0.0-canary.58b130a3d.0":{"name":"@material/tooltip","version":"15.0.0-canary.58b130a3d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.58b130a3d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a91fd7f7c2de182111895a092c57a648516e112f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.58b130a3d.0.tgz","fileCount":34,"integrity":"sha512-bFznAlTLp+EgOuUxmK3mZ2q4RL6bm71GYMxBPLasPVIL5n4ZjLZFLodvZzzuQ0GhlypB+24HZqkE4uYXNynTQA==","signatures":[{"sig":"MEYCIQD3b9De5qWGO2l7ewmy7zaGjjsXYi1Z6dcvtXCbMNtafAIhAIzXypo8xhiasYi4unvdOjCtK1ZsHfxHvAP6flx8TaCq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidZoUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbgQ/+K0xP7ZtgxosB9lOO90azJV12/ImJRbOirgkOdfdXwdu2tvd6\r\nYfqxhHuLKB6AC0WUXBwtPIdNFfzhAv4Z3CgZFq/e13nbioxa/d9Iy+YcnkGQ\r\n3NylOK+VZapq2srS4FNxuoEEx5yDWkL9mlryY7Qn1lEEFtwxAiUq8ziVXe4L\r\nYQufSroeAWs33NPgVba10bVy49WM69DqEtNKMHE20h2Ky9UbIby+1qbyeHGL\r\nOzWrZJ3k2O85SWqwjxBdlIqJXhSfPCERCRUUX3bdRRe1Of0wDM1ohKhklsRp\r\nMHErf5xOmEwCtMcX93mM4ZhalycZEMHM/B4kszr9yG0Uz3+AEgOcwR8I8fum\r\nQQBG0ODrcoa2UbiGCdKdQ/agDX4PStI1H0klmU/BWpx0evXRV26prn9AQpvT\r\nawAytpTfMXxpuubDAzdXlKQWLPwHDZN4lKHL2sKdWE5yWu7tlMfYD5M5jngG\r\nhMrw9odyknhlWnnlhNKRSjHXiruAVGW7lU8yUogueucMHs2pMzw61MW/p/Hd\r\nrvre/MB1hpOhKgy1WaRTmx/5xUjmdGN8X1G/TooJdk9GdCjrk7xFHJ5n0+SL\r\no86w6/0+j7gnx1WKsbJiw3JU//mgW2vlR6ebJ/W0GwO6K1i8Ss/fuPn6RlAN\r\nMAsQ5Jchg9nrSgCqCSWgSSXKeEk3LqUteao=\r\n=QVul\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"58c8ada7946689a0a59acd63cbd49b6c987c9853","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.58b130a3d.0","@material/rtl":"15.0.0-canary.58b130a3d.0","@material/base":"15.0.0-canary.58b130a3d.0","@material/shape":"15.0.0-canary.58b130a3d.0","@material/theme":"15.0.0-canary.58b130a3d.0","@material/animation":"15.0.0-canary.58b130a3d.0","@material/elevation":"15.0.0-canary.58b130a3d.0","@material/typography":"15.0.0-canary.58b130a3d.0","@material/feature-targeting":"15.0.0-canary.58b130a3d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.58b130a3d.0_1651874324184_0.5080911906801646","host":"s3://npm-registry-packages"}},"15.0.0-canary.ae278a2fe.0":{"name":"@material/tooltip","version":"15.0.0-canary.ae278a2fe.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ae278a2fe.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1d0e260d20014353f5c5384b4ed3e6d2051b7c2e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ae278a2fe.0.tgz","fileCount":34,"integrity":"sha512-92ts9kGaUHXxD8+zvgkGtwqxv6XKB3at0svpkX44+z4OukkYw4k6peZcOx+T+AvZdMevHNnOmrQu1hc9dRuiUw==","signatures":[{"sig":"MEUCIC+Udf3ACYs8ANUQUuzsavlG+D+JUisSIybHxTSZFNMGAiEA/bLJd5UQxLAvEqUJIHlyE/HA5En9l3qBV5XRplkvM84=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieTJHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBEQ//ST4zOuHGGdAWpcP+hIZhftOcsH2az2vqa0qAjxeYGrAin5VS\r\nrZihCJCK5pR6HS0Yry68Gt2ERSa10ET4U/KkQ+m/hNCnpmGMWHl9y+FAv1T1\r\n/Hm8ZKea7bj+khyoLvjo8rJIbpylqW5O/R6/2Rxov+tIVhxlD7HyB33PtM69\r\nO0+n6LZE1Ily7e4cEPkGBmYsqH2gndP4Y0C/Xd/Wj4QcZUnLmeVreiw7KES9\r\n5JTLIoyW95CrchKI4XknqBFCJQvEgtykEd6rHK8M+G03QJj6z8LUnF97Cdzd\r\nrMSLW0wFsTCok4RpCIv/6XMlz2pT0ZAPjCdWW+aY2Td4UqxiKZENne3wmFZ3\r\nPjlpUrgNfATBsJYvo3y3m9ZAfktxlLGTRwHglBh/yfBcUG24t9pYwTSrLQlg\r\nc0Fw7wlbHqjcUVpA34F8XAuYNrZFLnEitFmpUVa7R5Yc9wjphuSwy6PuUztp\r\nJzvUW1XqMeviCE45QF1CiG+VxRbfjRcj3otSn0uiL9pNxP/EPX+OUqB70x8d\r\nmPniAwqflMGReuMm4VtV3iioAIvjmytJvQUnr55rrQbKpieXRzS2pyIvfidU\r\nsCowkc9zpU4a5XObDt0Lox4wBsMlG8Lc3C3xH6xj2+fDLW6O/bPeEbnkWKDa\r\n/crkmTkIgFkcs3WyZCr4I/E7E0xKaKsY1DU=\r\n=Y3C7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"bfd08e232a3a514dd5a38dcd77d17df365502ece","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ae278a2fe.0","@material/rtl":"15.0.0-canary.ae278a2fe.0","@material/base":"15.0.0-canary.ae278a2fe.0","@material/shape":"15.0.0-canary.ae278a2fe.0","@material/theme":"15.0.0-canary.ae278a2fe.0","@material/animation":"15.0.0-canary.ae278a2fe.0","@material/elevation":"15.0.0-canary.ae278a2fe.0","@material/typography":"15.0.0-canary.ae278a2fe.0","@material/feature-targeting":"15.0.0-canary.ae278a2fe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ae278a2fe.0_1652109895005_0.8506085744698866","host":"s3://npm-registry-packages"}},"15.0.0-canary.bebf5bfdf.0":{"name":"@material/tooltip","version":"15.0.0-canary.bebf5bfdf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.bebf5bfdf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"435ddc97f481aefa2db92f4d5cff61ce99b4e30f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.bebf5bfdf.0.tgz","fileCount":34,"integrity":"sha512-Dz9DCV1goB7f17One7eUw1o/B2l0jJmpo0vT/bInBHVbjmihuOWxxU3j1hrqNGTJEWPJu6gV8G24W+T/WxSBwA==","signatures":[{"sig":"MEYCIQCHwa2olcgyb2Qe+/1f75s472/sTSQ6k/6c+baMdADHAAIhAO+vJAVFu/HUnmstWnbxqFqLElRezLLAkWoPBaQjNsw8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieyIsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2hA/8Dwj46X4aw4RZ/b3NECFKR4NoFgqE6ABibcxZJleoDi8kq5K7\r\nunNaBSVPV5byYTHcDv4vBJ9BHR0U2owzY+h+QqEaXMYOXvYWvuV1qEYbO4lx\r\nBg03VUPlgEi7exrRKwH2N97DRvFUGiVrOkQjhnmO8RdPF8WCXpVhS8PhW164\r\nKKzCmfDJex78e5MUQv9gXl3OAIjaGQsDx0PweqIXddMip3wq+l2JYBz0wREI\r\necTIqu9c+8FS3JRaqZBlYOqb8ZEpBr2EVeceGnb4nl8zJ0qySa5PzFDrHZeV\r\nllmX/NM4jqK9BuYrQ0GWKTEsVCuRcJN/cmcWckJBVeMmP8dgd1GxYiBdyIKz\r\nnNxes5LYgkVvtB+cInEXNUVymAzZAtBurBIzNUq2WsCWy3rLEBaRzPeg5b4X\r\nzhU/4xsPXMesG7Ths6IHKYQ4s0jFyP4/KeCDxQVxNVPqG5N2C2voZp1LoKR/\r\nPae4aYByVChsHm3RX6pGcqmcLyEvhK30zwk2Ov2SZf10qpAjTailTauZOuWy\r\nO6t29y55eGPBxGlCwMZuIyrGj//VAey2c1JuHqp6PH9HmKL/p6tw8BMRQpjl\r\nu9wiDjy8Cq3g4n3wFwuwHTQA851OCsN65+ZSZScM6rSJhSCC48eEe3k59eEx\r\nMoxc3xm42Ryk61GA8tc1sSzrKHx6nBm83Xk=\r\n=omRm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"61d3971a411616375c31cb3fb763fafc120c9570","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.bebf5bfdf.0","@material/rtl":"15.0.0-canary.bebf5bfdf.0","@material/base":"15.0.0-canary.bebf5bfdf.0","@material/shape":"15.0.0-canary.bebf5bfdf.0","@material/theme":"15.0.0-canary.bebf5bfdf.0","@material/animation":"15.0.0-canary.bebf5bfdf.0","@material/elevation":"15.0.0-canary.bebf5bfdf.0","@material/typography":"15.0.0-canary.bebf5bfdf.0","@material/feature-targeting":"15.0.0-canary.bebf5bfdf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.bebf5bfdf.0_1652236843940_0.5257402371461866","host":"s3://npm-registry-packages"}},"15.0.0-canary.e6072cd6a.0":{"name":"@material/tooltip","version":"15.0.0-canary.e6072cd6a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e6072cd6a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6b0145a7d0b90dd44c89e8a25dbaa8ba3b1598ee","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e6072cd6a.0.tgz","fileCount":34,"integrity":"sha512-AtfPxyKhE8NSkw0l+pWrKplT2OlW+fbmSU5koyY/E2O1iWmpaxKnscdrrhpVFf//SJmYuZUuXF3I+wR+PWa7bA==","signatures":[{"sig":"MEUCIQCugUOmk+E0oHoSAW2iCM8ptqJxZZ9zqvIJm3IYQBucXgIgExnpmDWb7hoj77F6ViOd8kAEuxrtHfJoyfMsg0VCcD4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifBorACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGcA/+L0e5LtnhuAxU/CF90aHwpthmtXMnlXd1HNHqNsYnSqhLsdBv\r\n7Q9W/c99J8uxSYPkc30Md0CRO04UYFKhACCmUfZt+fa/r+JYCC3ArieiwQ6s\r\nl2CnPPfzN6AkedIcSguuJFqR1kgvRNY8JAls6uRNPVj/iLprfZTYrMIyY4X8\r\nGEfLUrkiIEPYaQ+V6VcIxT571esb1WWDo96O9fx3XSV5M9XV5XeFMw8V5ho0\r\nkdkAgkMadq4pxUui0P9S714io9gJwAEv1aEsaZKGhW2jljr02xAAecXzmA+a\r\nuGYPxKtbNj8/TdAETSRRDX9wbZWxl6WxTdZtlgGiuygKzqTK8Qt3CLgOLgKA\r\npqJxzShX9LTYxTNEGZ6dIeulOaxCsEqJ8IYoOQfioWV5yXre5M4SBbqCI1fI\r\nlTHhnk9uiC2IT2P26XsO1y7F5+43vGAoHii95WK79C7r1BWRcr6VDxZ1din3\r\nEu3Uw3YJsXPLgdKOZ7hkTMFS4TpUW9kxscic6L2PUF6vJn2Potk7SVH9tONH\r\nkn64w/IZlyBFzT3J5HXiiPJ2/72QD+2iBYYaQ/kcGfgGh5/ukqsPD+H6IAP5\r\nPHzoNyGysgUc+OoTosiP4d7c3YLBd76emkrEKIIW6iw3m+ckhhy2pwcJUc90\r\n55Py3E5iRmVck/oO56SwuJhDXzLdHX5K/x0=\r\n=IDr/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ef2da678e66576709be19aed16a880b00e73a039","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e6072cd6a.0","@material/rtl":"15.0.0-canary.e6072cd6a.0","@material/base":"15.0.0-canary.e6072cd6a.0","@material/shape":"15.0.0-canary.e6072cd6a.0","@material/theme":"15.0.0-canary.e6072cd6a.0","@material/animation":"15.0.0-canary.e6072cd6a.0","@material/elevation":"15.0.0-canary.e6072cd6a.0","@material/typography":"15.0.0-canary.e6072cd6a.0","@material/feature-targeting":"15.0.0-canary.e6072cd6a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e6072cd6a.0_1652300331580_0.9382491895597178","host":"s3://npm-registry-packages"}},"15.0.0-canary.5b40eb988.0":{"name":"@material/tooltip","version":"15.0.0-canary.5b40eb988.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.5b40eb988.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fcd5057ac27a8a7ac3c16cceaed59ac3882aff89","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.5b40eb988.0.tgz","fileCount":34,"integrity":"sha512-ruNdL4wltY3UbfWlTbNs5yqzZAUqP2vrt/GnYVmZsRTeq7Nqot2CpZJcSIWXbD37foMcuM0tFbsVZWISwpzqbQ==","signatures":[{"sig":"MEYCIQC5HD1ayxsVV/oQohY47WzUDhdJssNgAaWSCza/olSBHwIhAJR6QpqZRn48hs9kunwP/wU6A4fxqk7cxCa5F3q1PElN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifHSWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTFQ//Xv1ZY8ohteMzAIHenU2hosDwLEgf3/Iv3Pj7HZPZ4WkITMxQ\r\nuYbowO/JM5O9hmpM0yKzg4/gW6a1957uXp2k6wS/9uufMQ6J2F46QND7P+ug\r\ndUmbtBBCFTeKjp+m3pF4j821sVz3EZePm2NuCZly+DsU8HENE0rdF7RjcqYU\r\n/M9zTQlxYwttuTnuf4CsJDAuub9NyH8TlZDLW0fUEegGeqQyXMT6zz6+ROOE\r\nU7N6vPpNgyEpR6JU8rG0EOY+GPhuJdXNz0a7TKWhatbXbkmmO8Vv6l9VA6SO\r\nRM2z90wtEl5zAJIMgdqoxTVSsNVf0s5RGgoImjkiifeQZPnXBvmtMA4DAVAa\r\nRLQPI/wmEGTpQ8gchOBqDgC5e4WhI5Juie0/8WsmF3btNIFFPkiUSRszaADK\r\nqVkdPtFGffvg4KCTqaUrdJhuf8EL0inw4Hupu4h9j8jMS9FcdGjNso5gZJ/u\r\nBv/ZOfetyhhltWPTv19bHZEJULOrlnInejluIKV2R0EMLvBwQ0rZ2Qh6ikDF\r\nVrvq9LOFUYz+qo7/KKz3VTJO5bzmZgZvDKa44jPU+8zqPhNVwQaqVEdyldPQ\r\nAIqrxW6wKUiNGRRbwZbchmv94tZMgnaH/cVsI588ggwHQ+CMoMaZVLpidQUF\r\nJqraYc59xcqm/dC7NagJ09szFlQg9KKQIOc=\r\n=vyO9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c30f2a613c97ecb48fd3f9ad7b0677e51a156449","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.1","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.5b40eb988.0","@material/rtl":"15.0.0-canary.5b40eb988.0","@material/base":"15.0.0-canary.5b40eb988.0","@material/shape":"15.0.0-canary.5b40eb988.0","@material/theme":"15.0.0-canary.5b40eb988.0","@material/animation":"15.0.0-canary.5b40eb988.0","@material/elevation":"15.0.0-canary.5b40eb988.0","@material/typography":"15.0.0-canary.5b40eb988.0","@material/feature-targeting":"15.0.0-canary.5b40eb988.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.5b40eb988.0_1652323477939_0.21263454919996527","host":"s3://npm-registry-packages"}},"15.0.0-canary.6a61d62f6.0":{"name":"@material/tooltip","version":"15.0.0-canary.6a61d62f6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6a61d62f6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1f2992fae15723d57812e578ccc56c0a2c84e2b5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6a61d62f6.0.tgz","fileCount":34,"integrity":"sha512-NSPNWWftY4aGrMtz9wOQkbH4WLmpRF9s+NOC0eXW4PMUR+9V6Yg4VPbwyK0o/NrvzwcY/T2gJ8it4VqYTeHM0A==","signatures":[{"sig":"MEUCIFEHePSfazdU5GIPEP9rZb7owRITCkHK8JEtm1/LhS1SAiEAriVhT9lZJLwtp0zrxn905AdpmiLqctwHjodOHPBXBag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifW2kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgKxAAizhrr4f9DzSJMCUClyeXfiz02WTbQ6z5p7QQUlGB/KCiV4yS\r\nnjg59a+jqwiGDiT0ZKqK9R0Z6LxlNIfXjFo/m8E2u2U9Fx/SKLpozNSJ6e8c\r\nIhbmb9aeZDwBF7iV6AcFdIgIoQ6EfuxxHg7ZuNPUDvkzpF7MuttM3tKVPVRT\r\nwf/pFLC0T4VfSN+bN3gftnH5M2E592nwbxueFvPrTDWUysXU936oMWEKfmE0\r\n3nByMJIyYXhPVLrHiN/N7BkPruu8z7+rzNAFCgUASmjRbqoOPuXko3On0pFL\r\n7Xp/H3kMd6+8s9XSGWkhIOtKjbghjSlnaNWqzTnp3bSaPRT7ZTg0e8Fo0bPK\r\nx3K3eTZSzmRmNTlX8z0cpLapMlVSZ9C4e2bId1SLD3VNSUsZmxSz7LZddJpA\r\npBNPYeZ8pJUYR7daKayb3LG8BKsqdul4iFID48T4SNBs2h0KzNNhKWlXNWoc\r\n6GayGr0QQu9IarL0cdiQNENNhQR+b75r1cqhdXbdBlbcBjJyWSZDEEn2eGGr\r\nLxfyyJVoRstMTubo5JTI1sKygGlhUeNGGWye1uTQo7iaGeAjmBn/zIDEx1dt\r\nYRxGKAAYQNJ09F8Pn18kG6XsdiIVRXL/X8hP1HHFYNScO8JLXvDSsbeRI1Ps\r\n8OipGpuDFRPsWx+kK3lSRBj0Up39I23aUjw=\r\n=5IOe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1d46f0951ee9f725b870919613271f00fcb1b521","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6a61d62f6.0","@material/rtl":"15.0.0-canary.6a61d62f6.0","@material/base":"15.0.0-canary.6a61d62f6.0","@material/shape":"15.0.0-canary.6a61d62f6.0","@material/theme":"15.0.0-canary.6a61d62f6.0","@material/animation":"15.0.0-canary.6a61d62f6.0","@material/elevation":"15.0.0-canary.6a61d62f6.0","@material/typography":"15.0.0-canary.6a61d62f6.0","@material/feature-targeting":"15.0.0-canary.6a61d62f6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6a61d62f6.0_1652387236589_0.25237022530453546","host":"s3://npm-registry-packages"}},"15.0.0-canary.05930a453.0":{"name":"@material/tooltip","version":"15.0.0-canary.05930a453.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.05930a453.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2ff9574ba696b6afcc34ec7d8cca70ee0b037b20","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.05930a453.0.tgz","fileCount":34,"integrity":"sha512-CDYK+0p3ejuTHJ6154vRMSCWhSXrsotqxt7XIeL/4DrvJyZp71loh68K6I2G81ovNyK67n1shenJVQe/6xkf8A==","signatures":[{"sig":"MEYCIQDtzhibFmjBboPNPZyLcoaJVyr7yyIwdhj1O271EmbjtgIhANKgjl3FxF2bFt50gWhtJKpFZ/pCGClQqzSuzgY6/Xkr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifqfYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopQA//aAhZhaYFhJe7zEgazT4PtWz2EZMNHLY1pVIGsbcjKu+DXrWi\r\n+KBEbl+mXeT6hu7vrYPPpcU75PquI8UNdwcqDAlAT2KkvBuL7cw/kF5gLlFi\r\nU0ZraaU5dc/nTdGm1CqzwcpUleo7ar5ZeRjh+LZkSekn/2e8vtVNe0s2Anvf\r\nUIMDw1xAonNDxu3a7zV5ePqJyDchWQK3TB38/GIzRztWX4X1dFqKJfn5Gp6Q\r\nNcfZXgTF1MVPM+U6iE+6EKhF+6AkjARBvOKZWxhuCevQE7fa1dKwhHD+NuM+\r\nMDS3fEJssT4rwPvPvjwCRFFFYpEXFzQDMaSUlm8jLGckd/Ih/ktB7nxubwBY\r\nuEGgn6JnfVlsX7NQPpnHOiZBvQmKwckaxyNAuMd/ipRzCOapuf3Pa2ZJWcmk\r\nXyg69t7pV0F6LLpqi59vxKk8mC+cmiufFwRLKi5+GFj1qVGB/snzrV29IRQ0\r\nkuGd71lwJ/QP9pEPd+PHakF+UMrelyLnfw193z7t1qaCknkTlk5KcVtIR+x4\r\nmTXp9V/qQYtVS98fD5JA/l/myjX8YZe+rJdXPbBswzlFo4ZPiJtLg/LTBCdg\r\nHCHbCJ1kryAMIafG6tstxZRdaYtcAZKyAEEK21QIPuxLirjAOYu1AH9aqsRE\r\n2bD6rWdHIKgm5/REfNLrRgl9tF+deVE21lI=\r\n=i46j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e6dfc2d0553321fbe47e71fb414cfc1152b0ef8d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.05930a453.0","@material/rtl":"15.0.0-canary.05930a453.0","@material/base":"15.0.0-canary.05930a453.0","@material/shape":"15.0.0-canary.05930a453.0","@material/theme":"15.0.0-canary.05930a453.0","@material/animation":"15.0.0-canary.05930a453.0","@material/elevation":"15.0.0-canary.05930a453.0","@material/typography":"15.0.0-canary.05930a453.0","@material/feature-targeting":"15.0.0-canary.05930a453.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.05930a453.0_1652467672312_0.34863846068515536","host":"s3://npm-registry-packages"}},"15.0.0-canary.c0a11ef0d.0":{"name":"@material/tooltip","version":"15.0.0-canary.c0a11ef0d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c0a11ef0d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fcc84832410ae804b1244367d16e7022731c8410","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c0a11ef0d.0.tgz","fileCount":34,"integrity":"sha512-/k/g9iq8BrV0TfG7Qf9tqJXDeRkG0+Ns/ahuFbb+aHCd6v4jOcbcbyC0aUQ7pBvoNKneTRYuVmSs+ErEnGMEAA==","signatures":[{"sig":"MEQCIGVbYKVBCVjBhUKK1w5T4n3yuby5jr120bRV6uHw/U5AAiBoksI72IppqYiaehwEzCR4BKs+x9OQHRAPcsQiXWPCEQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihWy0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGWQ//VDsfICRilTdpjpKKy9RQ9T2IhkgLkLNpUU3LLeSvdP2WjLWm\r\noIE0hO3W61ariUW5vJgciDRGpxJqM/5/lJjRSSEqYjmZAxoYPubV4x5I/O9i\r\n6xDCA7gIrepWIqUiIDAGAp9MiFpCDJ73B6sMYV4tI3E0JqzuRc04PSgqZ1NB\r\n5RqhqSuqJ6JQlnzDEyDxLPtc4CvdW2+6LDyF0lkLcJazeovfRz1aS4RrXkTT\r\nYeopSJXtjl4nJ0l7mtg63DmzeD6Z+SRItgyAfr63iyE6XTd0uSmvd8ucxxCv\r\noe+2gduVwBzp8SMGrBJWxB5lIsL+PI8YGjT64ey+5zzxoxj6VuGDTkPn0/C7\r\n61eUEYnDaR8uLyLJYKpB+ay61WiJDrpoJgk0Vk7r/9BnCC3uDwy+GqG+Jiiq\r\nW21kc/748yADJgX7U7oRG9pWVlClcrgtKRE3pJr6HvsLd4T043YT7EEN9WHw\r\n157wjNQeScYcSAXXUQyZmv8Ix+Ku89Bf/N+tpTH2Ov/8oTXSgJfyruhLiO8W\r\nJH7t1e5ExZ++wC8wmSNmwIl4e90efUOrddkEQvRLrMIEE2mW9qTCiQ063JNC\r\n/5p7QFbkGwQHr+mSBoZ34shgRkevEz8cjaUsoaHnGk2Dkjd/So6226+JlYlU\r\n2xQlrK+nYDwvq3X9i75MtHJN/oyVyOlksmA=\r\n=vVj9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a97df68c1dadba0530f5fcda79fb8bc3082d963a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c0a11ef0d.0","@material/rtl":"15.0.0-canary.c0a11ef0d.0","@material/base":"15.0.0-canary.c0a11ef0d.0","@material/shape":"15.0.0-canary.c0a11ef0d.0","@material/theme":"15.0.0-canary.c0a11ef0d.0","@material/animation":"15.0.0-canary.c0a11ef0d.0","@material/elevation":"15.0.0-canary.c0a11ef0d.0","@material/typography":"15.0.0-canary.c0a11ef0d.0","@material/feature-targeting":"15.0.0-canary.c0a11ef0d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c0a11ef0d.0_1652911284463_0.06780339695260706","host":"s3://npm-registry-packages"}},"15.0.0-canary.2f9b268c0.0":{"name":"@material/tooltip","version":"15.0.0-canary.2f9b268c0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2f9b268c0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4a84718d727600778c84d84ca82b67f96518c9bd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2f9b268c0.0.tgz","fileCount":34,"integrity":"sha512-zaLK3minOhU7UpkWnEo0UbqL6gfkd6AuiH7x7IXxn67C04T1bP58XjGepZKrYfDMzXN+FwPMN4FqUlwpGs2D2Q==","signatures":[{"sig":"MEUCIFrWHJK8OOfz10vqh1M2B80/E4Qff1UI+dH0mvWphpRXAiEA8WdKEFZ1ZqLXrG/XjsmMvu0gO8eBX6pozBF8eptkuak=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih+zyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4mw//UqDQ8p6S3bynKshVObcWhPv5RAuyTQZY87/kPirwit27b9jk\r\nK+ezyD9J9tfqqzuFConygFQREmpnWwSCvTE0tAObKcrHA4ba6SLvdAuosxdb\r\n30ty9jRZlFUgQpSUabBcOUkvXeRXd0OnYN7O3D2SFVrPwBIFaQe+XA3QkoJh\r\n+q0xLMgGacLshzRiysG+KTgPUjBj94+ffniDaGAjUVyBvwykvo8NoZtzZIMg\r\nz1jQuEiZjM6sfk1bYwOzXoWMDHzhA8+M0CpQQiVw5Cr0lBUAXdazLWRE7/vD\r\nL9WyLDyB8Dd9e4F/pQImLoZjSn7lumPhxU2kNHtlwuCiuCg/xr1UiPGRSTBG\r\nMVhwXjAb0V0xzDRVNFfVok9gZNpHyGsOC5PaaknJBcD8SynzL280yF+1HHXv\r\n1wMzVLE7f3a0iOBCOhi0ki6FvJ2UY7PV1YR9+IuWDtYshaM/czpJ2/jDh3zT\r\nV1J3/RZwLgXWievS++d0sXLw4TI91m3VUf7qzILMK+/B9o50XWo9saGdkQ9I\r\nFrLWFBF+bQb7IUROn/0c7DSgIH40jRWEHoYrCJRWTa//JA/xkDKcZRNvOAWy\r\n40//UNoX02f3+ck1RqtcguTHHyfmBMVHjVduaGselro9D8N0TL8DvVQyHNKS\r\nHs3njmA2Te/Zzs9Xk4TTbWcNK7tVhuEJqHM=\r\n=Ko9r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"29832a4f010df39515e01d98656d2e77ac1e47e0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2f9b268c0.0","@material/rtl":"15.0.0-canary.2f9b268c0.0","@material/base":"15.0.0-canary.2f9b268c0.0","@material/shape":"15.0.0-canary.2f9b268c0.0","@material/theme":"15.0.0-canary.2f9b268c0.0","@material/animation":"15.0.0-canary.2f9b268c0.0","@material/elevation":"15.0.0-canary.2f9b268c0.0","@material/typography":"15.0.0-canary.2f9b268c0.0","@material/feature-targeting":"15.0.0-canary.2f9b268c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2f9b268c0.0_1653075186648_0.9030620110752696","host":"s3://npm-registry-packages"}},"15.0.0-canary.7741345b8.0":{"name":"@material/tooltip","version":"15.0.0-canary.7741345b8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7741345b8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e85fba7da879fc3d8247a8e0ad30336e796bc23","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7741345b8.0.tgz","fileCount":34,"integrity":"sha512-/H7QdXuoEIB6xcQOC04TT6T7QmspxG62ZRYaiC/pj6Arr1QjTDCAEcqBYF7mZVtzlps53Y3RvF7O4Tg8+8RrAA==","signatures":[{"sig":"MEQCIA7cTMl3KyK2x1Hp9KpZg/aas7uTudcj8ccISpdzexBhAiASONr335JN4BQDiHl+hHNA7m83rimYd4FLX+caf0bfIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih/P9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqeoA//bL4hfHb87n6pWaQS2EALxJFMAkLCS+evQ9lR2w/h532x5b8i\r\nUa0jfJTQRX4T4P4hvpfNoT1HhxqHjgwVf99wPKJ26qCXBFGKaU9Xp6tsaTZ9\r\nU3sjhLoHzx8jZ4bmE4ALwEB0/RmJkSuhj4ZYH4hMOduX16/kUnR96JTac/Zf\r\n0vH/ZryU5mfCO9mXHm1Pon3iaGdvLFXK2Md406wH3jnQSg686nDDNDn4lFuZ\r\nkqlIHMdZTnrk2C/DzfElaLY/uWB6pyhZymMPr1EHXEnLRLbtqJE/c3TzeeaK\r\nJN2qtOJpDHRvwwyFX9BHF3YASbVIpSxOKQVEy1IMmslz6Z7CjKTzQFZiUM1M\r\nDdZX6Drjm44Ut3CBilYRdTf4IbjGEl/nipsl67rveArgzSDYfZGfyceXHfUL\r\n91gpaXW+ngEi/opP/53Mg4qWfj55hqDt8Vdbyj6SeI/bevaPPre/A21HkiPX\r\nf7zCokcJ2UQOQ1CNchPVmdEBBsQ23hAtpscNDDWQjkCj2kPxxLTPljeW4nmV\r\niin6vjD7AnAAQAptBmc9CU2b3bVi/izQaMANnLhFADh/S7PchKpKzstjCJdS\r\ns0+zvITJnSbVRwT+YRLvu5IeaItGgIEfPwWbn3bdoLWY9h3RLE11oIPNOJkA\r\ni2GqwwuOk5qXv6o5FaWqAJsbkmG8u5LXm6I=\r\n=ehtZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2e61e5e8196d28c1bd4d1c7a12c242276c1d8ec1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7741345b8.0","@material/rtl":"15.0.0-canary.7741345b8.0","@material/base":"15.0.0-canary.7741345b8.0","@material/shape":"15.0.0-canary.7741345b8.0","@material/theme":"15.0.0-canary.7741345b8.0","@material/animation":"15.0.0-canary.7741345b8.0","@material/elevation":"15.0.0-canary.7741345b8.0","@material/typography":"15.0.0-canary.7741345b8.0","@material/feature-targeting":"15.0.0-canary.7741345b8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7741345b8.0_1653076989273_0.1053759536107517","host":"s3://npm-registry-packages"}},"15.0.0-canary.f807e793f.0":{"name":"@material/tooltip","version":"15.0.0-canary.f807e793f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f807e793f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c04f693f50bcfcb0416b8fb9d8b704148bea3ac","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f807e793f.0.tgz","fileCount":34,"integrity":"sha512-eVSB4THGNofdb178P3cHaGM9zZn1uT7DIojNCc5JrL7FbqK0v9pLLxSEHSaP7jK+xEFclLRFLeXnfcyRjPXRpQ==","signatures":[{"sig":"MEYCIQDshr+1hPMBCpCi3j1hsF8wiBvAQv6QBwr18qTavVZiKAIhAI6zboGi6Y8hDRCf3LZDdd69+Cyb3s23Gch8OSISJwSf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiiBSCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmreFRAAnttJmK0RBITK5fFx+FWluxtwF8YINSlAQ9z8U8knu2U/wS+Q\r\nss+giKXXGdsvxc3tl5Raog2ras7bFywa56R1XFpypfb00tzRHq/P4mVKO6vj\r\nhj0QaHYAXQPF4Ct9XWKnvaHmwlnrpSfVPJrLGfrsMMLM5sZ/dPmBFjloK6JH\r\nU8ZYAR0S4Zy3uUlL4NyddQY1xbnnPU5VKD+qOUKBSrO3Y96UNih87BnBTgAJ\r\n1wsFzJg8yNTYTyoa1vmySIQLrooIdvXPbQYGTmoNht7BYacXX0cFEZ/qhSsH\r\nXrmAHHTVMKgZLeIdZOxi1biRfedb2m2MGVsb/MPXnUVL8VTGY1N7u/kqFklr\r\nKPZ/zh493V6uge+RvUfAgn2mLmjBh3+aO/9IgNbfopNlRN2RsbkZQ9LxGndp\r\nXEUtjlBI0WcD69fF61AjdZzktC8+Ev+UFsEXhRGjBZaOM9wOQa4IEPmV1z/R\r\ntoLk0ot3CNxJYaYcmNN/h+ohM4I+/ZNRu3Yr839egxANVNtW/25Hb1v7dRHW\r\nI8jWa8YqqjqhcVq1MADqMllCrmXaMWw3KYMdtBkZiJCMFPueX2vL8EN5qJKO\r\njyPH2KDSNWhG0Bzl7G/or4YGJSHJDV93AQoQZwi/tQhDpUal6UZ3srktlTW7\r\nDIUMq2qaXTuTB5+5IqR1QSx6B4yAI4WXLxM=\r\n=PmuF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b4ac5ff59e90b4770de9f689d9b09381fe2cacd1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f807e793f.0","@material/rtl":"15.0.0-canary.f807e793f.0","@material/base":"15.0.0-canary.f807e793f.0","@material/shape":"15.0.0-canary.f807e793f.0","@material/theme":"15.0.0-canary.f807e793f.0","@material/animation":"15.0.0-canary.f807e793f.0","@material/elevation":"15.0.0-canary.f807e793f.0","@material/typography":"15.0.0-canary.f807e793f.0","@material/feature-targeting":"15.0.0-canary.f807e793f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f807e793f.0_1653085314660_0.28931209119542434","host":"s3://npm-registry-packages"}},"15.0.0-canary.9f53d4a8a.0":{"name":"@material/tooltip","version":"15.0.0-canary.9f53d4a8a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.9f53d4a8a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4fe253a60b3491bed61897244e1e9dd94bf885c6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.9f53d4a8a.0.tgz","fileCount":34,"integrity":"sha512-WyIM4QbS2zO0GTG7uDO5TXNTSnQ9XZJqMKUgZ5scjPaR7T9krXzv2Uxhfp+YpQhDeItdTD0pyj8N+veDwgkTRw==","signatures":[{"sig":"MEUCIQCZOrCJPK0m7vqZLvK684On+TDLq4D7190bEjZogLukpgIgNrT2LovJ9azVLbWZMhrxeD131v1lqu+f5aTmPymoLzg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii6EBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoWOw//bmA6z+Fxz0cyY31qOUkkkzfL9fBOSKElN6TJywpOnyGL70ua\r\nVNC+Ei1/cubVymZRdNlrit4B4YyvXnCz24gHqa1ZMIT5zlRxWprawo1W83ie\r\nu0BpZT4PfS2AWC3vTLrr5/yLBkW5R+do/TNq6fWQoKUZCJkVZA70TNRpH/gK\r\nxQjwvMP32rNUc4dOnKICtANCwIUEN373NN9ZJILM2kByzBFi2k0R2reZoyms\r\nHf2/lrLvuJJ53Jac3+GAym9zq/EOcKFyd+AndXwC0vUYCNTBekvFmctC2UE6\r\nRs+Bxik3swGN4LnmyCEJRszCjv3/7Dj0I5evwTmF1IQO5K28polh5NEasGT1\r\nu4CW8HoP/RdNYLMIJtVauY31nNCmkYcRvZF5RUquygNa40jSba8q2YwPO3gJ\r\nDT21lxK08suU62i+jZBJxH11C+CaxHGEIE5IA+WPvDStW29CBS7RXqItJZCz\r\n19EbfdVoQiAWg14GMPAA3g6oxIhVbS79IiKX7HRhRvfleSRN0AvFqfgLlMmM\r\n7j3b66xcIZ14CnqU87mf5ChyQFSmJPvlRsFzUKFkPCXMTSDdF/MpeBlzzsv4\r\nDcRQdBODG+d3mKmeyf/R0pT4lLIHH+whqA5Zns9omKu1wWTUJhZGKiXRaT4y\r\nzDn6o9DrwY1rjkUy4pjHjr65pGSM2vgY+xE=\r\n=VHtR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5db1bd7747bde68bc956d054f2e939e62c78df6e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9f53d4a8a.0","@material/rtl":"15.0.0-canary.9f53d4a8a.0","@material/base":"15.0.0-canary.9f53d4a8a.0","@material/shape":"15.0.0-canary.9f53d4a8a.0","@material/theme":"15.0.0-canary.9f53d4a8a.0","@material/animation":"15.0.0-canary.9f53d4a8a.0","@material/elevation":"15.0.0-canary.9f53d4a8a.0","@material/typography":"15.0.0-canary.9f53d4a8a.0","@material/feature-targeting":"15.0.0-canary.9f53d4a8a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.9f53d4a8a.0_1653317889557_0.23618020582047938","host":"s3://npm-registry-packages"}},"15.0.0-canary.77cf00e37.0":{"name":"@material/tooltip","version":"15.0.0-canary.77cf00e37.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.77cf00e37.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cf89568868b14ef14fbfd3777b242ff5f64d73be","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.77cf00e37.0.tgz","fileCount":34,"integrity":"sha512-9bwcfIFwn4J2W2AnRZYFqE7XSDtVudwE5sgqpEjeiBIw0U5qOJB8MVJ4gzke0JG3f3JfxZJGALfLLBP9hM4s6A==","signatures":[{"sig":"MEQCIALJJZE3IWuBDEQ14xcIwmoCRl3HfYy81b2FyF5Qos94AiArbvkwZ6DeruBfCa1E+RIKTgJAXOGcPULsqmWZuRXiJw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJillMMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHYw//agLOOBf0JkGilVEsJ6bypmpw8Xu9rSLzU2QBBnL5WQNnINND\r\n53oPGMMJCzj28ObfFpfAuH4DALWh3M3rufY5qgErivbBtKyCXCK/zP5v3FS7\r\nbl/qr7JMwzp+PZg/lPkGNKNLlhhDM2w+VWCNY0U2Tg/+ow+avaRNBSEluGR2\r\noZZTWzIO6ZYcwo7GMWyAMiCkxmtVPhD9rrvIBKLNlGa7hVmkWFpFZvvtSkla\r\nuExz3hFQWu6FMWxjKV5BGQeO2YTSaR2pxRsJa/L6vaMYYRYBL0F3eU4cu8te\r\nf9n3l3xG76Ul76HeVpyhms/TdJ5795tk+nqdDnt5bfKqILa2yvSfgtpd6xJS\r\nomg7ZQXZMEvIOq+R93NNgYnVK6qIFo/a7Bg4jg748kpT/y+sxvwRaWdF3zQY\r\n7OYqB7G1jP7GV80ZPNuPohCDzZm2MxarjJ+7jM2H0GCau69MDweXZRJcVh9s\r\nkovSjGan29+ZaPKmeAjigzid+shyE35vhJB8KoarLHal3/4jUFfV0fXF8C8A\r\nyZ43lxHYFwB0LUkR+9BUtOb/F4tZyC9TM3Tbpo/426nacL1B8mYEuuFJOxoc\r\n8NEzc5b5DnWsvP7lR73QfK+7Qau7u4IsyqariGU3CPlAmJAj8IVXJk/Kbx8V\r\nQvdlypLRQhyAQ/ZIOxgGfLs24f2tFgmg1Ak=\r\n=ycyB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1a68e64a5e78b8bdc529142c18c028aaf1b15b9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.2","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.77cf00e37.0","@material/rtl":"15.0.0-canary.77cf00e37.0","@material/base":"15.0.0-canary.77cf00e37.0","@material/shape":"15.0.0-canary.77cf00e37.0","@material/theme":"15.0.0-canary.77cf00e37.0","@material/animation":"15.0.0-canary.77cf00e37.0","@material/elevation":"15.0.0-canary.77cf00e37.0","@material/typography":"15.0.0-canary.77cf00e37.0","@material/feature-targeting":"15.0.0-canary.77cf00e37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.77cf00e37.0_1654018828107_0.3402222291316088","host":"s3://npm-registry-packages"}},"15.0.0-canary.3c7b844c2.0":{"name":"@material/tooltip","version":"15.0.0-canary.3c7b844c2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.3c7b844c2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8cc1e88a5fdeb2f40e675c85145139b1b68849b2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.3c7b844c2.0.tgz","fileCount":34,"integrity":"sha512-85Jigz3p7n/q3BCGHqTvbSUqIbTZ93nW8r53NmQldo/4a2YCzZnUpYrb7P7qG5fynWoLCIA5vnG3GVaLV1LfWA==","signatures":[{"sig":"MEQCIC9lyylwIwY+/pfGWM+ZB8gnztbB0Vw2dzHmnLpWV/WFAiBZ3e0l4DgO+GRGW/GHez1N9b7jiNrkmavW2iTNwnIF8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJin89oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4JQ//TS29PUoDWyC0oAlKmARlq3BdNslMEkIe6o/6QsxdJwLE0Uzp\r\niUQuOCUGtSHP739mnhbVUqOq+oTO4f98bu4GHzNQSblCXhno6ZZT8GkIFPyg\r\n0FnqH0l2/AXmO0+ZZgYLFN1BCf4+13ZnsEpcZVLsHbKp3IgbtUgz42FxpaoG\r\nDLJOdJPXIczo09q7oSX2DHF/BzjV4W1dJMTkpe7av8yw2xkfBXNDk/G0PjkQ\r\n5Y+SeapLlo4iVQHysWCRZoYk1ffuBynhhq1oCe605tSkNGxVI4KmrH0jMzye\r\nC4PZ60TbeAOWP0EdXsMzCby/yPSDKnWhGYPJlCIsyA3jwdONPpSU4yvjkdkd\r\n4fJ5ifhOWK/JOtIcUNOinH8sh+brb28sKm/AbGdyABaX68dFs5kDAgWIV+oy\r\nUOUqSpalJSYaog7rrNKT1VHI6c25DMn4QwFdGJwppsXkYw5KMuFP57CNFqba\r\n+IF2zhvRa/bOSZxT74N2Gz5e8yDv6N3CVgEi+A/v5TwtziZtyNwXvWhALkUh\r\nxrMegeGkf8C88YjnbbWq9x+vdhKsjD2CmwGabnK7OOdsRKwMi0Wq13QK0s+2\r\njeIuXCSO1Qsir8SNG0a1+1QiygETYlqgxxWAdERJumJ0Nv7RxEVrvKI7tpci\r\n8whyous7bWjzYMDOjVwfMJ1v/3It3WGo0aw=\r\n=+IQi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e9422b2e6573001fae4c8aeb7cc75741000e0034","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.3c7b844c2.0","@material/rtl":"15.0.0-canary.3c7b844c2.0","@material/base":"15.0.0-canary.3c7b844c2.0","@material/shape":"15.0.0-canary.3c7b844c2.0","@material/theme":"15.0.0-canary.3c7b844c2.0","@material/animation":"15.0.0-canary.3c7b844c2.0","@material/elevation":"15.0.0-canary.3c7b844c2.0","@material/typography":"15.0.0-canary.3c7b844c2.0","@material/feature-targeting":"15.0.0-canary.3c7b844c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.3c7b844c2.0_1654640487999_0.13378969801672946","host":"s3://npm-registry-packages"}},"15.0.0-canary.df47894db.0":{"name":"@material/tooltip","version":"15.0.0-canary.df47894db.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.df47894db.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"72c28c54552100aed00b4d41756fcf7aea1fee18","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.df47894db.0.tgz","fileCount":34,"integrity":"sha512-hHjqIBl0ovlwoN++B1V9vJlqeQ/8INmLBN/JoERnMZf8wAzKu40RnamRwCufJ7fc8VORoQCCSHNgynbfQYPc1w==","signatures":[{"sig":"MEUCICh2kPDZkEUgKZYekQ3+wkV2NZ8UqV62YOUNhEPJ6o9uAiEA6D/H/KgT+4keV/qo1onS0wOAqz4GtSY4Q9zP9y9+2VQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJip28pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSOA/7BPmCDMAsSoaBMUuyqqXIjUN1RwdSljyJipbSFX5mBhNAUO7E\r\nELxKsXXiwdnltQ2eKz+hTMFz7ImI808oGAP6IFvQy3miBJYJ9KysUxJ6WZ00\r\nVR85qjWdXPRnedg8O+vJokBJOzZm2lTYdPHGZo+81i7TrBI4C9MZPJEN8cl4\r\noSzYzhViuwv9hE6hfdR/JVcsybNzSM+1jzRfehptRNzyLqROgAnGrDI/G4jT\r\nTXTZKqEyGsSrik1sUNAuwAy8QqQQamhlsKOEWFlhD8OphDnu4wWolbB3YLXn\r\nHt889jNNRZDiEKi3Sks1ugE+zBdfYdl77LmFj6L9avNI1EtBfCmsynZOlkEZ\r\nW6RJxfdH/k9L5OHhn1Y/GDflnMwp6ciW9OiqL+iW/hNpJjGtU6bC8P8pTz5B\r\nwdlA78r1QD0+SKxnRjfB971VCexz9ArbMRfMYTGjhjgaXNxDRoOob1VUsSEG\r\noPur7HQlBApm//fyShgk36A3PrVSH5S2zv0e2nShRZXF0OFcWy3YZECHpi/k\r\n9pCFZNFzKecguQFcJhpa+5hwjpyGGf1U0LfHNH1ZgB/b95oZ+LuGLABb/9N0\r\niyoV8iMBTDOzq6NCetnhgZrtvlMbfQtEaUiSDc8dDRLiLn5vERL1Uf2iQuJP\r\nRo+0dIqB9uo0cYruxmndU6imSqxFVVL+TZg=\r\n=3IJD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"42be62e51a7c150444c5b32b2d2acee03d09e6f3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.df47894db.0","@material/rtl":"15.0.0-canary.df47894db.0","@material/base":"15.0.0-canary.df47894db.0","@material/shape":"15.0.0-canary.df47894db.0","@material/theme":"15.0.0-canary.df47894db.0","@material/animation":"15.0.0-canary.df47894db.0","@material/elevation":"15.0.0-canary.df47894db.0","@material/typography":"15.0.0-canary.df47894db.0","@material/feature-targeting":"15.0.0-canary.df47894db.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.df47894db.0_1655140136965_0.5922635165431782","host":"s3://npm-registry-packages"}},"15.0.0-canary.b18a873dc.0":{"name":"@material/tooltip","version":"15.0.0-canary.b18a873dc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b18a873dc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f64d6b6f5ced87b9595254516fa68a967d29b57f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b18a873dc.0.tgz","fileCount":34,"integrity":"sha512-YOVaJZxMZoQCj38XH1DB8TyDPI5V4nmhmwmmQEXROdHpZsOdxj/LD9vrNBvJA8MhuMKFBq87ctoBKpBzqH/czg==","signatures":[{"sig":"MEUCIQD2CUfeBvLw6MLpTY9ZoQWLdtmirSMEsyR8evN6yQk0swIgHp5SUCs+K9mdXG+syBFy/z1LraCp4887sMz3vfaPvmo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqCrwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6NQ/+OXHJ6X3Cg9SiaARn/jcz0KKDXQLTwW3mkK2EeiePQSUC8u78\r\nGMBAs5v4WGYOFoktGWKgCkzTqXlU2+vVJTYBzp8xF2jhlBfRSXAcS8RUSWar\r\nAvgssMbizFWDXz3/Ah3DkOHuBvzMx4CBjlvqH0+tCXGmEQICS570y3cTFbsg\r\nqxjM0Q3ekAiMS3KBc1qg2/PTu3y86TB1Ppg7DT8x1Xb26TNJmFN8sT6n6gsJ\r\nWYdZ5JhXZwpRzL6UzMuh6WxTrCR/YIwd+7vIZGYvY+1jrD9MafoAZVwPGAgI\r\n/2SCf0HPuYiUT4EuEZAvxWumyGfRtq88nbdQGxFSYB9l14YdAWIohvIFVBjo\r\nnJFj2hdHvMgEtqipnm0TxtZCwnYKPtzpEbB5JvN/tD9E2fu+ZLTRrW8Wpjgu\r\nDsaydK33B4MDZ2s33xR2hZG6CQ1z5idhV7ZOjaNH+Ee1sR7JHTmMsyycuvf8\r\nuTWMGe8YLvXrSWKCRW8mZwQ1Jb2U69qoexA/+T/aYG6ICVPw3r8xxQaL+qPX\r\n90jVQ6NAX2hLC44MbBBlGmcqhQx+aVcwzunk2TcKEV1dv5eHMyt29IxbhanI\r\nM8USv1imZ6I1uAdMrqTZXhHyxIA8hbhB1Zg9sg4lRBHjSTTvS8hvSUVFOxfc\r\nzytN9rApmWI29gj5YVBMk/wcIGWx5Hi48/8=\r\n=s969\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b35dadfc99a3788643d8762f8afda3f2d6e76d5d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b18a873dc.0","@material/rtl":"15.0.0-canary.b18a873dc.0","@material/base":"15.0.0-canary.b18a873dc.0","@material/shape":"15.0.0-canary.b18a873dc.0","@material/theme":"15.0.0-canary.b18a873dc.0","@material/animation":"15.0.0-canary.b18a873dc.0","@material/elevation":"15.0.0-canary.b18a873dc.0","@material/typography":"15.0.0-canary.b18a873dc.0","@material/feature-targeting":"15.0.0-canary.b18a873dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b18a873dc.0_1655188208384_0.5363835379036259","host":"s3://npm-registry-packages"}},"15.0.0-canary.ba9c29637.0":{"name":"@material/tooltip","version":"15.0.0-canary.ba9c29637.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ba9c29637.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e93c4fff5203d25c1337750ef3e7a672462bdf19","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ba9c29637.0.tgz","fileCount":34,"integrity":"sha512-YuF+Sshtjn3WjDjPtnNDNoDDxsIKiICvNWLGj7Pog/MWiQAG7pZwxOG4Q8ms1SoRa+WOAzxs4YjZb1qlCztEpw==","signatures":[{"sig":"MEUCIHW3WNL1k+8t1KN48YkQ6ARadRPxZarFyO3+xyMgvEuHAiEA2FxRf13JeAGnYeJG57tgdHdMM9DsjszK0IZtsV45bGs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqNoqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqP+g/9GZq7kIV4Dcqgvf6VD28Y34dmYSufgiW3wLOqWeE5G99imP00\r\n3lgsdKuMvQkTXCQcSVlS9wWmKeDi8nK8YMNkAGmBHc9IgvW8AR79mvU6F0oY\r\nf/lWnn0ZqH93Lyn7iy+c2RoWB5n4dkzPAasM0sjMkVodLlW94IiUtnmTNyR7\r\nWB809Lwdk/+iQxaDYmRn3pOgBn2nbxGfZnEEnUZDyqwG0EvSqoyhQYABnZp/\r\n3kbMfV8ix+dfTgkKZN+UKOT5rbciCXIkhSPed/Typr1+FdzuyTcxSSjE/9qn\r\n3+PPieI1C+HPPzk6Bc9Vgrxsa2uG/mckUYw2RlnGRO+25HxChNmpSryaaHoZ\r\njMYYeaiA58ZwRjrGnorKrM0pWl8FjtEvYtxWWie87tU9hs9uXn/JYeFEwKId\r\nhh+r7wCCF2ge9XOwWFRUZZFYFwSw/baZZZq1qrh14+pCXP9rHkgxeVzFwBKp\r\nZYmPhSC01D9Br4vq9HeVNhnHfe+tYvpNyZyjke3hQrCYSIVHOCcQFctfLSFT\r\ndLxfufPuf+2zqZq8o6BUVY6rGmS3fELyAjwEAk/Wwdmu8U3DEKNEn6oh57Z/\r\nSBK1EGY4NrW1I08VdzBHgrSYlUA4MFgFIK8cZJc2noVCZ6JU5pq0R0XPXYAB\r\njmtGcZl7EC+Ht3bZOQx0jDNeKBgthpQuRaU=\r\n=3EjD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2bf89a291dc4aecd82cf7a6432d198374cfea69f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ba9c29637.0","@material/rtl":"15.0.0-canary.ba9c29637.0","@material/base":"15.0.0-canary.ba9c29637.0","@material/shape":"15.0.0-canary.ba9c29637.0","@material/theme":"15.0.0-canary.ba9c29637.0","@material/animation":"15.0.0-canary.ba9c29637.0","@material/elevation":"15.0.0-canary.ba9c29637.0","@material/typography":"15.0.0-canary.ba9c29637.0","@material/feature-targeting":"15.0.0-canary.ba9c29637.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ba9c29637.0_1655233066177_0.9323734228389886","host":"s3://npm-registry-packages"}},"15.0.0-canary.9bfd12f01.0":{"name":"@material/tooltip","version":"15.0.0-canary.9bfd12f01.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.9bfd12f01.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"515fdd3417409d9762d00e2ef9993a8bafcf4dd0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.9bfd12f01.0.tgz","fileCount":34,"integrity":"sha512-1+yMuBLlyf5hj4qnbZ6FPYK/cc+3PPYOUJnzCqUI4G0MDmjllBEH5dD9owrC+cPncf6pPt9enf0l2k3acBhR4A==","signatures":[{"sig":"MEQCIFLEJ9tMR6jJBaaZPTVBa+3+ApLQNN6gj+0B98CLfdUNAiBwTjbarkArQAslClli6z4AJKUZqhP293s9AFv03r7zoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJis2wPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBMQ//bCgtljonjrbxBJgIPWpoVb/1Zaa+ffjSudPLPLFwEQ9oz+3T\r\nRExWIdHJkr+Wpu1QiP7NbFj45z7dXeVF84v5jS2GhnwlxT/SJOkpQbNx56fn\r\n0mGlx2f86UkrjwGgBfAxAakGhhxpB/OK3jzKkPBlCftHSGGt3bNNaWZ9cb0a\r\nbUxhcWKkZbOuRmXHv1FHFEe0J5gAOgAfgXIIOaL5BmylblaXCz2j+YqGF6bX\r\nDOeVqR3l0l+INIXtoOiIHjFZknhxJO1fbg2UWhsN8vV83qrV2okieYBNsyET\r\nxxIHh7i31cGqwjhMk62DYTg2Gc48YFUazdujq1ErzrlKrYrC3ZybbnkZPENF\r\nxAExcHYWoURgR2udKG07mglKFUwm79Trac36xVwgeGxfxQoQ5KC1e8W5Cq5D\r\n5jGDsnUXyvl7t9gQ9PPa0vkuepf7WogpE0RhNsOSTrX/WvFWQDKJWgci63g2\r\nLTN/r4OwFSyX45otySvVQpnnVHbeXp8Gz6kg2g7xPVxaeAKag/n7psRa7wqw\r\nz4Z9csSOeeGhmfLR7SCK358cK8zr2w9aaDcXQUhWbd9b9nThEwJLZcdtQxog\r\nOyC3sIK39TJ1zIMOrYBMu6dqLmfwQ0L1F0nuvS1ewEJBu22mzEfKO/C7vm4j\r\nehHuQ4scsHqRpo39qAShReGexbd38q1LIzw=\r\n=9RjY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ba7b0d01530df70f39142820ab69babfc9cf5b8e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9bfd12f01.0","@material/rtl":"15.0.0-canary.9bfd12f01.0","@material/base":"15.0.0-canary.9bfd12f01.0","@material/shape":"15.0.0-canary.9bfd12f01.0","@material/theme":"15.0.0-canary.9bfd12f01.0","@material/animation":"15.0.0-canary.9bfd12f01.0","@material/elevation":"15.0.0-canary.9bfd12f01.0","@material/typography":"15.0.0-canary.9bfd12f01.0","@material/feature-targeting":"15.0.0-canary.9bfd12f01.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.9bfd12f01.0_1655925774907_0.7049505389352573","host":"s3://npm-registry-packages"}},"15.0.0-canary.764de225d.0":{"name":"@material/tooltip","version":"15.0.0-canary.764de225d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.764de225d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a8bc680316f04a8ec34744143477e290920dfd1c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.764de225d.0.tgz","fileCount":34,"integrity":"sha512-SAtHqPcB43ejlG64/0vn+e7kPn0du2H0AmstdovJIwNIAhT5/htMGPL4W6PRQ5wzUva/qm6UDBNju9d0kBYrkg==","signatures":[{"sig":"MEUCIQCO/y75cgpLVbPNk/islWgWj3zaSbMnWkZnQpxMIH7/oQIgFxL/EjvWH4pTLrmkYFawSFEKiafPmm0zK4PvIV0uin4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivH1vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmruJg//WieFb8YwJ3hS5t6Bnot8lbpClP/DYYmgYLgApGMwfsB4scvb\r\n1XTXV9fGFL5/y718LLIqa9IpNxFO/0oVCRwI78pxhazc1/vncYF0+ZKlGYgi\r\n+KQ5t36YeekO2nAid0KJx3lHUHrGQ2Ilr0Qnh2Bw3bi1m1va7lV1KwBwscaF\r\nKGpAWHxWAlOeQ2ttATBdv45I19Rznr7OyYhjFotHbH1nZDNq301YHk9TN9rF\r\nn1r6g78LVsn3a4ayiEdRSG73+OfIRSD0vI8zL0I+qirgDULgPQ77Cz/B/bTY\r\nFntSQ3OFORdreah9w9Rf1d0NXJ+HD8gdynKvUfSDJ1UV/s1QDtrLAxsYcMi0\r\nf0tfa6VE0d+plfp+D60ng4NCPKBSkkginCGlw1/uR+oUAfEQVK8YSQHQ89h+\r\nQhKxVzoi/ggbNU5Cog1uFj8PRjQ7E5UudpkXj9ZTeRkcn6Mk2iIeBikvdaap\r\nDyCM98UV5VMX0sY10sXDc3rEGQWof+FNzlHU9KxwvSDpVKmhzy6a1Go+zGu5\r\ni7zio004FWzb0L2uFKfaSAcmjvncz5PTgIegTA5uGFzpFaGrMneCKiznuPsL\r\n8S3xEOnUaYDKHSGfUEt4up4KZGj6uOBoCu9bMOAuQcsjkydBqsZ9ZqEtj/QJ\r\nP3erhdtyCubXFnt2ZEmweAizutXzho+GA0s=\r\n=iD3b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"25c0f0a7c9d8dcedfb35f64d0851fc4fb86b8534","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.764de225d.0","@material/rtl":"15.0.0-canary.764de225d.0","@material/base":"15.0.0-canary.764de225d.0","@material/shape":"15.0.0-canary.764de225d.0","@material/theme":"15.0.0-canary.764de225d.0","@material/animation":"15.0.0-canary.764de225d.0","@material/elevation":"15.0.0-canary.764de225d.0","@material/typography":"15.0.0-canary.764de225d.0","@material/feature-targeting":"15.0.0-canary.764de225d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.764de225d.0_1656520047121_0.03759450491276306","host":"s3://npm-registry-packages"}},"15.0.0-canary.31e517cea.0":{"name":"@material/tooltip","version":"15.0.0-canary.31e517cea.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.31e517cea.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"56f27486bdd844bd0e2d0890301c246e5c0f913e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.31e517cea.0.tgz","fileCount":34,"integrity":"sha512-fsYYkVKIMOEny9tKUBTLBxd8mo3ULF6iotvEzBsIswkvMA+n+boDCkLUmTuWnKO0TR08E6fBTqfYg/FD3gDgSQ==","signatures":[{"sig":"MEUCIQDRMqs5i2IJQQZ0AUUzPo/izUXKCikiJFjaBrkIJG4C0wIgMlvshVhjlhczqUZHvA57a+fITFkhtCE2P9WrJmThjEM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivzzeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTsg//Sa5sLe9Ilr8A1CHn+KK+0z9LfGwZBmujJ1mB1iJaH1Q/CW9g\r\nSw5gMG01z5vVoQ70pbU+H8jLGErLNc+uHwsou87Zqwz2GE/5/0S9+WVh5f/i\r\nT0yhgwiRiFI4eN2HF/eSE9bFDlk1d9KPYuiGl/48ljzfX9TyofLLFT9zDwc0\r\n5rBZnE/lH+9xmXWTAER0hOvjLn4fErsU7yPkBVQxVwFPDGUKzqrzxIh46r3g\r\nu8WCQH/lGYQBhhcp1L2TMzRwdoGjubeWLr2u44Z4HFWBmNDGnG+HHN/+RWYN\r\nsdHXvzp8bZu3boUoHuXJC2CxGDlU3eAWTVJSENpseIxgxAKsIgz488SJdyBV\r\n5BzKsxmFHFszTIVLMf4hOs1TNAJJMXAYnRBju9fna05hZClokJ7yg5iXGOQZ\r\nQRZ4zDYenXYiaEzlvQcHQN4udu4duvlB0RCBt3on6bD64S9dxNGx1Vz8uME0\r\n44WFDbSYqOwogZKuLdFfVdBV8+S5+nuhqA9HtOMJqUh1RPtrXBpfnHCHwHZi\r\nE+OpSrBbFRHRixsCKDtkBJ2vGY6kRXR9VF3b1tTLm/CNOEOFMCzhSyAZuibu\r\nu2LVxicSlbVsnoJJteVuUJiklqLZ4XBOtuTD63bLNPXpvXv0vESl6H7Voj4I\r\nvWo6N0HPhCeMJSWgqpdHdRSKxdLL3z0wGLs=\r\n=t/6V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8af6d916fdf79ba9e33a883ad56f539f3decd5a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.31e517cea.0","@material/rtl":"15.0.0-canary.31e517cea.0","@material/base":"15.0.0-canary.31e517cea.0","@material/shape":"15.0.0-canary.31e517cea.0","@material/theme":"15.0.0-canary.31e517cea.0","@material/animation":"15.0.0-canary.31e517cea.0","@material/elevation":"15.0.0-canary.31e517cea.0","@material/typography":"15.0.0-canary.31e517cea.0","@material/feature-targeting":"15.0.0-canary.31e517cea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.31e517cea.0_1656700125839_0.9365057808136319","host":"s3://npm-registry-packages"}},"15.0.0-canary.9ea4e8e9c.0":{"name":"@material/tooltip","version":"15.0.0-canary.9ea4e8e9c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.9ea4e8e9c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"370362f8a12511333fddd1c94379e7255a9d118b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.9ea4e8e9c.0.tgz","fileCount":34,"integrity":"sha512-u5T6mnB/3d5rcIyjEEtDXrfKGgRo+Y9F97xSnnKeUqnf39wqhZAPu4DmasPt7pmrFurNr1X/Lrto1RJnPmR9eQ==","signatures":[{"sig":"MEYCIQCyF1dH/zFBG9YFOdzdmoW7bu4EbI175c0oTX4IQFosvgIhAPgaWbKuAgn3sZ6kl2vIZeXX/tiKmSzGNboDa6fl7W+W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiv3tZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmokkhAAmcjPc9phkpNWOV0BC/1xxEWpjf03Tte2dhOKtv4NkaFXATPj\r\nW7CceE2Xv7PkeXoPTUnYebGSS9oAbBz9Emg+GQqVSWdBNUUoN3LKFcsgL5/I\r\n+1U37Ejb7lgQcENWWmuzAUAVaIwSTWUPKixR7326HjWVKOO/4xWDBt6b0rQ6\r\nV7mxaqP5pqqZGWSC+W6oVwOFeOW2IvJdvU0BgagOFJnXvWNnBqNNhSx9vtlQ\r\nnxgOhjA+DWykfY1JOZG9ew65jqZSkSoQHKpP2RsoVvwATqaLPhF5AmAJBKSk\r\nMpZuK1Vi3ni6K/7P4KwEKh4u+h+4isrQkspQ/ArJMn50m2U9+N4Adh/XuN24\r\nAoSaoAEypziEP0B3uklXIoOQOarnY0/gNG0JMT1NfFfrjzl+VpFkP3lhISim\r\nbR4JDJVuEZGn0wKPbLQqANQsjD9xdguiGUIgOjOL1u3fr1CI4Wa/RvVRg7tb\r\n6aC7TVsKQbK2D0OwCSEzC2VxIhAiOiWXQ/oZ7qxbR5Si9pgHKQEvwArEgN0I\r\nTxRun2rgCj74lqhz49GTcGdM1zYLJg3pCkv5cBcJ5fCQzXd3j4vVLsgRHwDo\r\n81JXAaESHRqrqsd+3GqwBEKfMnGEIZyZkKIyDEvS3IW8++e02heNXIoZikyt\r\nKlDTA4XfDtPYo0vbWMl/YQcAiW2nJMcQvQ4=\r\n=3f35\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7a2b791f6f1e376a53ceef81767514ec18174558","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.9ea4e8e9c.0","@material/rtl":"15.0.0-canary.9ea4e8e9c.0","@material/base":"15.0.0-canary.9ea4e8e9c.0","@material/shape":"15.0.0-canary.9ea4e8e9c.0","@material/theme":"15.0.0-canary.9ea4e8e9c.0","@material/animation":"15.0.0-canary.9ea4e8e9c.0","@material/elevation":"15.0.0-canary.9ea4e8e9c.0","@material/typography":"15.0.0-canary.9ea4e8e9c.0","@material/feature-targeting":"15.0.0-canary.9ea4e8e9c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.9ea4e8e9c.0_1656716121500_0.44115883965666214","host":"s3://npm-registry-packages"}},"15.0.0-canary.cd5bafabb.0":{"name":"@material/tooltip","version":"15.0.0-canary.cd5bafabb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.cd5bafabb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ea48810af6d0fb27b49d04ec2efed7a58e475a95","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.cd5bafabb.0.tgz","fileCount":34,"integrity":"sha512-l+8MIW0uYCKyJVRPOfDjqKUfwgQ0U9k9eg3tIXPBfT5wGBsFlYF8XXMuGJwqh0ehsZObzX748Pg8KX1a14yXUw==","signatures":[{"sig":"MEYCIQD7n0bgS5OvpP15fTFLmyHKyR03e4jVnFj9dx++xZgElwIhAOFlxdABaGFT937x3KhF0ozq+JEHU8s/D2V3dyagVYAV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixcxmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+pg/+IJJppcCHESQqP3/GysARN0DzQHQDZuXuQtcWXpvS67XR/nG3\r\nSX/chzP636KfxPt3VD0X6up3A2ihjk09FYuVWW9Hlj6+4NJzrdPvzX23pMSO\r\nYijkZywq7oT5KjqCCgiyWjtVsUUMlre+Vbb3OOn8DT3vv5BzOWVDgN2ukemw\r\nlIBCNtNJs4pm16yQdRzuHKFNT/sfAM8hQDRgJ5nqPpaS9TS0BGLcLVGCihYx\r\ns+fE4NOf020ubibFhpbGETkYq5qK9VuQZYFW8J9GWg2TknwA7XLIhhv6YwT8\r\nyPOd17SSyZ/UCXwy3VpUfzEt9rYl62L6cxavgf3ro28Ob9nesKWreP7hiiVk\r\nIoLAU7EhypuyPLHcWi28oR7mOPJHoQFZ9odecDcRS0nFDeVsPhm+T5iVJyAQ\r\nmNnwANczqtH3+Ueq6VX2yKHpIRXjmVzNgRO/YjRNVPv5CpmuD83xvqANgaiN\r\nXxN6RAsc/+/xX+6MRw+YApT4n+/KxdPGYJiejwp9SOa7SHSqOIvqhmqNKw1t\r\niBT0HUjK1Ac1aLLQnj1WZj+8N3BZkr8Tzn0ERzzAD4XlWMKY9Gbn1paVDFMS\r\nTSmCyqCb345a4ovOgZUFTMYPJ8vpkTADuG082n+S1Qxia4AlY9nfoJtJ1Rya\r\nOxNgGrHOrk+BcywSfPOz6z1Zd7ZmXepBVJU=\r\n=ac99\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"fceb62aaa361c04ae0a30158d529c7e6896b6f9a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cd5bafabb.0","@material/rtl":"15.0.0-canary.cd5bafabb.0","@material/base":"15.0.0-canary.cd5bafabb.0","@material/shape":"15.0.0-canary.cd5bafabb.0","@material/theme":"15.0.0-canary.cd5bafabb.0","@material/animation":"15.0.0-canary.cd5bafabb.0","@material/elevation":"15.0.0-canary.cd5bafabb.0","@material/typography":"15.0.0-canary.cd5bafabb.0","@material/feature-targeting":"15.0.0-canary.cd5bafabb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.cd5bafabb.0_1657130086359_0.21900531594696981","host":"s3://npm-registry-packages"}},"15.0.0-canary.a02fe49d3.0":{"name":"@material/tooltip","version":"15.0.0-canary.a02fe49d3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a02fe49d3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"50822a45d5c1555588ff101a4b25e809c38993ee","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a02fe49d3.0.tgz","fileCount":34,"integrity":"sha512-i81Htogch/jSU/oxzpWfIWh6jXtWRemhDNgDXeRWSg9XTkq2/9fFJtwBbfoUfZIJMsWxOsVZhw/18TxTKu8iVQ==","signatures":[{"sig":"MEQCIF4BLmRsNY/LcTOR6UCKNUTf+v5fxNYZj63B5B1t0FOqAiAcIIUn8YSVD9IzMe5GMhHrtVahRILgk9Eewiov251Bqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixdmvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDeg//fMpic17Wc4Sqckeqyg5TP86FoBcB0pWcjKxVPDxM5f6lYIp5\r\nlCRxLmS99UT35T0rpact1QaWYjyxwyhVWnnYQt3aI32zhRdTulyHkX+7UzK+\r\nwGLc9LV0BHc5ItpeP16cE05OrS+mcsgfK/oetUS0bjG9Qdnwy3E7VTpYth8C\r\nmUVlEiPL29FO5wcp+9mP4U96+MnpeUJcICYaheLT/HDHH/MYb/1nxkunRwv+\r\naKtXGHqMyVwP1CHwqizUuSw+aTxYh+51VFMQVOJVNGJlKxnWc88Dtc4cNLg6\r\n5fS+14EeWYSB0Tp6ZTl4WFySdoK9oCmSAYWvfPHjqAATJCrceM7tBF1P6lZO\r\nbFA6tHHIctbY8Ne8bewslFID0nHHwFBdM5JWDk0n4omcXvKeEASrFokGcBWK\r\nFCfeWDYSQ3XXkZdVcb2O56SlfslU3NHwD6l51uxHbyoj/F0+Xq9b6LrwleEe\r\nqbn+zQnXFKj+jMPr5EdpRZtiTIS0YWin14dXSwO4LrKEF6hmfSvFkHjrHD2i\r\ni9U2YegejD2zItyfGz7ZE1b3Kq5T5yCVNw5GvQFR0jXfQB4R+n0Q0W3Uif1t\r\nqN29h9sWRrVGcKL6fD8NIEuBEkWdbDauvn7UvPVPTAsRzqlxbq0Zvl1GxVNA\r\nm10lBmThJ23IpW6eytwG4T7nF7obawqjBgg=\r\n=3Q/y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8304e794f430681d03b9d2d3193e635a072f2d8a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a02fe49d3.0","@material/rtl":"15.0.0-canary.a02fe49d3.0","@material/base":"15.0.0-canary.a02fe49d3.0","@material/shape":"15.0.0-canary.a02fe49d3.0","@material/theme":"15.0.0-canary.a02fe49d3.0","@material/animation":"15.0.0-canary.a02fe49d3.0","@material/elevation":"15.0.0-canary.a02fe49d3.0","@material/typography":"15.0.0-canary.a02fe49d3.0","@material/feature-targeting":"15.0.0-canary.a02fe49d3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a02fe49d3.0_1657133486972_0.7241587296534138","host":"s3://npm-registry-packages"}},"15.0.0-canary.826a3d8be.0":{"name":"@material/tooltip","version":"15.0.0-canary.826a3d8be.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.826a3d8be.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"18c6f9447885961b5d34ab391811e4f1f3f0b0e0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.826a3d8be.0.tgz","fileCount":34,"integrity":"sha512-4dOerkWRFD6RSxyz1yLyteeskM9znhcQIoZnpF3UxSntdmser3N8HNUXKz2Lhx/aEWzXS4c7vj08plMPoX8RcA==","signatures":[{"sig":"MEYCIQCldUpjBYjgWviEwrg9zmki5w+cdiONOB2bC0juOFSuugIhAL0fTXIBNeIgCcDtdr+rJAceCzFjU+iGe/YQFalMyid1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixeMNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGwRAAgp8vLlY7gozNS38E6XWpfMa9Pxm+C8UY2h0HFIYsQrCzYYrA\r\n6FoazweNk1o2uwzL/FJVGLkT3fQaylqhVZSYWDo4nuJ7fnsawJnAnHHVj1WU\r\n/iyB2ZcZoOlIN4O9d+ZVini8poaHiniKqnOZdXQnQdOvWFgXMEHuealF0Gqo\r\n9kCyN/s4QPr48Iu8ReSltCBW3NMPJQzPRXtHciVFAHsoRmpe8NIH5cMXrWZw\r\nNtn1lSKEEKUJJJR02+k+uS8QGxPmGOk6xWR9HQLcdE2Dedevta9fBRPr+1Is\r\nLySvuX1AZzrjQlpEWOmqceZXo05RywksHrtCCyyg4OgGpSiJizTdtCe+C3Dd\r\nHuAYZZrpbepYvCd+RartwCrazfi28qSwje7Dc9xClS6BD07udqcizuRnSKBC\r\nkixjrXjhnkLXdnIIo5L8FmunUtXoOOq9TN9KFRD2M3mkFZROX0XWro4AbY5s\r\noNV5Ab9lBvTO8p5jKcZzKlAb3hh0BphheZm/UIQCzUNVFeJO8iisMas/gvUg\r\nRrKlXeMpShiUtkwaSEOQHj6W88Ru1rOwgqwNxvKKO7bem9DTPD3vA9Hje8k/\r\ngSWrwhRe3jqXxhBSAOFWB4laszzhRQhyJ5NXWb+GhBI47G3RLtebNzO7GhA3\r\nBSD7yf1NhJUFj2aYWLENaswt2KxU7aEViMQ=\r\n=+Hri\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f54c723431e97d10fc1886f271ed251cb10209ce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.826a3d8be.0","@material/rtl":"15.0.0-canary.826a3d8be.0","@material/base":"15.0.0-canary.826a3d8be.0","@material/shape":"15.0.0-canary.826a3d8be.0","@material/theme":"15.0.0-canary.826a3d8be.0","@material/animation":"15.0.0-canary.826a3d8be.0","@material/elevation":"15.0.0-canary.826a3d8be.0","@material/typography":"15.0.0-canary.826a3d8be.0","@material/feature-targeting":"15.0.0-canary.826a3d8be.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.826a3d8be.0_1657135885262_0.7733333539996816","host":"s3://npm-registry-packages"}},"15.0.0-canary.ef276aa93.0":{"name":"@material/tooltip","version":"15.0.0-canary.ef276aa93.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ef276aa93.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82645804b85fd247633c5e195a0bf9f0f04f068a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ef276aa93.0.tgz","fileCount":34,"integrity":"sha512-eNPZI7Z53U/IuU5vWURCTj5E2DtMn7DRKKC4NFgsImAz0gSiuqdMwdX36TDrDwAWqLdp/WTKq2PllWkvWP0ECQ==","signatures":[{"sig":"MEQCIHvNXbbyZMk5uO1ru2Ldd2CDGRpTqWz/e2St2q/UR685AiAXfMQU3tSLfa/jA/rpUvhph9PUnyAaD6OOzJCvWSzi5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixxHGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp96A//eQsozPPXPWEn+XZ9IW0oJQ1lLkUpqruIeOlKt4DcKzp2DrRC\r\nmRAzbIC75q3z15NO6LIDaMFEGoCUXutolw8UjhZBIGP4TzuQDsR+tCiLq/hf\r\nVXCQnRwtl16scm8lI9jqV0BIvCj74MCzDcisBpz1CunxnFeojvKX5bA5bcuK\r\neW6uzPcg/9285Qgwe9+cqRzpVsnOwbraBeIVe5RXiVM68Yn8AcytO4c5K1OZ\r\nZFqMTjt4fn/tInmxm7yuJt/mYzHlT2RqS7kpWfrCJ30aLMePBoN7+LQjgAaP\r\nBAB4ixD/rAJ6JRMgxudvMbpVM+j8PVqID3kB3EfegUuPt2IK/oyy8QfeAhaC\r\nbUR5xQ3S+NNouXps1p2hZMqrwEnqYQ8YTcSY7aSNBX+OEPDQv+/3gM9HXoDZ\r\nWM6ctXh5dSi8Bep9m1nG0QnvGBM/Rb6V60/jWQ8D1ofU+gLO4O8YClEadM4R\r\nHPK7gVtTW2yk9lfXA7OH95d4gEiYKolH6tIvOlJDaxPK67rVazTLFAvmZRdo\r\nNYN4oD9K8W/SI2AtFcEnO8Ox1g6/YnxjhZ5nJ27bcq1ZPQz1TpVh6kiLfDIc\r\npAlIGUbGRGoMivbRbzayCEetlsI7NBmw0YjZRM0boAhi3+5nhqgDBIbgt+15\r\nuswsECNekM0Y4B1lSRSUQyJ5S2YU8GYpRPA=\r\n=Zyk8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"502fb9536e29ea5887a9fac4aaf0c9dc2c732e61","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ef276aa93.0","@material/rtl":"15.0.0-canary.ef276aa93.0","@material/base":"15.0.0-canary.ef276aa93.0","@material/shape":"15.0.0-canary.ef276aa93.0","@material/theme":"15.0.0-canary.ef276aa93.0","@material/animation":"15.0.0-canary.ef276aa93.0","@material/elevation":"15.0.0-canary.ef276aa93.0","@material/typography":"15.0.0-canary.ef276aa93.0","@material/feature-targeting":"15.0.0-canary.ef276aa93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ef276aa93.0_1657213381750_0.16142535692947702","host":"s3://npm-registry-packages"}},"15.0.0-canary.59cf61d6b.0":{"name":"@material/tooltip","version":"15.0.0-canary.59cf61d6b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.59cf61d6b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1c388e4a4f03b6e184885ddd02eb71a46b0e2abe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.59cf61d6b.0.tgz","fileCount":34,"integrity":"sha512-hiD0/lU5CsvcahxQwYfP9a8f2qQf2Gps+0ImtI5T5zCQqDArWu7T/9YtaA1WoLTuyAPYOkUFraHaatDDYfg8Ag==","signatures":[{"sig":"MEUCIAZNjdjz93OF4vGblL+wfusewFTTZ66KPIyAhHY7ZXCBAiEAs9YjOdNi7CsKC8e1feuZel5sDOYSnbSf1k6DLYYn9bk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixxiDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVuw/5AHwklzY2B78Idwo10EmGIuOuv/8X3wD2n2z8mPjYb4AlL7hj\r\nWWDbNhOWG98uU9sTidaU6tDICHYDFiP4Yso8kWeNmFEa6gtTAL47YuoHXY9+\r\nhJs6yl3dCg5a2bGGSjngmkIXFTUaOB9LQbOZJsbxLmllfuAkWKVdSLgU5nul\r\ntGsajM50wAWcuABNYegewcOERYPN6jTHxzB+qYzrBP3r39mQvBoAOqj+tvH3\r\n4jfzxr+b7H9RtrWXuceDGzNug2rWeFGWLaQizsooH3GvOsYv5UzmQWL8CP/y\r\n/F1d/C/6AdgbGrO/4WcoZ1oj+YxTvrwsEImXzw1d7nxSE9xMcSCcTMzg/LIY\r\nPUYA6yZvGEXCGa7Xaw3TOo0z4UeTlujIfm81g8bW2YyLXXXsFuRHE2I0KFAV\r\nU81g1yYf7UFRXtk1yMiexIY9CoUCMYykjNGRQlYGj1CbnBi5gETVGdKbcit3\r\nfzZnv279NbglokH+K6A7/UXLREdslzgrnmq0V3vn6UfkkrIvpUmbfJ4dT76H\r\nMP2EHi1z5keuFPDau2sLorSDYKHRQwOmA4fx0Mbm1CPlcDc5/oor5kUirPhD\r\nmJZ3YENLIHMGde5J7rJfRW+QrO1UGQw7gK7WKS1+b8NJISQ/JVBs6LwhEhhl\r\nzTlsaSCScQr8WMR+uuJrLwdpCrmEyIPGHpA=\r\n=E6OS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2f27bf33b194929683b4faa9f388325b07b408b4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.59cf61d6b.0","@material/rtl":"15.0.0-canary.59cf61d6b.0","@material/base":"15.0.0-canary.59cf61d6b.0","@material/shape":"15.0.0-canary.59cf61d6b.0","@material/theme":"15.0.0-canary.59cf61d6b.0","@material/animation":"15.0.0-canary.59cf61d6b.0","@material/elevation":"15.0.0-canary.59cf61d6b.0","@material/typography":"15.0.0-canary.59cf61d6b.0","@material/feature-targeting":"15.0.0-canary.59cf61d6b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.59cf61d6b.0_1657215107077_0.041869692913922396","host":"s3://npm-registry-packages"}},"15.0.0-canary.8647092f7.0":{"name":"@material/tooltip","version":"15.0.0-canary.8647092f7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.8647092f7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d958d72675ee81d525477a696a78c3b0748078cc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.8647092f7.0.tgz","fileCount":34,"integrity":"sha512-0wkQXZrDY/Jcq3pz81055S+INKjhaq9fHTMzkt93TAJUsMhluQyrWsXIfTeUIV3lEFAqQDC5OhgaWq8pJNHwSg==","signatures":[{"sig":"MEQCIAY1aHyjIljiMzWLcOzXk315lzP3R75rG86LLtHqkh85AiAN3ph2PIfp25ODWDeZg4BiVnLnU8+GoOYtNOrKxXxv8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJix0RmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4HA//cTWnXECaw0HlwusZNwjCrZ+wGnH3jWy2ptRHzrLFiwcNw1P0\r\nUYz31kh45Hu4e4WCTvnrcQ7pMeoLlYJJDAmeMywOCgLWPJTzU3kdd/dlgBUk\r\nOeliavjqVg5bqoJgThHHvR/tARoI3AURVTlcZH9+zJzMmJtlNRRh+t0PsSjj\r\nQi7MmLQRFPCeWe5IA3eQfDonGnyceq6UTwfbxDpARv4RnxpXkIfeQeomfI9l\r\n9JjOgUC8ciJHhcEg4/jf7xTbM4HAEZ8XieDOFT2aVsYTNc82YwW828y0e1uK\r\nfquegsDTa/XseIpUFjNINMknX/APtS6mqS4dgwSMCXmF/0jXDA22gtyq2wmT\r\nWCT0HNoVGwroCs7VlF0CNmBA+PHPpupA2d44tn1yEW//qTJ/cXMTXS+hhYuK\r\nkxc9p8Os4M8qb9q+5gJJqURWTGNCQRlSqPBssWAyMrr57lYqIGxjQUYHmcwl\r\neIUVyS3o++s2P4utII5fIj49peqa6300dDlqah7mpuKVC5yGI/n2UGpQ31/5\r\nQdrEBGkmChE5VnFJPjO9JRi1FBK8vFPGGDchjGEazVqXXfbkEOARcjLlf9uX\r\n+Y76Dk1+A9oJ5k53kZmuSKv2N5ss5yluxb/XGnXzVh1mjhMRIpvsTQ2+SH+m\r\n3NoiD1W9grfCusrC3KP9Gt74SVg1rJJE7JA=\r\n=YtVz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1edf72197ddaf5b6318f71205888f8ae695e9b29","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8647092f7.0","@material/rtl":"15.0.0-canary.8647092f7.0","@material/base":"15.0.0-canary.8647092f7.0","@material/shape":"15.0.0-canary.8647092f7.0","@material/theme":"15.0.0-canary.8647092f7.0","@material/animation":"15.0.0-canary.8647092f7.0","@material/elevation":"15.0.0-canary.8647092f7.0","@material/typography":"15.0.0-canary.8647092f7.0","@material/feature-targeting":"15.0.0-canary.8647092f7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.8647092f7.0_1657226342134_0.2763553502408438","host":"s3://npm-registry-packages"}},"15.0.0-canary.02ecd4d85.0":{"name":"@material/tooltip","version":"15.0.0-canary.02ecd4d85.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.02ecd4d85.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"94d6259fbd6dc84f2cfbb3f940a60715a461f30d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.02ecd4d85.0.tgz","fileCount":34,"integrity":"sha512-pz4zl+qphdqxTvD+w5t2lEHw6cB7roaZmoD4HUKWzI/4tXx1pfQcByxz9nzClEo5jKW2OevSQKhutrJobUm/Vw==","signatures":[{"sig":"MEUCIQDV4IAqyVrwpI++oRmpmhzHy4KbWycE/g3YGxyvqLESYAIgLInPjADchgi81kiwVrxeQVlwIMbwf3uOxAsSTqvYIm0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizFJMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrnFA/+Ld87M6jQi2TwDBLvV/od2tzVaYVmLKHsHuMnXCj03A//B2nZ\r\nK+rmrnQ3qXyUg9/Z2WyDA74fVlYgGXHrwLy8GzkiPH89du6BGfOdFtVk+x4B\r\nJZFQPGuskLHViD21tudcY9MhECau3ltMT9ezjB5p6o+6vXugEp/IoQZ0gg7T\r\nPY+a/DMyJ+gLolpY41Czv3DYRop412CuPP2R6nUfHAzleFFYmKVZbAh0TkBs\r\njklDo+27YyQJBJRNowJ9Fpy/iC03sVWRgUrtdTKtk6AEISm6BkWSjEPIskJs\r\n8XW6T+MtoZMLk0/PSzEoJIQMXKPLf6BbUK2Jha9CFgkRccJLI+0fKid7q3Bz\r\nAjC/yrOiADSuq+uSPlt860U58vAfcBw2FNu11L89Ug7/YyeafsAODaN94/gh\r\nP8JWlzEvLGUEeMhwCXcBAAFEYe82gujxpoEz+RTNUMz/ogFwJ9RKgMYcSpqg\r\nO0MXL3QSVT3WSp01SuY5qu/D4ukxByyeXfM4v3bjwYnh7KIhOgklEANgcwH+\r\na5yL1W622p5PTQhPYMhSoD9cnDV+EAFsPJCulalIg+Ip7DP6fBkTOB0ByUmB\r\nlq4Fy01hnubhJzuDOd/wWfLyo2Hh7qZQtNsY8HiO9V15+OEMd6ebGauiFDMK\r\nJnS3BaVHCa2+ci2IKzkN/7+e1CVpPPOoOh4=\r\n=PZg8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e9bd9b1837b6df66731c0fc9da61877874518d2c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.19.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.19.3","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.02ecd4d85.0","@material/rtl":"15.0.0-canary.02ecd4d85.0","@material/base":"15.0.0-canary.02ecd4d85.0","@material/shape":"15.0.0-canary.02ecd4d85.0","@material/theme":"15.0.0-canary.02ecd4d85.0","@material/animation":"15.0.0-canary.02ecd4d85.0","@material/elevation":"15.0.0-canary.02ecd4d85.0","@material/typography":"15.0.0-canary.02ecd4d85.0","@material/feature-targeting":"15.0.0-canary.02ecd4d85.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.02ecd4d85.0_1657557580585_0.9265628829184569","host":"s3://npm-registry-packages"}},"15.0.0-canary.63d3a146e.0":{"name":"@material/tooltip","version":"15.0.0-canary.63d3a146e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.63d3a146e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5178de4ce2e9cdb112bb405964fccefaa4a0df3d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.63d3a146e.0.tgz","fileCount":34,"integrity":"sha512-n3ekAOJwCEjyck3KRJEGFmCkWpdgwgvn1+wZ2IstWuun5hcs892dXcOkNEJcdJuldVnRhG5jwDav4rhaJY1NYw==","signatures":[{"sig":"MEUCIEqWFt5b0kfcRH644C66QJDwbXopDg4G7F+xWVhJ3QDaAiEAkHaxUxDcJ3N8S+m92vBLe0wM0duvRKS2rj6JGoth0+c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizVzrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMDA//SMkdtmYwia5WKF3nVXk3md2i0lfL91PbQ2rYsW0PIuomk7Jy\r\nR/LZFeQZmXAvufMoRDhgoO9GoWHH/e6pZAN6L7Kah+e6JAgOaIBXSTFZwPM8\r\nMDdtH6MKcague86R1lJayMZUx3pQs2C9XEwPmZzDPf8bGMzXD0tfVRvudU+v\r\n1xEYASdRSpF7UI1CQn1G4rWR/V1VYZfVjyIptTXXK2NoE1dJ/S3E2BM95b7A\r\nweydFr6evmEO4MVo4p7lQMvc1QbGuLncZNCHlJBEUYsuRkFU5JTmjPJD/7O3\r\nbqfB+lM3C4iAqF09EZQQjPUZizbqc7Ob/+cdZ41cippngaIiBeDCuucCQ8kK\r\nQ8As/rIbx7v/hVvCo7ddlcUBpdYfBoq5kNlEuQzOxPxIblX8LQ+SEqCOH0Zf\r\nkhKiuFlusef0hWcYOfcwlKzcPoay6G/Eu5TeuEIP1R7q5u6XyHaxs1pcm+cy\r\nOpkwJw8eG6Rxt+UgIPcEl/WAhzFvBZak98j5qWTbjqkNe6DA9Jvi8gqdv1Wa\r\nDs5HUzb/4jih6d0PNBNVLpsjZmByAe+ZefQureY/lB9BQ+bKlkw+056Uj2/R\r\nbA2BxTJBT/N1Pgg5ME6tD3fW8Z8rEHyZo/mIheleZ72v2RE5cpceb9ntBWpD\r\n7AklbGZj7CS+PFlkjxa42esDvMz9I+7BD0A=\r\n=x6Mq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"593f32d351d8703bd0422f65b3651e55f97fd31d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.63d3a146e.0","@material/rtl":"15.0.0-canary.63d3a146e.0","@material/base":"15.0.0-canary.63d3a146e.0","@material/shape":"15.0.0-canary.63d3a146e.0","@material/theme":"15.0.0-canary.63d3a146e.0","@material/animation":"15.0.0-canary.63d3a146e.0","@material/elevation":"15.0.0-canary.63d3a146e.0","@material/typography":"15.0.0-canary.63d3a146e.0","@material/feature-targeting":"15.0.0-canary.63d3a146e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.63d3a146e.0_1657625835038_0.21916966859469889","host":"s3://npm-registry-packages"}},"15.0.0-canary.88db01990.0":{"name":"@material/tooltip","version":"15.0.0-canary.88db01990.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.88db01990.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"08f0d95fe78b01d6b15e5b55ff0c9d143284915d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.88db01990.0.tgz","fileCount":34,"integrity":"sha512-of0CPM6QL4E1/hEVY2aZJJJyQGbfA7Jubo/B+nn52l7USU1Bopvl+7EjbhznTReFGTARihgUgxu66jr+MwZ//g==","signatures":[{"sig":"MEYCIQDOPzYRh/fDsJ4OZCcgcRxqztplyom+cVwD/4eQ0ia5gQIhAInssFL6dtugNu1YvFZQ0Ewv6ownigzGgxZVvDLXLzat","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizV2qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmponA//cUY2t4R9WahnxBcw38tBjGFI8V76/zCcuShXP6mkJgFm91RE\r\nmsKDLtPYr+TD3cSH4aYqPChQAF2aTQSptB7pAxo7C+PvbV6TQNlbyQUjx5DR\r\ntZnR/e9Y0f2Ec4wEsUHK7Lifgc9BpQxm6js9b34NHnwBs3bSWsdjquLK6wDY\r\nZnw/IAJ0kck22cpM7rvDI+IfOGFbxMFXZ2UlZLzwW7EPExh6yhClY6+KhEMg\r\nV8ms6DxK4zPuztuZmz5v2gJ4LPziZwqc7wYm/IAoWOZwcvtmeMxdztCnLU2i\r\nFL5LoffCD4WzfN6ZdGX1B7TzJ4DdNFKEPu6jkwEK69lsq11Dlns09KDMoZ1f\r\n4YfhFuYGqEtCoDr+FzRTEpfC5WNOakkGnNqmNWZH/aVQH975n8A9gWb6iDAo\r\nfTpr4zLyeqa9DJNApAchAG1Gyvq7oUaT3BdWRN3g6agzE9PZXEnErw3TTWLy\r\nKGPq2QZFinBjHL3NchZyqkl0fhBjpksjenOowu13MJ02p4y1c+Q3n1ZH8Hwj\r\n1JPErV0WYVXFXwUWDo8bObuoZveYC5Sm6nR9JMJvXPuF89mcj/dhkq9XAPhY\r\nJHS53aMv/c8MOVqsrMFpnyqv6LfIfPqfvc0x301xD0GFVDrz4SJoq+0WHHW9\r\nGiBRP5F2bjFjgiGf9h2Zq44auNYReD/nQ88=\r\n=WPL9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a2570f15e2572775da6e1894e5310c107a703ea4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.88db01990.0","@material/rtl":"15.0.0-canary.88db01990.0","@material/base":"15.0.0-canary.88db01990.0","@material/shape":"15.0.0-canary.88db01990.0","@material/theme":"15.0.0-canary.88db01990.0","@material/animation":"15.0.0-canary.88db01990.0","@material/elevation":"15.0.0-canary.88db01990.0","@material/typography":"15.0.0-canary.88db01990.0","@material/feature-targeting":"15.0.0-canary.88db01990.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.88db01990.0_1657626025986_0.19300292254497764","host":"s3://npm-registry-packages"}},"15.0.0-canary.6432d8fd7.0":{"name":"@material/tooltip","version":"15.0.0-canary.6432d8fd7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6432d8fd7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fea3435d9134ce8a457c60169d5d591d25e594fd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6432d8fd7.0.tgz","fileCount":34,"integrity":"sha512-o4VQb48OANlrQ0ojqIGPCsn0KfEId7h7rt/LtqQ5gt9nduu9g12J2+EIT4WISKr7Hysd97ygH9YbJrrTqjSzyQ==","signatures":[{"sig":"MEQCIBcM1KPj2hCo2ScQz+gF8+SVemEwB0En0wdkSXidgPg6AiAAvdh3R7mKIIoFR5vHTgUtDKAbUpLSGvW67bkgBgOCzA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiz8XQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6gQ/+L8BJc1e9wSOfnUcTibGmKixXygehebuxGsh5nvsr++G5u381\r\nmeZkMDYuJEYZOt57rLKs30/msL3nGJaFX7/JPQ9cKnvD4GZcsCYoji6ciX3D\r\njMeZFgfrl9mHmCTM6d78xHg52vTHzff/edsWNe+9QzpRNkCJ8mKYaViv0vQN\r\nPbmYwju4oNJeMfK6MiH42/mZl/mWUUU6y9u86X1HNRLtCwhUvL2urKJi+8F2\r\nlTYhkRENc82NzSiUZuis37diMjP6vkSCkEaCqG3hiDIzp1THI8wRhRdu9wnZ\r\nAkI3rcmZVD1ZmxqPfFHVijl6QajhUZDKdFw1QRfIbcRxzbioFzrxLdmWJ9X2\r\nKh6gahihLzKe0xPKev8H916XsutrIw9LszWNKLpAolur3B7LRxaVBMMGEnTu\r\nny7sMIiWqns12QnunCFXwAvlcXR8P+2yEJIshD5YhDzi+1Z9iNuOk4s8txGJ\r\nQDRXoYCbKYWEvh+rFlZXE0RL3rs9SxUhmOopPqZi1c+Tel52FxdRVb0+vHLW\r\nTnjDR9lgPDo/rgaDV1TfP+yww6LTX2n9yp7rrzqoZ3ep0TCliOvVnFbG/s/2\r\n6npjUUY4QAZHW1ws6LNd4BmCOxH2l+BAO/5mV+zHwEYiHm/Vl0NKaG6dYRso\r\nMB0omh9VSkHCcWtVfy8UIGwFGojZ5lFav2Y=\r\n=0otb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"307aa53d6ea873bb978456b538f97f9922496798","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6432d8fd7.0","@material/rtl":"15.0.0-canary.6432d8fd7.0","@material/base":"15.0.0-canary.6432d8fd7.0","@material/shape":"15.0.0-canary.6432d8fd7.0","@material/theme":"15.0.0-canary.6432d8fd7.0","@material/animation":"15.0.0-canary.6432d8fd7.0","@material/elevation":"15.0.0-canary.6432d8fd7.0","@material/typography":"15.0.0-canary.6432d8fd7.0","@material/feature-targeting":"15.0.0-canary.6432d8fd7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6432d8fd7.0_1657783760163_0.4257007490117559","host":"s3://npm-registry-packages"}},"15.0.0-canary.085f9b25c.0":{"name":"@material/tooltip","version":"15.0.0-canary.085f9b25c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.085f9b25c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f81df9465de6aec2936d2d7f8dc3bd0893af1e58","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.085f9b25c.0.tgz","fileCount":34,"integrity":"sha512-GDWunTbMNZGwvPkHZi1VvRfxS7qR2PW9ZPSTNaz9D3bKljZzV3PIDoD6W1LnxFQlLyIJ5lfd0hlXmybMjHql8Q==","signatures":[{"sig":"MEYCIQDuLLLuXBffBenD/hPWA6Ir2Dt1kDU+5N7B5OeSwE0r6gIhAMWODakikr0f84RFCDOddhEO56Cr8gr99bJCnBVHYH4C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0EXJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEMw/9Ftx3gEQZtUYekhi+zb17ucfKlhUyxiHqIvmCuQff0uF6vgeT\r\nix/OZb1NdN5WrIwF3eD5Or/DHODEvllOV82ljChpHMpDKue1fX7Au18P7CCk\r\nrtNo0yFulpWhHn3SUJ5l1tYfbd465+LVS0Fdj3FuYMI1kJa7WUO0VpIIy7/O\r\nOo07isSfl6Po2ZXv03GVJUtnLDeVgLFUU8vGi1roOBaju5Wgo/QrX7FC2Xek\r\nLpUi77AGewnWsICR6sw+CKMqWGP7goyTpR6nZuKT4/kaWCMRxnvrg9lUZ4ek\r\nZgoyrOApkTtu1CSRprbhaI5lH+emKPfJlocmq/CiQYSnvlkvshR3nCZ8DKYe\r\nsySO62CtNHRllJw0vvnB/SYypeKAE/mmfSRqIZ6B87LDqEqzhtdmxX/W69lX\r\nRBfiYf57A6OnoaXywfsGnRifenBvufnAPO3c0AN6hEdS0WZhN8nofaHL/+FK\r\nTkCpadfF6DyGlu9LkTAlNtnX+a2V01OeTszua6lYzE11DIjjZa2dN0wW9lVe\r\n1VcbdYTWLUa0O/B4VXMbafjXKrtOzzh2ps1Xo7vXm1pgBYpzrkU7hd0QC694\r\ngHhNHSbvLwo+XsxR7sTaKK69Fw2Rz9O+xJ7WftEqFoPLfUoUcjPtq0cH6UjR\r\njFZNFYVpqWXKi61iozesSilHv23tplLhHc8=\r\n=f8AV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"766a8d5f5fc7e4e022835f16c6ecdab8d2ccf071","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.085f9b25c.0","@material/rtl":"15.0.0-canary.085f9b25c.0","@material/base":"15.0.0-canary.085f9b25c.0","@material/shape":"15.0.0-canary.085f9b25c.0","@material/theme":"15.0.0-canary.085f9b25c.0","@material/animation":"15.0.0-canary.085f9b25c.0","@material/elevation":"15.0.0-canary.085f9b25c.0","@material/typography":"15.0.0-canary.085f9b25c.0","@material/feature-targeting":"15.0.0-canary.085f9b25c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.085f9b25c.0_1657816521118_0.6600421540173456","host":"s3://npm-registry-packages"}},"15.0.0-canary.39f9424b3.0":{"name":"@material/tooltip","version":"15.0.0-canary.39f9424b3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.39f9424b3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"416598f8cf9dd093443d7dfb2961cc6a68009f02","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.39f9424b3.0.tgz","fileCount":34,"integrity":"sha512-V3JsasM6KlZFZvLVw9xHTkPogz0RvXo0HU0ws2LM7STyiztm7Q7Xa2K2xstUZumIElJI7GdcRlLWW3acITvGNg==","signatures":[{"sig":"MEYCIQDwOQU4YCjmLBpqltw98RnwgtHiNlut3coJtAhWv5vgrQIhAOoswDar3Fb5zIjWd2ssO+33ALVFOg2JaJKBIRSr89l9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0EzjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpt9w/+Lg1gxeyJWMbvjRGDV/mIiQoHFseejNkUyqTvBoDoog/qIZgp\r\nGhiDBOASk1bzG/XFVQSTrO/tehkb7U9E9NvzhQJulMwdR18cb7colH9asZ2Z\r\nPfvNOi/nAoPLdyAMw0yYlkPe5am0/BuVGu91MSBdNtfc7ueWoxNf6J+zGXA8\r\nBClNNZm2964CeiPwcwC//l/X3Mh5TjGtLkJhbE+w/MwZet8o0IfiS6l3UUjO\r\nuw6lOCOcE3xXCmf25e7GhiWP5IpAf0JLRGWeDJznMZ7iDsNvF54jTB0nTwAE\r\n4vd76MoOvFsf0Aackx1KH/LisNQljISvScZMBJM3PwbmfIldlKHIQzr6weih\r\nosF6Kxyp7T60clWG8/A/ysxOFLvJhLTegxbkrJFTaodFZRTCE+Aj9uM5x1j7\r\nriv4RzZ+VFQkvV5WhUErb0DsuaVb6hgVoL1ZyfrIAbwy4e6XZvNi5QNDaqYw\r\nELCB4PudWpwg9OdX9GPEtr3VN+8vapLF0po8p2RDNn+hrnzo2Fx0CifIweyE\r\nkPMAgeDd8pXZpyvYDUZgesFRa9Rj2wvCTTs8bLvqrCnVTsROLFwJibceYXGa\r\nbKlJdJgD+D1ZYh5WhmsG+GLDRWrK17c5ydTpfNpNrxOxt54W086L1zKURZ3M\r\nMvBazsbgb0pTxbjkSJHD9+PSD6/iiKSwwpQ=\r\n=uHie\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"62e726843fd90c6139d8ade27db8da6ded6e1d77","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.39f9424b3.0","@material/rtl":"15.0.0-canary.39f9424b3.0","@material/base":"15.0.0-canary.39f9424b3.0","@material/shape":"15.0.0-canary.39f9424b3.0","@material/theme":"15.0.0-canary.39f9424b3.0","@material/animation":"15.0.0-canary.39f9424b3.0","@material/elevation":"15.0.0-canary.39f9424b3.0","@material/typography":"15.0.0-canary.39f9424b3.0","@material/feature-targeting":"15.0.0-canary.39f9424b3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.39f9424b3.0_1657818339241_0.7309907860631168","host":"s3://npm-registry-packages"}},"15.0.0-canary.ae9fce587.0":{"name":"@material/tooltip","version":"15.0.0-canary.ae9fce587.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ae9fce587.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"35bc175a1aaeb8596cc47502d4ff5b159104209f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ae9fce587.0.tgz","fileCount":34,"integrity":"sha512-5cpoQOobBkW1eewd5KuArDpabSuT0c/BIDO7aBFGbyPOCbxI9/FTDoaspgXnL+mC+CbrQekdGuGmdwlmjKyVMA==","signatures":[{"sig":"MEQCIAyPEfdEdaqbzRY+1x2lXMH28XN7GxB+YFS5MpjMu8NlAiAr1N++CQ5sCMw/FbBYvDzjgZHieZiEbyOwW7xNZg09mA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0FugACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpepA//fQpDja/tZfydv4dymsvl4U10WjTrwiruTZGRbfzu1yJVb1j8\r\nvq7v+6H4ilX+AZ7phVobumqgRskoO9U6XJLbSXQbQmeFtZfDrzsmpscqGxFS\r\n/8SaYc5XPUZgDrXNDJ7Et39NH/w+Ir1a3O9pOP7erNvjG0U0NnITH4pfXELx\r\negXweF2Z8Nxa0Pw9mreTUj8X8vtW2HC+8Z2KwJxANvPyAgqNGXsjOOOzOPB0\r\nynrdS+R72T9/hc5ahBnwWswjWH2YypvCVsS/Y93Vlda8whxFuKfVPUm5itLm\r\n1pny4jl4ujysqCsOe4Woo1zFTqORChIpOpLS8cnb+vJ8tr2eg3GPD1A3omXW\r\nRKHqGx89xvkY8LT78gbXk+OEtSenyEogtx/H+p141mHiPksg55MA26N7u5TM\r\nWTj5E5OFOKV4QljAcZPcyC5is4eVZygB/AQHZ+TdhmnwfNOG1tcOeTr2AhKv\r\nxEt2lEH8ruFDdVSt5XW3e2oASXdnNI0dgO37WCRek4NdsQHWC98lzCMMi2AM\r\n9NHCw5Xwbl+aNX5uYUIsGLkSFQgJ3VMqxyqihqm8m8J5DOWxV0kz8uTAmMpY\r\nwvassbekxbnJvUlVcEzcQpMmqDAGTgL0dNj9JxWInqs5dT9r2kDhLfwvRpcX\r\n3sPesKbz0osjxfTvy0O9G3BhpGeRwTRWy/o=\r\n=JXQF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2d55d2ded8f3ebf66d72baffd67452a8de349b3b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ae9fce587.0","@material/rtl":"15.0.0-canary.ae9fce587.0","@material/base":"15.0.0-canary.ae9fce587.0","@material/shape":"15.0.0-canary.ae9fce587.0","@material/theme":"15.0.0-canary.ae9fce587.0","@material/animation":"15.0.0-canary.ae9fce587.0","@material/elevation":"15.0.0-canary.ae9fce587.0","@material/typography":"15.0.0-canary.ae9fce587.0","@material/feature-targeting":"15.0.0-canary.ae9fce587.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ae9fce587.0_1657822112624_0.9781030930307659","host":"s3://npm-registry-packages"}},"15.0.0-canary.1ebddc343.0":{"name":"@material/tooltip","version":"15.0.0-canary.1ebddc343.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1ebddc343.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5f29f47036836385fa8b6e767ede050818540c0c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1ebddc343.0.tgz","fileCount":34,"integrity":"sha512-6blAP6j5i8fRnAOmya5i+OoeUgDi+RKFakxeU/K1uzr+IhSuR9JU39q3h184IlY9nYXZXFZxEr2ZUhXvyUfWLQ==","signatures":[{"sig":"MEYCIQCiWRgoP9c6k6wB3QDAWSep+MEBQ4CH+gUIFqOmFpHfgQIhAJVWxaxK0vJIjd4ouS9deM7a9gcUi0MuEHilkOdHzuhw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0SooACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2aw//ZrlLPbwDigUdkOF0n4AsY5FOHZn38edjWU7ZoyAhOOthdgVP\r\n/luUALELwTCwPNI/8VQbKdR37eOeD5upLZ/OCeFVmBSp5VmRamSyJ7K5fIHp\r\n47Ju7RPjw6p7QxHyIqri8lbREbLkvIy9p/gJIVCz3BTZb321S0PUwKQJB6xo\r\nXAjm2UTiRuTfJXj/glra/tUzf72YriLHR94AjQ9402WwZFb26l7QKWZ/P1bc\r\nfBV8lQ7Ae8GSMZfHqv1Dqw9uY4dN7tJdRNDtAWyaRvKUeC7Jz+DMjhihnIU+\r\n2EelIZPTXxEI/Z1f+M+dojAZlA5zs+2gyx9eC3W/tfiGaB03OYLRgMnhsgSX\r\nEalENdRBSKQKiWXOcExad6YaGBOvygAr+qDVDlHhTclNN5d1/AvJXkZQ3ckL\r\nYlzV5mq85Yctwaiuh1aEl+r32aVO2YUECO00Hk94WiWWaU0q4oL36EzrI7mq\r\n4Z6qXkKAdtaghdFErjj2cxDwpxbhMxdUjZicPpJCFcQSw4iNcJEHP/LCUaum\r\nPvJ0hoG9fz/knhAbUl/+F4xkZFLLMQI8A5/gvQYJ6WE2tVqsZNxTmVjh72yZ\r\nEZD+PwwczVx80f0As3HZn+fzspbkw4ICFfw+KDfMBs9YR1Gg7SC2m6Z35wsm\r\nkgY8W0ImKSgnwiZ6zSQgrD8Q1YfzVwreySk=\r\n=s6Jp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2ec31cdb5e8e1a849368a3f352b213919bec43df","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.1ebddc343.0","@material/rtl":"15.0.0-canary.1ebddc343.0","@material/base":"15.0.0-canary.1ebddc343.0","@material/shape":"15.0.0-canary.1ebddc343.0","@material/theme":"15.0.0-canary.1ebddc343.0","@material/animation":"15.0.0-canary.1ebddc343.0","@material/elevation":"15.0.0-canary.1ebddc343.0","@material/typography":"15.0.0-canary.1ebddc343.0","@material/feature-targeting":"15.0.0-canary.1ebddc343.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1ebddc343.0_1657874984642_0.5169028663316899","host":"s3://npm-registry-packages"}},"15.0.0-canary.c5018840c.0":{"name":"@material/tooltip","version":"15.0.0-canary.c5018840c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c5018840c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1d7bdaff4d703d869b21bd712e05fd5a4a97b9f6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c5018840c.0.tgz","fileCount":34,"integrity":"sha512-IN2xb9BeRTZdMrGjQkQhyoFKilpzskTv2+Lkl1FifwfKmN8KXWbmmNCLBM8e9ek20pgkS8FXAAdb/iQVZNL/mw==","signatures":[{"sig":"MEUCIQD2/cB9H3voGN+gFLvgWY6Wi4D5MrnyGLZ4zUFuJv3Z0gIgbGtDEbySjKbBDa7yJXatz8S8poWzAJcXyL6E+0phqzs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1StFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpERA/+NhEaAUzVdEWsCK4oVe8cCfs1SsHqcl4RH6CIW1GXwNYMJeIc\r\nBCe66hxryfCSAw//yenZg6Fc5zYPMs2pOTU6bJuwTex7QbSanjX0WRW2yyyB\r\ngeK43IcnM6WELuMoHvDiMunTN24LZbbByi1UYTKV+2FZYjP0OIolp1/wQn2J\r\nRIJmoKaSFVuqNmR2dJn74ZQs1+zqUouzCNd3FyVZeH1BXmyoHIcSNvFjAqmY\r\nIcWhofygZN6zIZCkHWZQ8f7A7H87tc+4x+THiUMtzhHWeOn2kkpDeCOhcXzh\r\nRx313Y0mnu8enMY1c62RRBV9OcQ3lexKmh5X8uwrV5v1pI+5MLCgv3Fk1RFs\r\nsVIMrEF0hJpPcHCiq5npQ7KSOM9jQ0h0diukLaQU1TUJrXKqFUvcN/LLPR4j\r\nbjo7u6fgN4UXklyx3VUJu0OUrRAKKgIySn9KqCLKGhI4SPX3F2WLQJuZsMOC\r\nL4flmV41wIONp4Gel+zl540YnoR7AWSgUUBeeU0gTg+XrUBfI63s9o/pw6DU\r\nc5jw3tWDoMUhrQaa3kRrf5RXONXe0Zd/lbDtbat7ZVpE9uK3Y7f6ypf6zsMh\r\ng0uNMUBhHClYsnZqkyuccSLTmUxIZLYZwHVYAvrKC28DrITFeId9CSoK+AyL\r\nHUstgwDrvfVl1Lplq75r9h4jTo+YpNB+1sA=\r\n=V4Ni\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c86de383c50b7d72b8c5cf908c5fdf3e6efa94c4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c5018840c.0","@material/rtl":"15.0.0-canary.c5018840c.0","@material/base":"15.0.0-canary.c5018840c.0","@material/shape":"15.0.0-canary.c5018840c.0","@material/theme":"15.0.0-canary.c5018840c.0","@material/animation":"15.0.0-canary.c5018840c.0","@material/elevation":"15.0.0-canary.c5018840c.0","@material/typography":"15.0.0-canary.c5018840c.0","@material/feature-targeting":"15.0.0-canary.c5018840c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c5018840c.0_1658137413514_0.4995191888725725","host":"s3://npm-registry-packages"}},"15.0.0-canary.551b40d18.0":{"name":"@material/tooltip","version":"15.0.0-canary.551b40d18.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.551b40d18.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"357660c4c259874c4f8dbb62589e41b9a2774d29","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.551b40d18.0.tgz","fileCount":34,"integrity":"sha512-OXNc23hhfBeK02itvnb9CBbFR3BKmGS92V+wHTtdVY5jxkmOq5fdDl4QTpv5UZPG28+dzbyd21A4jbtxWWjyUQ==","signatures":[{"sig":"MEYCIQC+KmqXodFsKlmjNy7l+tfAdONoA2vC53lP+scHPofpxQIhAKTdFxNRhVfTjBviCiYcgdVEaf3masebjCkL3XWWYuBe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1S94ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoG0g//enp0Q160S42nJCkT769OR4Q1HGe5umhl0HkMd1Rw3KLHrqce\r\n6medt4leO952jfcKFU4grQXQbkYwL72bm7BlhIalgQwyF1/BvKWY2NeSH5Q3\r\nZjCw4ZT+RFCC/cksir2UqruoyuKv3s5milaDVxe5ytjB0ucY96CU0cxSgGBE\r\nRpz1zbJw4Y/sVjkz3/6xI/1nJOAMnkE8R8IeJz+5BA7oCIoYfoGc8opyg5+t\r\ncGvw5mUQvvHRfsmXHpDGU+7xmqs7lDngJSw5eLTSBeMTPzwBIVzZi7Tw+XMy\r\naV4kut/+vh8GNF/lvPwjnkXIuSkFMBqYveM23DZMJsc7Y7xsfzBvdRqDsURi\r\n868LW+jCOK0zf/czFj9S7E7BIoN/nynfibifU+IjGzbZ5QX4yD1Q38kcPWeI\r\n4NRSKIFrvI1LsJH92Ks76X9XMWoiOP9GJc4qPS3IrIa/d2nLT3RMak/OqvlJ\r\nhzjoXL+1uMlG+UQEQzDTnYvjZSQ2XBxrOGezSIwFJbRbqjS0qRVxprUTTtp0\r\npxX20UbfUusU5c4MdEbKllJU26ylY3Gb/Ghke6JlXR4aW3pKuYpJEaBPxja2\r\nXQ9/+CjuK2xTBvJAUFPlahCIDYLGF6Y0wz3t33o3+p1SHTu2yhL8j+gxDPLG\r\n/Pw/IHhmS0kwd1xuDP5P4cSGTmyjxI7ZYkk=\r\n=yKay\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3e9aa3499438031c9229cf2a18a1a3672620853c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.551b40d18.0","@material/rtl":"15.0.0-canary.551b40d18.0","@material/base":"15.0.0-canary.551b40d18.0","@material/shape":"15.0.0-canary.551b40d18.0","@material/theme":"15.0.0-canary.551b40d18.0","@material/animation":"15.0.0-canary.551b40d18.0","@material/elevation":"15.0.0-canary.551b40d18.0","@material/typography":"15.0.0-canary.551b40d18.0","@material/feature-targeting":"15.0.0-canary.551b40d18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.551b40d18.0_1658138488160_0.7184789685360911","host":"s3://npm-registry-packages"}},"15.0.0-canary.cf9f12371.0":{"name":"@material/tooltip","version":"15.0.0-canary.cf9f12371.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.cf9f12371.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3f7d6ee25916a71a2550a8463918e277dbdba5cb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.cf9f12371.0.tgz","fileCount":34,"integrity":"sha512-2xhSAQc2eVYMHLVX6cQrKbYc62klX3cs1+/tOG1y/sBuWZVcGCmZ4GiHgdqA52Yi8QXLB5zixM02vFvHVgxRFQ==","signatures":[{"sig":"MEYCIQCly0GHw7Fehqq6yHRsL8XaTKHllhjPEG24ybyfGErgVgIhANxYHkHLUVawtkpwAdFCkdp12txdM+DsXqrkziWgPmg7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1TBoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0xBAAm861pj4Y0U/jHCsXlP1ndNBHRV5pRNh2uETf+AbRAr8mmSRW\r\ne0OciJOWiaAv9ZGxLNa5jD5gLaH5HINGY49waLQq6/ZtjsD+5Zi3BxSsC3rr\r\nkIPOIl5gbxHp9hLtrSnFLfMiyzgJ7IwS4sAGdMNHrSBMWwimz/p3eVEWYycM\r\nP1UwFKrGKej/rQ9pRriETOu801ga9IgN1nMm+8o+GcX2G1r7XObjq+KcrIHR\r\nNWjiP12Z5b/3Ba6ATqRQ4/tIm5rk8/qUDCpkbHcs0LSJHdbbCiE/UT4QCSiv\r\n4fMIcpFavG6qVq9Yo41jPEgR5tkh2fs8SxAeBSTnZx3ddjAEz8RghEDiXMln\r\nIfSKzy5ZUY6Cr6XpMPAz6EBJYRrfCe7rAMw0JPebyavhYbBXCHwV43eYFaOO\r\ndgMxKh1f7y1bolb1batGH5IEMxTSPtxykcfkKEAHLQUGP3u4E0OQAPfSOUz+\r\nmmRBVAZLciCa+shWoH9XZlEGg0W25gmA+xWJGqIoY5Wl25dYiWNUbF5gX0mX\r\nup0bsV8sKxwkv80977NQ6UkV7K5hZdCIYG44wZ+5M/EjPjrCc6VqlQcY31E9\r\nINWU7JITDOOGDMhE1aTAYumgsMAREQ96sqV6R9YcAK/Aovi080XdzJ8LZ02U\r\nTTrE1+2WBLxktoBLeDuRgaLJNcOFyIz96K4=\r\n=cHgt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1817e344a80081e042f37248beeeb96228402878","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cf9f12371.0","@material/rtl":"15.0.0-canary.cf9f12371.0","@material/base":"15.0.0-canary.cf9f12371.0","@material/shape":"15.0.0-canary.cf9f12371.0","@material/theme":"15.0.0-canary.cf9f12371.0","@material/animation":"15.0.0-canary.cf9f12371.0","@material/elevation":"15.0.0-canary.cf9f12371.0","@material/typography":"15.0.0-canary.cf9f12371.0","@material/feature-targeting":"15.0.0-canary.cf9f12371.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.cf9f12371.0_1658138728114_0.16367312324798133","host":"s3://npm-registry-packages"}},"15.0.0-canary.2797ff8b6.0":{"name":"@material/tooltip","version":"15.0.0-canary.2797ff8b6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2797ff8b6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"74a940a8d824174479d29e7ee973222e6667797c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2797ff8b6.0.tgz","fileCount":34,"integrity":"sha512-PfiHsV+9/7qSUWOA/60UhPzBqUGMq47xdCnDsGRhgPNQ3tLiDmxoKcMlHymWTKHnFTkl9iVguK3I+gs/KL+R6A==","signatures":[{"sig":"MEYCIQDKEJMu1LNgvI2MCxq++Ux1xHIfnKCipJ88hMmhHW9PLwIhALhnKv1eicsZ+3M5vL6AueZPMl9MBHo/psEccqzQYxCX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1fnCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWuRAAmWRkq9mm6jqiZ0dNmfQVPjJ+Ir4o2W/rMvPFenvSffB3SqWz\r\n9DfnAUcCBMPJZCPFlKihHiwpMpImc5jjjid4E04L1RjWiyCrQ8J/4vTVAxzl\r\nZI5lpnL0n8cXJKvJYOHlxrfLTqn2Ae8PlLzioARsKxfoJc21TDw3QdR/vejI\r\nyn79SLLp/V3TSpufis+a3h+HwGhSzw0gjOhd+my+S+7B0mNS/ffdzFomG/Yz\r\nd2aCZ7s/Vu9yPMd8ILZi4MzZQQeCxzw09Z/9EeAkYTt8z3J459BOaoDf8gkc\r\nDWg/airFNaG8h9F638K7wTppMx3a7wC5MWKHT81l8WBLCd+6U+oAj0tLH0a3\r\n4iKbtgSimUbpi2Of+vaKBAAFRto44GfnE96gk+noDl1xyjS+RDCLbCQHv775\r\nLKHtASLTIm70Rvhlrar1FDzEKbPdWHO5hT3haX5a/sVNsV0caO8d5MplwHHh\r\nu0xJWiqMmwQYmX2EVDgkylJZN/f28ddWrH6AK2BaoeWoBspXPheUo+Z4cwWi\r\nHNxzYQTZvghzzus0CyUk95Yom3wNZOdKJ/oQMPoEXJAqvnoxkErmXVTWTV5W\r\nmG3h627K7ZWIXei70mzMCzmLp0kAvUvCnMDob3GhPMUibLWoJOMVBpPwLzsv\r\nOjxPvhoUuNy7wq0Tk8iaAAlgySRHEzITJGA=\r\n=eG45\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2c89951e5e0cfca0b1dc61a4f30259b33cee139b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2797ff8b6.0","@material/rtl":"15.0.0-canary.2797ff8b6.0","@material/base":"15.0.0-canary.2797ff8b6.0","@material/shape":"15.0.0-canary.2797ff8b6.0","@material/theme":"15.0.0-canary.2797ff8b6.0","@material/animation":"15.0.0-canary.2797ff8b6.0","@material/elevation":"15.0.0-canary.2797ff8b6.0","@material/typography":"15.0.0-canary.2797ff8b6.0","@material/feature-targeting":"15.0.0-canary.2797ff8b6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2797ff8b6.0_1658190274603_0.6842595802945575","host":"s3://npm-registry-packages"}},"15.0.0-canary.110fafa17.0":{"name":"@material/tooltip","version":"15.0.0-canary.110fafa17.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.110fafa17.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c1bdc534bad6100918cc82b60348d9cbede962f7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.110fafa17.0.tgz","fileCount":34,"integrity":"sha512-N/g37RmQozqP43MwMbTNwKm9ad6jkA+5cGxotjST98p72c9lnuQXfovdxEweNyjZktcjKefzUZvwbMnZk7X0cA==","signatures":[{"sig":"MEQCIGV/EkVbziWnbkz9twD3UJfKRonThUC2u4n1MMMWTZATAiAWYhgmaHWuzLr4N8HlfKz0H/NRhdtDDe1YfHetEio1Ag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":828125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi17L5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCbw//VIgTlKkdNsUnAfzgyzCZ5BPA8hAx544oF9f54hlCVIgQG7Ki\r\nvCceQP2XoxaaBiTHWKn7FNSzWKFZEYmn27JnY3E+APIlGfR19rzolCMVVQFM\r\nhmAcaQ2E/fih0CHcP0nNRYEp1mieQAslOAPwtrRq2kwoJKA1u5/BTKlctnwz\r\nxRr+Pk0ZCmmxKvWmKFKxNMFyIQf9lIeROCYwCMtuR4DpIu8b4ZsYXrfvOEzy\r\nGvudtGdiID877R9H1xwOIlFunzmymRdGZ0lBnN8+mii0mkdbGZLBd0f1FvN8\r\ncIxmyqPNAYFnqV85vmQ05xWGbxKOP046RRQfUBmbM2fd8H5PMtucFE/jwYFX\r\n6XJePby0107YyOeK2CRQHHLZVid3DqVcVwCzQiM7bN6ADpkFxPJS/eg/UP/w\r\ngQcYso29XYMwDukToXT65EeS5Q6VJothZ9gCmum31d8v2EbHcuq0pr2tlViZ\r\nl3Dg0R6wnxzr2jlXp2scymg2Dl085c8+x/rmTJLGD9g3QB+nl+uwxYl1QZVC\r\n64mY3fMNXdq/IsAkew6XZAVOCtjVCOwlNvs/pFlZvo5HWhihrRA5WF20NIdx\r\nXhotsDjKE40LU+AyAIo5r8QxVPk2HPIYGdBj9L85DYriwQSPQciuDUqCjGGW\r\nv8EVgypHJOpewsNqg8A4jLyFsrOytuL802Y=\r\n=p8Hb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ccf0ed3e8eaadf1526fd10979e8c00e79b228f5f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.110fafa17.0","@material/rtl":"15.0.0-canary.110fafa17.0","@material/base":"15.0.0-canary.110fafa17.0","@material/shape":"15.0.0-canary.110fafa17.0","@material/theme":"15.0.0-canary.110fafa17.0","@material/animation":"15.0.0-canary.110fafa17.0","@material/elevation":"15.0.0-canary.110fafa17.0","@material/typography":"15.0.0-canary.110fafa17.0","@material/feature-targeting":"15.0.0-canary.110fafa17.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.110fafa17.0_1658303225300_0.08387418343645248","host":"s3://npm-registry-packages"}},"15.0.0-canary.386ef1d2f.0":{"name":"@material/tooltip","version":"15.0.0-canary.386ef1d2f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.386ef1d2f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"10822c1bc2dd013b404de6a3651204a724386f27","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.386ef1d2f.0.tgz","fileCount":34,"integrity":"sha512-o79ZbnAHToHyaelr8jxviBi4BhucZw0ngixh5OG1i6TEQRHUwaJrT105lSyhThSWT198e2bl348qIuNb+RYcKA==","signatures":[{"sig":"MEQCIDGew2MQ1yP1J9f5EZMCn/8ffUYy2GxnyQqvKvpmgQV5AiAVQQPFmpeMGYQu7VqBcZWL/en50S8fA53B+atX24v3AA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":831015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2EdbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9TA/+MiqkYZiwF9w9LodN6rp0BmSjz8f9SmWU9+71ahreL2paNGEa\r\nIpR3qgw7SBwb8ptanJ4ii5qCz/OpCGPDWEWPn3v/z38r6r2wlwAV07e+cGfE\r\nJSaL3nxUg1D9gXZ7zrZ11pm/LiildwTZPOC5/jIZSmxY7xX5bMihAx+0vofz\r\nJ5cEngTXt49gtEULz4aAXtdv8LT5VZimDJ6daHioxhsoI2L39bLQa6k1LAdP\r\n1Sr1TA9oZw8+b1lJ8hOx5LqgHjKEEcNR5mJXU/zPw+7icCCMJ1iZyNOO6Boi\r\n1WspulPmLJdRFv2O7jj1DMmk9IQlOon01WjWO2paJLgveU5OOkttAKia5TVR\r\npGkN0JwJf3Uk60O1M3aMdURa8yhsfHonthulkx4iNSCERu/rzKUasxYQGzem\r\njWjs9oUolI4sOpHlITvYsbl4Mfnnp/jdEBR2E3z1DlnRzrYxZPPabfgcGKT8\r\nwfs0752//A/InbGBDydSlqLTAdxxhAiZOp012nRe1o/dny5fxJFk+WoE0AEh\r\nQWtqIaY3PfBN+7SbYq7gr1baQgIywoiGtYSZW5BxNjfKtMWy19lglbHIX1vz\r\nZfcXTmLwENmLx5pJ+O62SDpTLkJjhV/C4OadYpwqtlbAWbOxZdpBkIFmbPlr\r\nLQz0vcTGBo9hG2tA3+i5gF/UyaO2mmlmlME=\r\n=Skf8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f81dc27b99348c90268023c46429639f145ca534","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.386ef1d2f.0","@material/rtl":"15.0.0-canary.386ef1d2f.0","@material/base":"15.0.0-canary.386ef1d2f.0","@material/shape":"15.0.0-canary.386ef1d2f.0","@material/theme":"15.0.0-canary.386ef1d2f.0","@material/animation":"15.0.0-canary.386ef1d2f.0","@material/elevation":"15.0.0-canary.386ef1d2f.0","@material/typography":"15.0.0-canary.386ef1d2f.0","@material/feature-targeting":"15.0.0-canary.386ef1d2f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.386ef1d2f.0_1658341211557_0.3718494279484117","host":"s3://npm-registry-packages"}},"15.0.0-canary.c3924efef.0":{"name":"@material/tooltip","version":"15.0.0-canary.c3924efef.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c3924efef.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8922f2f1e8475c61bc79fde483c1923d27056c38","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c3924efef.0.tgz","fileCount":36,"integrity":"sha512-h9jAu4deZmi/M7AP5GeaAfNmUBQCO2Sr8Gf48Ms8wBezFPsH0vxg7IDG0dWxGEkzya5EzCKtaYHFWu5Pk2JU3g==","signatures":[{"sig":"MEYCIQCs2Ec+8Z+SMiNTIQJzHRyFQDjxCxMlg3epmYGNnWNa3gIhAKmZeKabZepJnANuypoj0mUE3MmOyUG0Ht3zRsxpv4+N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":839294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2EnyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKWhAAirmU6rTf78MoXaX8JpVErJvW8DkGFjMSbFz7B2gVETum5Yoj\r\n7ZadTmGDyj5lbvkR46S2SercPni8zwGFIm3fqCrXKTlYm+LIi2eFZelfxpCu\r\nz46nPKsWFj6QLhrfjGXg0rTkEsfiYkizzkpV2cpicUws/z2yJJizo979jhwR\r\nSWy4L+U+9MzpLzSlCI3uwTBe6Hzl9Thghs3K7lqbtOLMA3k7fBrEaDgB+VbS\r\nxtps/6m/EIQ3w7bDj0B+raMa3MnRCy3lmiOn4vyYCKVTIDfo5c/t+SbUH4Ln\r\nUuc/98Fs6jjg5EasPElhQ8ADb0pGSly8NWRSMoN38XeuZ3Y4Yy2PW8EYKv6b\r\nckxoPh/pPsK8an2VD6MmdBwlIez0SDWKtjXfItm58pjL/vS4Y128VEOBjtD8\r\nd2l8elf0kjcXRaZE985TdiDrmYK4SZ1vWV+IGwLUd4vggsfJt0VsEmTCHgS6\r\nx5I/nHarQw1G9YoMLf9dJg9pBiJqwwWcTqpIulVLWHPCN1ZosKa01oGvEaqu\r\nnl+P3nWqyKzBxl5jSLNcEzTQVIkzKVlTo0wdp7Jc/EW+/etUsi/GjDGzSPSg\r\ncPr5ie3tVczu8A+jT1G9kr5/fs4tmD22Yavm6RUC4QyHn3JxTO1ctlkGr9JH\r\nSMr2ZygH7woXnbhF9yetgib1l/0KOtJkhtU=\r\n=bFER\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f665d9454e06d217296aa1a2064c9c67d3fe2759","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c3924efef.0","@material/rtl":"15.0.0-canary.c3924efef.0","@material/base":"15.0.0-canary.c3924efef.0","@material/shape":"15.0.0-canary.c3924efef.0","@material/theme":"15.0.0-canary.c3924efef.0","@material/button":"15.0.0-canary.c3924efef.0","@material/tokens":"15.0.0-canary.c3924efef.0","@material/animation":"15.0.0-canary.c3924efef.0","@material/elevation":"15.0.0-canary.c3924efef.0","@material/typography":"15.0.0-canary.c3924efef.0","@material/feature-targeting":"15.0.0-canary.c3924efef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c3924efef.0_1658341873885_0.7583998472348328","host":"s3://npm-registry-packages"}},"15.0.0-canary.cf5c5907c.0":{"name":"@material/tooltip","version":"15.0.0-canary.cf5c5907c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.cf5c5907c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d530f3da5cbc475feb8e878d89eccde191688450","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.cf5c5907c.0.tgz","fileCount":36,"integrity":"sha512-HjlwopxtvdXYRpFYO3ZlNehK25onD3PgROP8HTk19YDsw5Pr1dHYK1zsxSkUyKXN3cnx46NBNI6iq+t6G1xL5Q==","signatures":[{"sig":"MEUCIQCSqZ3sa2GpaTcD3TQmvBFY22zLRgtFjkKJlZmRUB49xgIgMAjS1gTkywahWOovVefPJULM9lLQ6GM13ghGp/yQQmc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":839294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2HJGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWDQ//XahST7EsSWASeiRqSijzytsgbalXt+kvFOxV0ENX+UyuBWfe\r\nVeCeP1zz9KgRzIU1PqTA/9aImmLz+dLGsg2wXtP3soaxoePxYoz8jRnEoa6J\r\nldW0H4kukR3nwPo7HJwZ/7B7NLJrBeJ3e7MJvRiLa7bAL1a0fsea24yhGNig\r\nyZukpZd6+1hm8DDJDNlrQtsRhbE3JCI/nX0OB887lOthOCM1p8X+oVJP8LeL\r\nZPk77oyCB+Oc59IaV5o3rrsNA3aE6bDUZnFMCJEJ/j1v9OW4IEd0Eqsc/3U3\r\nuQGOrwX2yrCrVo2URAlT9tQiKIlPdtVAiAivCrzu9UX4xmCCkneT2R7s1IFb\r\n7O3Y/rSzBSqyfP1CF3dhx7B87Z43HblfNg+zlLZ1FHRKT5OzzLTg9bKctpKi\r\nD/Zz8+TtKis1mqZ/D1jRl1b/cX//y7RkgAMIJUMoRjvJHhoAYs0lrqAojKz1\r\nlPRsVrfOQujOnCuSzA9NKVRXM8fEsCJPkUDs+lYo46PmYJotLoR92x7VJBcM\r\n6fhIdeoi10Ii14dOcHrqWV6UmIff/AGC5FUAuyGLazuabbWY5TSYhMlACYAI\r\nmHedRN4lQyrbVEtxu21c++3Av8ZqfV8yQIzgsPij9LBjiLKXfQ8fxinqX7kE\r\nE88p1po0xUZgDJCxxXGIcNFMAW9OgrKUdxs=\r\n=ezB+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    lorem ipsum dolor\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    toggle favorite\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ff18947542e40ce8532c2ad78551ff4e74f9d647","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.cf5c5907c.0","@material/rtl":"15.0.0-canary.cf5c5907c.0","@material/base":"15.0.0-canary.cf5c5907c.0","@material/shape":"15.0.0-canary.cf5c5907c.0","@material/theme":"15.0.0-canary.cf5c5907c.0","@material/button":"15.0.0-canary.cf5c5907c.0","@material/tokens":"15.0.0-canary.cf5c5907c.0","@material/animation":"15.0.0-canary.cf5c5907c.0","@material/elevation":"15.0.0-canary.cf5c5907c.0","@material/typography":"15.0.0-canary.cf5c5907c.0","@material/feature-targeting":"15.0.0-canary.cf5c5907c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.cf5c5907c.0_1658352198648_0.7218082311525229","host":"s3://npm-registry-packages"}},"15.0.0-canary.0617e2319.0":{"name":"@material/tooltip","version":"15.0.0-canary.0617e2319.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0617e2319.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"818d5dc9a6cbb351dcb22e7b83cb05ba22bb6f85","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0617e2319.0.tgz","fileCount":36,"integrity":"sha512-J2Frfn6q59793aIyCVdsgS8f0jNsp/Bqhij+Yo64BVBx+C+1gAEFkQ397GIU3Cesta7KYTY3H4tz519fvEFcRQ==","signatures":[{"sig":"MEQCICwYGIE3lINtUHpOAgo6jrwVSZl0rQeedCXaVSUkigV8AiBOkpRvLLMqUwO/xmupQ/Gwm0YtaZ548UfO+unpJf22Bg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":839496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2HaVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsaBAAnkZFUcyrf8e0K0E2Hb11Lal3CHsXZ+IURO76uXG54vkcms3K\r\nVO3UaNeLWY0GiXSvGTZeSlkn1qBA48VRhfos4oxO50oEllcSJqbZNIn9ee6q\r\ni01bAqG9W6NarQbOgzYff1QdyV1+2O40jMRoF5p3eGqGadFKeTvVf72aF72B\r\nlCXPEom2ke3wAAdlN7Bmw69Fyy7VHPBib4uX7ovUC0U3XXWdLTss3F8ye1WP\r\n79pqjMz9vrdo6tj7LAWHbBWVvo78ohBFzzQ4gbPPeVgWKRVi+TG2uZkr75Er\r\n3kRwXc6rTvjQ5P6SzBV6dwGFGLp46Eu68HlvD7n34GWh2tvWQyb7N2ap4+5F\r\njhm0UKleZmsHE8IBGqstFV6S1Q+S3cLTnkIscodThcu6Redf8wYS4B8j1CHg\r\nHW1EB5VDXHT0Ypuytr1Uu5/pCfpRHAEHvBmDZDU5A7rwC/Q4vuwL2GkvOAPS\r\nNS/C0bfvx8NC/52/Ide9zeIbRVCRelRtb9zGVIL2DRwfBsm6+8WzQValy9/e\r\n/50GURMRGS2W2nXLtaiqhTAQNpO0SPAJigyWwrEp9SEMQUhUwJbCgSK98WVL\r\n7UdIxA9T3ECiJEKvb/TozEQgYY0nB3GAbMf2IBFuqJDgL6a2SANY22zX3/y2\r\nJ3mD3623PGxY9rt71xlWx2cviPOqCMMOiq0=\r\n=z5xQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a4d6efed0d00cc69adede24744dc368da0b2c897","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0617e2319.0","@material/rtl":"15.0.0-canary.0617e2319.0","@material/base":"15.0.0-canary.0617e2319.0","@material/shape":"15.0.0-canary.0617e2319.0","@material/theme":"15.0.0-canary.0617e2319.0","@material/button":"15.0.0-canary.0617e2319.0","@material/tokens":"15.0.0-canary.0617e2319.0","@material/animation":"15.0.0-canary.0617e2319.0","@material/elevation":"15.0.0-canary.0617e2319.0","@material/typography":"15.0.0-canary.0617e2319.0","@material/feature-targeting":"15.0.0-canary.0617e2319.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0617e2319.0_1658353300870_0.8422237913427593","host":"s3://npm-registry-packages"}},"15.0.0-canary.a743b7967.0":{"name":"@material/tooltip","version":"15.0.0-canary.a743b7967.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a743b7967.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9c8260111c6917a6ddb2fd16a3d08f9a9c79ab73","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a743b7967.0.tgz","fileCount":36,"integrity":"sha512-069zz/Wb6awHZ40+LWnn9l5SfkTFytDQXtGu5SsjAGRs9bRqcYMt4b/nuFYYRMchr/btYw0MUiNkVjJkyv2yOA==","signatures":[{"sig":"MEYCIQD31hiNVS1yc4mCUmmY0OsiWfdJU/83CVzqvj5TknggxgIhAKIcVbw7kw9M550ctXYKsukmLK+L3D2G2sRqcGwppAmV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":839496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2HqKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKTA//Wk3mZKIB0gbdMzDKwESsDJxiAFAxdLjJxu/+S2/4a1/aklSN\r\n6lMlq7P5y2f2xD5mZYCrOmXtqPY0GhT2yIkm2ysLO2tPNF+K5U0oG+8/Bn2n\r\nUh4KrqY9y0qZRFzskdDvYl5bQUxOuaOf5zh3VX59vgjtu8NrbQ9PLabPdwbU\r\n0xEl8tOc2Siof9WOkfV3sWhk+MJQTSPcj9WQ6ouB6ysO0WCMgEX2yts8RrvM\r\ntN/fqFD6xFYL8HFKoF7NIe4c9/awRCfG24fVmNQuR8iL8qAZS52uxnmW5Uwy\r\niDRnsqsZlfFgsrL4pf0w1qOXKQ6ROWT93WnxkSuE1gGB7FjDgPFBx/SnFwm5\r\n1R3qZ8440uQ8Nbh9ceyJUr9wnz4dyxzTuDluQ7HcBuSjdI7ov6lVJTr21LVj\r\n64JQhS8pYtwT4GdHoukRemRJRwyzgwgQ0jz+oLMlWLpMR8UdvXyrv8OSu5PL\r\nx/wrl0x/QFM3GF6w+pNgU5vxskzpxGh0QoFupL+DP/KG7vfgGdKwduoTKQRw\r\nlxqOgsu6wMKFRW2O5GrolqQq2kw2K2g6UPTWwWPgnN0KZK92fCZGm5LZNmxa\r\nFRkOBwmMu3N3Wu2VDxF4LW80R86O16Ww8HHbXMPntUoRxlsEBI3vn/lnZt64\r\nG40BZl/wGa/a+8irs7GFa/fd+Sm7tOMgs7w=\r\n=KQL6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6fe7cdad71b01dac35a3d815662020bebbe50e23","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a743b7967.0","@material/rtl":"15.0.0-canary.a743b7967.0","@material/base":"15.0.0-canary.a743b7967.0","@material/shape":"15.0.0-canary.a743b7967.0","@material/theme":"15.0.0-canary.a743b7967.0","@material/button":"15.0.0-canary.a743b7967.0","@material/tokens":"15.0.0-canary.a743b7967.0","@material/animation":"15.0.0-canary.a743b7967.0","@material/elevation":"15.0.0-canary.a743b7967.0","@material/typography":"15.0.0-canary.a743b7967.0","@material/feature-targeting":"15.0.0-canary.a743b7967.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a743b7967.0_1658354314184_0.7988730595837514","host":"s3://npm-registry-packages"}},"15.0.0-canary.69fd619d0.0":{"name":"@material/tooltip","version":"15.0.0-canary.69fd619d0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.69fd619d0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c62551aa1cf49c521609c38260c93c9ce999b265","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.69fd619d0.0.tgz","fileCount":36,"integrity":"sha512-48XTXQB6IQrDbvCJjryC8EOe9ZRgQSBdYdm427fIGhmbBC6zzcrjfHus81a/E3t2ruSaFe02qld1y772HyqbhA==","signatures":[{"sig":"MEUCIQDBb+W8WjRT4iQRyEUui/fDm9LcXcg/zWleTzBKBcpGvAIgD3feGObGFPRvZzr9xJufF23pTp/r1ueoQhCQ4M67Ic8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":839935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2H1lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoWAg/8C6Hys1OhJf1k1ppm7oWaoLhMW4UW+mh3u+NaCgZgGQYS7ePt\r\nvM3A7n9wS93cUzo90JRAjwTVpmg7ji1MwhkNBIw7FnCkf39yUrju1PhLjxjJ\r\nwhUchoy1vIfKBq715vhi2PCUuo/5rHPiKbQ3cSQYHDThxsvs6ZMpZXp/bp9P\r\nCRC8/UJcgjYijCB1pMr+w7Zh3otJVzacxFnGFcRDnp8o4dyomvgsoHJVBvKO\r\n1jH76jbbeiotXAk0fpGpUZZ6u/6UTzboq3lHOziEBzPMyEsK4o9eyoVyoIMH\r\nVXcvPi4XBNBmMrCerV3ilBPrdVwu9L8riGY4yXtnw5qGBP05AlUuKezXzXpo\r\nX9p4bzNyQjW74ITME5+79PHrbETL7Jkl3xutToD59vtyv1LKnsXF4zZDc+Wx\r\nUX+6EEq/cRe0+N9SQwGv0qdhDHK7BCHqyozsQREkt82LE97x6N+fLUuXd9Zt\r\nxijTVXm9dTwrVrmuqkpOoglnWKW3ffurp8xg2Zvr8jR62FE8INOzFZ0eA5nX\r\noTRRlL6b1XyFfpvKKHMFSpcv82ZiyldFWOvFfuZ7sXKLGPSI5lAlXbz4/VN0\r\nGk0jcZBpdyxNRfHOSC5YG3qQDnfFfR2M/jGc+kfL+yoYo4qw/ogw8r36y62V\r\nK5+xmoyNbOTEbCHlzvjvosC+UMYCmOlzo0g=\r\n=HF4h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8982644a21769a71fcdbd9d8a35d87f00bf73b3c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.69fd619d0.0","@material/rtl":"15.0.0-canary.69fd619d0.0","@material/base":"15.0.0-canary.69fd619d0.0","@material/shape":"15.0.0-canary.69fd619d0.0","@material/theme":"15.0.0-canary.69fd619d0.0","@material/button":"15.0.0-canary.69fd619d0.0","@material/tokens":"15.0.0-canary.69fd619d0.0","@material/animation":"15.0.0-canary.69fd619d0.0","@material/elevation":"15.0.0-canary.69fd619d0.0","@material/typography":"15.0.0-canary.69fd619d0.0","@material/feature-targeting":"15.0.0-canary.69fd619d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.69fd619d0.0_1658355044940_0.9131646462290466","host":"s3://npm-registry-packages"}},"15.0.0-canary.2a6ddc1cf.0":{"name":"@material/tooltip","version":"15.0.0-canary.2a6ddc1cf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2a6ddc1cf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"51e90f86c69c7df66f7e0f4ef8544152f3c2a511","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2a6ddc1cf.0.tgz","fileCount":36,"integrity":"sha512-iT+giBycPNzn+Xsw3Mb1bNqgq1w4kiAlFhFGU699MfJrKl5r5OpKIUUQPdBpHAD5BI3FBpsxVSF3EaNVm0mraw==","signatures":[{"sig":"MEUCIGnzmyxxC1V/QU9gIgBi+TXwLz2K8/0Vk+/VQ+6AHTC5AiEAy3tJYjIbkY6yLmnnxM9hA9NM2kbdoR3b5p7SqNbKRtc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":839935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5AV1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqveQ/7BvgdZOVyys5Yd8e2QSakxRRsyXW0UVcRssUoV2vMJM1tCxMX\r\n994ZnejgsB2LoyhzlDx6POWJBnukNPzHmkif8fXo2mWE8Tz4UPJYyM32RgSE\r\nqlr7QXBYcVPfpQVdh5UwUgv44UrIWqaQA86u4juVNe69/9AMYUQP1A+2zpVm\r\nr7lITdLPn4lP2S3t8eJJjhVj9kWcHshsOH5pup8h0WZWok1DOEO2m4DEJcay\r\n1H8KepALYGh8QpoGv9OBuEtomMpUibBq3udociqI3623FjqccU0f3hAwd5Zn\r\nTVZVqkBHtD1HaadxxYh6PpncMZeNVAoAd6n868pJSxd7qZrZHBKAqqFIbQWt\r\nLhkicr1TWDLTVCjRrJkoAzErNnK8Eu2uxAS3lRFq0oyXk9boq853ip8Uss1M\r\nq3EXMgesJRdE3BIwVE2rkIzlX4QldUX7rZgZm0oryVGYC5DrJwaqE8OyGrpu\r\nG7jMiGM+VBgAoyqbyFlg932Len88t2tOPrkmjYlmG2fmdKwsI+a1mjIEPfur\r\nFE/VlbrDY1wV6MSi7aN9MPGTyXz82gPqOFp4O9oBISOLCFGWhkNQI8YYRhmC\r\n1KfDLRXVXrGTSRF2A//mSmcSkITjl6bJfi5ej2Kxfn4xM9REsbEJv6I54jpB\r\nWyW1yzCUL8yrS7h2hzpR+DO/XeVJRezMeyU=\r\n=c8KQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0e951ea9d38f3d449f24bd1d8ecb0fa70c0da462","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2a6ddc1cf.0","@material/rtl":"15.0.0-canary.2a6ddc1cf.0","@material/base":"15.0.0-canary.2a6ddc1cf.0","@material/shape":"15.0.0-canary.2a6ddc1cf.0","@material/theme":"15.0.0-canary.2a6ddc1cf.0","@material/button":"15.0.0-canary.2a6ddc1cf.0","@material/tokens":"15.0.0-canary.2a6ddc1cf.0","@material/animation":"15.0.0-canary.2a6ddc1cf.0","@material/elevation":"15.0.0-canary.2a6ddc1cf.0","@material/typography":"15.0.0-canary.2a6ddc1cf.0","@material/feature-targeting":"15.0.0-canary.2a6ddc1cf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2a6ddc1cf.0_1659110773457_0.2973591364797925","host":"s3://npm-registry-packages"}},"15.0.0-canary.86efd56f6.0":{"name":"@material/tooltip","version":"15.0.0-canary.86efd56f6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.86efd56f6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c4d10ccf9369b05881e6990c632aa8cb4df3505","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.86efd56f6.0.tgz","fileCount":36,"integrity":"sha512-Tfj+ZCBfoNxKoRLZS/B4NtUac27vGljgrsTczYbwfeiuYrYf4Pu0QwrxAAcodGRCHjSAL2JU2U3c3f3St8oeCg==","signatures":[{"sig":"MEQCIEcHfIwowkrl1Wj+zeHdXZzYv7PQfB3eWmNOyCisNlKRAiBNfHcq5Y7xPpR/XBqZwwX2eqxGX6H77gWIZFFpF6pMmA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":839935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6Tj2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqljQ//XPYzPzI7TYWPrQtYmJNKydV2JpA6P682gXhLiKoxFIQLIyod\r\nARFE4/G8a0oBmKYDaCFWpqFjBRMCyWOBdFF0cP7WjpvbQLaUs7Fzow8QHC0E\r\nEeC6TTwayXO8HOShNF5JILsGyXx2gau6xsI636fM+V1qyR5k2AHS7L84OmO+\r\nMdIHvbs+1EXeFlOJmqXtnsaz/I+IXZxgBMaNTGv3Ku71knmkngK4VZOLFTmG\r\nkdF+rU8FwCb2wq4pE/YZtjlo00lQwwWNigej63HqtWSkY+1Senk0dXdXPbw+\r\nkulCLSsjJV3dXslehFXlxujLDU4eQNrhBdgqnfmwn3JK1FftmqzkP00QxJwm\r\nGR1xGgkC9Th1n5xIRANyWZHk9MEfUmAN21aZodXPjMYFmE1SzEXCKW8yZ+W8\r\n5QUthkkiB5/vMdpLGJBCwOYieO0hZwMggcHtp3QXnvZpBcXgflXQ20RJMRQM\r\nakZWRGa3GVwPfT2ZXiv/c/cckJLTtegV/b/rgUkRYARBl73BY76XpuPMb0GH\r\ndXV6P4i9R1SxSUPlVbMNVcpTX3mTQ8GUaU3w2hhGRvqzUiYbgctCHJN45QB+\r\nBb0FsaTT/yMlgHJ79YrqzEj8F2U7oHiYMkb2G9kmai6rHzkbRFshQP7Dgx34\r\nbD6tCYUrh9Auz1isVYqkNX+EOyJvaGqybqM=\r\n=pTMI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a4781ca009f9a9b59c7dfff5df2d23bb14b9de2f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.86efd56f6.0","@material/rtl":"15.0.0-canary.86efd56f6.0","@material/base":"15.0.0-canary.86efd56f6.0","@material/shape":"15.0.0-canary.86efd56f6.0","@material/theme":"15.0.0-canary.86efd56f6.0","@material/button":"15.0.0-canary.86efd56f6.0","@material/tokens":"15.0.0-canary.86efd56f6.0","@material/animation":"15.0.0-canary.86efd56f6.0","@material/elevation":"15.0.0-canary.86efd56f6.0","@material/typography":"15.0.0-canary.86efd56f6.0","@material/feature-targeting":"15.0.0-canary.86efd56f6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.86efd56f6.0_1659451638560_0.7044998643687754","host":"s3://npm-registry-packages"}},"15.0.0-canary.ccfc24d19.0":{"name":"@material/tooltip","version":"15.0.0-canary.ccfc24d19.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ccfc24d19.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5a964932f48a98fde288dcf2ab1c2e8c8cbcd2f2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ccfc24d19.0.tgz","fileCount":36,"integrity":"sha512-5Ol4bvOOYKUrle8sYUYRBpEg49J3Psj8zgA4RR5ulzYymbcR0y6E+oimfvSHRqzAUh3iBlmPCfuBONpaxlZDuA==","signatures":[{"sig":"MEQCIAd5WcDMVunJBdXqYLjkNBsAd2iya4vTtMb3137wejhoAiAKBA+TfmUR4UdXdjhS6eDAA92KW5w97bAhoxihq27Viw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6rsnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjNQ/+JR02xCQdAQ/pIu8JmUT+lYfn0KpVqPaVIRlSHrwcueNqDzdb\r\ncKnLNynr8tj5Z43KKkokLocnjAO1Qy7F8Wf9/yjC/h2pPIC8PSx6OtD2FmFd\r\ngY93YeiMuhiO1enRbXZjfYPY++uJdYbkG1OrPv04yl0mFj91c23aa2grYEg6\r\nnB+PFjjI1ZL78/5EE3G2IqfTKsdZsvxk1yazkzrzDVCp6nGWZSCjtqRbPyCZ\r\nxze8dMgSzZernMvxfD/fxvGJDbjodrawbwp/G8YJKJR+QloGnut9bx9xahQb\r\nZwXvnr68frOnQi8ZIwUSZoc1M8/oJt1WJ+RfzUCd7FBwZv1reGKcgrh7vrwn\r\n2QVwXrFcFHEMHZ23cgjy3GeID4vmXogrGF1HLYWap5O5PL+d8YqsuhnCj5TQ\r\ncPluXHWsOKGoxCOwQSdCyZJtYlrHVyU08Ct8/Rb8JjyS0aWo2fgzSYF7tkes\r\nDIfBTyi+BOzs3PmD3m9ihJWBPHndT+WMHiU1C7U+c9ELxBF8WtHDhdOqYaCg\r\nHOpOvg2CuVgbX+wTKZ3xkhNB4C1gGF65U8oHE/gRjSO9MU4+Kk4M3seOEaI1\r\nuizhHK2OSu/NdCOuJnbd5xtGRKkDkT9QvtCRyh8GmNxQSPsmfWzqQpvXYg7F\r\n0oIxYYsfM8dkuOz407eP6yDTT3cLuP7FCNE=\r\n=ydv/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f790058ff0b4b30289ee965102aae1ca19654ddb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ccfc24d19.0","@material/rtl":"15.0.0-canary.ccfc24d19.0","@material/base":"15.0.0-canary.ccfc24d19.0","@material/shape":"15.0.0-canary.ccfc24d19.0","@material/theme":"15.0.0-canary.ccfc24d19.0","@material/button":"15.0.0-canary.ccfc24d19.0","@material/tokens":"15.0.0-canary.ccfc24d19.0","@material/animation":"15.0.0-canary.ccfc24d19.0","@material/elevation":"15.0.0-canary.ccfc24d19.0","@material/typography":"15.0.0-canary.ccfc24d19.0","@material/feature-targeting":"15.0.0-canary.ccfc24d19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ccfc24d19.0_1659550502695_0.6203260054485613","host":"s3://npm-registry-packages"}},"15.0.0-canary.e4570146f.0":{"name":"@material/tooltip","version":"15.0.0-canary.e4570146f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e4570146f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"283524452c82bb2670f08c63f731a482c0a14106","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e4570146f.0.tgz","fileCount":36,"integrity":"sha512-oAlUueYaU7/T78m1eqxXQ5UOZnB0gDWHjhxHh6gFLTgWN7vG+7plDMcRQEtHP5XVJl360GYGbRoXGtP4CImIlA==","signatures":[{"sig":"MEYCIQCN0gk4fzi5mkPMdSN22gCZk/rzyxIzLBFM3t0cfs/GQgIhANqHKJ5JVzyaC1a9m+wMmQNLRCrcsfR3wkFVK/uXOYtE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6sGPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRvg/9HHdndFmYMYSfAYEFucx03oisBsVR9YkItb9kGqCFHJ/t9xI3\r\nXALsc/jzupQCP5x7vKHE0008UJp41DkZyjlpd/npk2+LSSWFmm6fYbHM31dp\r\ngVW3mRS+R8rFlRq1bzsJ7Cdvk/vzJsCbG2lzB7UWirGqq89rNFjSn6Mu3FDI\r\n16Vaxs+dzAlF5R5QY9rg8itDWYeX29v7klt/tCJ7438RAebGTO36aT5eSW1+\r\n1iAzsGWeDAGeaD7M54EAGjMJiSOeP00PG4KYZrZAst1oelVhD+AVfsMZePeh\r\nrETIdslpr459T6cFRLCs+5XMU9EKjIxYhQ1b8szRtx7Z5JRp20LgoQBKU1KA\r\n5sORE3vDRlmDBuxIoDtyNhXLNKIlb65b6IkWaTAy4DJNIUZsBNrGszNKhtH1\r\nrGi9WfNlxNCHR0+Hd+STDx1syrZCwiHHLfiDMbJj8hs8d+6krPoV8uOo++Uv\r\n9d+T4I1XMbHUpcZLWF76TjuY3wU7UhkvFf4TRapjO46kebVbwlRueAlzp+3E\r\nvTB6GOPKF0MBb/Q1g3KQ+YxuFBk/1z5sPHItQMlFhdYjfLDTUt0P//JjUm+I\r\nEQpy1a5omjUnBYCI3bcxFTIl7w7FY28UBomV4oc3SMfRbpNlofeukSh6bIVM\r\n24YaL0/gqvWAGSG6DlfQpyn1VyMxTRrFVIM=\r\n=8JQ4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e80d690ce0a868398025065053615e866dc51ada","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e4570146f.0","@material/rtl":"15.0.0-canary.e4570146f.0","@material/base":"15.0.0-canary.e4570146f.0","@material/shape":"15.0.0-canary.e4570146f.0","@material/theme":"15.0.0-canary.e4570146f.0","@material/button":"15.0.0-canary.e4570146f.0","@material/tokens":"15.0.0-canary.e4570146f.0","@material/animation":"15.0.0-canary.e4570146f.0","@material/elevation":"15.0.0-canary.e4570146f.0","@material/typography":"15.0.0-canary.e4570146f.0","@material/feature-targeting":"15.0.0-canary.e4570146f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e4570146f.0_1659552143379_0.9709062121673655","host":"s3://npm-registry-packages"}},"15.0.0-canary.6683a36cb.0":{"name":"@material/tooltip","version":"15.0.0-canary.6683a36cb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6683a36cb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"937058fd642c9cbe668654542afafecc6ac8e81e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6683a36cb.0.tgz","fileCount":36,"integrity":"sha512-hzoyKdy5WA9lWjKBNStyvdRKdhWhvMjCMenrR18vZ4H01CNZJlpr/Uz8I9huvQ32EYzps5YAti5UFuFrAuhFRQ==","signatures":[{"sig":"MEQCIEd7pOmIlfvQOdgKrGO7DDYVdEzb0JaGoXFIUXFTZBa7AiB5oEGVmOYnJo5oqFPUQlXdBDDCTY0M47MBXsipfcO1ew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6sruACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXJw/+Iz+llVUJG5ObDxfIRmIjjZ5dqKgWoFnOaJLFOpZ/wefcWlXP\r\nqycJjOdwDW6mPl66x7pGq0HW0lFFr+rQBZfXdrj2sM+Sd08q6Q6AJq0bYjWD\r\n3FfAZ0FjyzK5hoNKMO0s9NxbTHzcRaMNTXfrr0ulhbH1qguKD2G3HJGj8mPc\r\ngokkeWyfBwF6CoWiPZWrmgSqwQXUNO5QW0RIuNh9xyAcC3rbJR/gCPo/wUcI\r\nylyD2Bop1VEbp7En0jgy+3ZIm8bEa1chQ5vbe2yswepUo9ELeTLtmXVG8sy6\r\nPE1kK59xZIPpskofsZX94aQPdCJGfL11Jv+pTarvNXhkptwqmHoipa3R1dPb\r\nf8EdF5Jc24IrKiIFKgGMsAuHJpVQSy/2ewXveLIprpAtwgPPDOn6+rVqjmY1\r\n7E5CFLoMfk+X4533dSUxS2WBGGx1WRNpDI81ay/k9o7M/7M4zN9q5VhZJS4U\r\nnjO17rgRhFR2EleM9kp/qt06S76hSBSMyjeMcR+fDdzPXK6NyS8R2LDkxLNO\r\nsKGU7dIW14OH6NWYRR/0QKATAb4E3Jj3bFUprIsFMIAx+AXfFxU/v5IRGECU\r\naateq0HZyb3pNYlsD18q7G/9rJryxjh3Zsm2ZUig95u/sjIdm9sCqjKBfHUX\r\nsbNdt3XqH54qGkYXqujLrCjiz3h7ti56/mE=\r\n=6zl7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8feb0b9a8c5151a18a06d282cce87d861ea12e5d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.6683a36cb.0","@material/rtl":"15.0.0-canary.6683a36cb.0","@material/base":"15.0.0-canary.6683a36cb.0","@material/shape":"15.0.0-canary.6683a36cb.0","@material/theme":"15.0.0-canary.6683a36cb.0","@material/button":"15.0.0-canary.6683a36cb.0","@material/tokens":"15.0.0-canary.6683a36cb.0","@material/animation":"15.0.0-canary.6683a36cb.0","@material/elevation":"15.0.0-canary.6683a36cb.0","@material/typography":"15.0.0-canary.6683a36cb.0","@material/feature-targeting":"15.0.0-canary.6683a36cb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6683a36cb.0_1659554541809_0.6665700599865807","host":"s3://npm-registry-packages"}},"15.0.0-canary.10196647d.0":{"name":"@material/tooltip","version":"15.0.0-canary.10196647d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.10196647d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ea804e74e6849d8dc1b907691b825087f594a615","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.10196647d.0.tgz","fileCount":36,"integrity":"sha512-JpI6TMnE/TyRgOYaKFm6o0WVIHa1j5IWfViE77lVdIpEXF/Qun+b6OQx11GZrQLRbqyVQmEjOhy3ND7CPPfbcw==","signatures":[{"sig":"MEUCIEr4YGg4mnQGXUXcoJVAQmQMcrv6UsFONL6aQtE9nrKmAiEAglNAEfoCiQVMKJpbzxuGr+R2lFr+zTYslZF9ZqlWEZM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6u7FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWxQ/+NILYzRKy7BmWMS7VyLymFKdKMHdTgQ5RaEodFxUn4lkqpQzE\r\nbQxNmVxj3SpCuVjW++8h2dt0QWfs3tDzgnGGYofguatNlO1MeQeAakifhCK/\r\n0HLrFwLNz2THiMlxAYz9oIBiYZ+TA21TlKwqL3aWSOKTHC7S/7G3/6EiUq43\r\nrpyWlSkrMx8N0fQUKU0LLAwz+S9OLwDZl7Qp6VwwT55rBfm0BRqThCIs/3Gq\r\nqud3Z819knacoojnVbmECHgqUymJIUlLXiMcPHqOyZgEBjkkq50vi7KhQxvW\r\nz71uPpv/02RUzAd1m1dtZ1/ip9fzFHF9SD9gHdcvRC+c/XkP6rw4zT5Ko3aU\r\nkDsAPJyxAgO6KjEXuSH9gxVr9iHVbTNklwZA/bA366Df6eCebhf28+kCoQhL\r\nVFfVBdEQJ1B4SjSAJHht1KdAC945UgTRQz5AkF+52+WL+VsHB/BtG9ueKYKt\r\n3AqByAUmuEuFZG6xmt4by/hqHc3FVzzxUDbEv7U4JYvOU9JyVZcmGFfWSkYm\r\nZcDoOzIiEz3Bg+v8nXkl45lFC7O/5jCHoXjZnFrU0CYSFxz0GI+s8Q60taD8\r\nc3MJAahQQweOXG81/N4IyUgtLINTSnUSzd0By0hR4bAkCyd3K7RWw/aBVcfD\r\n22U7O2oJ2s1xikelT4O6i6XQ6LIcaQu9vkM=\r\n=AEnV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7a708dfc09b3443c565ce80a676b159abcec1339","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.10196647d.0","@material/rtl":"15.0.0-canary.10196647d.0","@material/base":"15.0.0-canary.10196647d.0","@material/shape":"15.0.0-canary.10196647d.0","@material/theme":"15.0.0-canary.10196647d.0","@material/button":"15.0.0-canary.10196647d.0","@material/tokens":"15.0.0-canary.10196647d.0","@material/animation":"15.0.0-canary.10196647d.0","@material/elevation":"15.0.0-canary.10196647d.0","@material/typography":"15.0.0-canary.10196647d.0","@material/feature-targeting":"15.0.0-canary.10196647d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.10196647d.0_1659563717407_0.09016204559642604","host":"s3://npm-registry-packages"}},"15.0.0-canary.b20d3d73c.0":{"name":"@material/tooltip","version":"15.0.0-canary.b20d3d73c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b20d3d73c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a28b06b93ea9b20d1613715c8193d325060e9f9f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b20d3d73c.0.tgz","fileCount":36,"integrity":"sha512-F/18WuQAdfFUCUslvgP2ErUT/fUjAiZZgIwBve7drGaN9z0bx1rV5XLnehSi2uYuQq2Apk9t3OW31hQAYLhnUw==","signatures":[{"sig":"MEUCIQDlSCeZeFyRRM49ScQgATz+OYbxBkuM7wSnNtKi1rWqgwIgEfb2tMdHrHQDLMQdMrYxMdLeqKqlwzMEYkw6ADCzYEI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7EvHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpseg/+K36JWzCPLmKIE/76pmqNX8yfqbjqTUkHybIa8Z1az6nOuEZS\r\nptbe6z1NyNJMgPuiZ98vyDSAt+N42z7t9AlBBwawtHgDlPprvteg9fIjX+J9\r\n0zs2KYl+yLD0FCcqGy+e+OAocb8zDrrOXpjMFDQchbvYoPmByloOh8brijSN\r\nPWbUEXq0IzrWk0t0tVtPT3ZD9IkhD8l3CB5RXej5Mmi+tkJ0yYOu39uWj69l\r\nxM0BpiZ5DOq62b8l/jNHamkIVP0pFECeOI5i4QjAqCvIB9L0QuhcdyeuBrX6\r\nzps5mkouoD/7LlIMYvgoyNJtZCAG1aWz8hd2jQNaXCeY1VsFz7aCypy2Romk\r\nx1Dw01XhYL23VvxrF3EseBm+3QPw78QjwmF+77An1DqA6p2ew8vwEEn0AtBp\r\nwo1Nun0ATGxRHs+eVOaOWJUHHsckUzcoqtA1+F1/NKi0TTbvJW3JsW7Bdk73\r\nSP79fnvkaakoIASqa257V18Him1C+ZSLswabHzWAvE8S81DZZq5HNrMX1OR2\r\nPglOTanYUcNVxKQ7w89Y9dWZ+M+BH9TIIFttw55vBlohl5DdbCCAOhHVbfeW\r\nJkrCq6+etkWwTdckBGAJrShw8T5zMtLMcF0/syFjPjPuj3pmWmGTpoQt3pwG\r\nkSUyLcFjomURjqbHq8ahzvgSba32++uC+AM=\r\n=bdum\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c869b5a3ceaada6bf2ec164c65f1e4fd88a0e7ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b20d3d73c.0","@material/rtl":"15.0.0-canary.b20d3d73c.0","@material/base":"15.0.0-canary.b20d3d73c.0","@material/shape":"15.0.0-canary.b20d3d73c.0","@material/theme":"15.0.0-canary.b20d3d73c.0","@material/button":"15.0.0-canary.b20d3d73c.0","@material/tokens":"15.0.0-canary.b20d3d73c.0","@material/animation":"15.0.0-canary.b20d3d73c.0","@material/elevation":"15.0.0-canary.b20d3d73c.0","@material/typography":"15.0.0-canary.b20d3d73c.0","@material/feature-targeting":"15.0.0-canary.b20d3d73c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b20d3d73c.0_1659653063212_0.7511389535430673","host":"s3://npm-registry-packages"}},"15.0.0-canary.47c0c6b1e.0":{"name":"@material/tooltip","version":"15.0.0-canary.47c0c6b1e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.47c0c6b1e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a10d23b60a2e2996850d202ec4a2c0947996c2b2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.47c0c6b1e.0.tgz","fileCount":36,"integrity":"sha512-3pylOzirJOaNinzqigP/fKczdz3dRYvRrwcq+ZLcc1haQIvnSV5cuKP4ugWj6wSlA7+QAEJbDsSLbMPXe6553g==","signatures":[{"sig":"MEYCIQCLEuvdS/cP+ObcfVTwwk4R2MsLyoF7qtc1Q22GiJsF0AIhALecnbXFS4Effy81vjULXit6HngIVSpTeKUbzy2KCqLw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8nu3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3mQ/6A0j761HsDVmGaOK9s2RPqXh6fMj1oSsUMkvM88WWRNPj2NXn\r\n1eNpihIsvmOed8byqzgWijhAL+3Eh2m2rPiwlTgCoPdNIB9noQkN0p+Ljkd+\r\n5/M93QCLwB86+EkpI0uAF73baLGz5jUDN54dGTbXI4VwtDD6k39vbHQbiKdP\r\nDWd3LUeB02mJEBxC6B63GSK9WoOKEBlbyTysKfOSk2FfbwrhWhq6OtVV9KMR\r\nYY6vC4p+wMt9BQ/s0018jWAbGho+4apnVddxZG/5cg/U/g2igkRqHxchnqxP\r\nUuFIgD+pGwXzrQ7MHeZlU0z5P6BGcIGET5ehkCSOi57gJK60pDHolx/u2rO8\r\n7NZKmR+KhdD9490lLCidZffJeqK5usAUB/LJ1dcZNQYrgvDKnR0QU0rgNAlm\r\nsyUoKuU8mToCj39gf7b/BlLlFHypxVEI0bnIf1IXVUxms5tUCIGsaehjoDZk\r\nb5ARC9osnrtPdl6Y2xmL5uLmRrljdel4NIi/jF8dr6XDiQc8qjIYpPkBmzuW\r\nyvToFcSFmv9KKAiGweI3a4Syzxv8TLvJDvCcc2ut5mki7eKJ1MhGcAqULf7a\r\nu+JEGGp3UfmPkoeopFqFh/xVK9Cke9PGNx8jr+BuMfUqoSeQkqDuTbQT28xT\r\nDoMVsd3ReoyZqOsa8E5NuR0vKJvgG5FUYWA=\r\n=U5IS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"692955bb2bb9c99ddd9321606e40fe4a56de120e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.47c0c6b1e.0","@material/rtl":"15.0.0-canary.47c0c6b1e.0","@material/base":"15.0.0-canary.47c0c6b1e.0","@material/shape":"15.0.0-canary.47c0c6b1e.0","@material/theme":"15.0.0-canary.47c0c6b1e.0","@material/button":"15.0.0-canary.47c0c6b1e.0","@material/tokens":"15.0.0-canary.47c0c6b1e.0","@material/animation":"15.0.0-canary.47c0c6b1e.0","@material/elevation":"15.0.0-canary.47c0c6b1e.0","@material/typography":"15.0.0-canary.47c0c6b1e.0","@material/feature-targeting":"15.0.0-canary.47c0c6b1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.47c0c6b1e.0_1660058551225_0.7966476603003636","host":"s3://npm-registry-packages"}},"15.0.0-canary.0e3dc8e38.0":{"name":"@material/tooltip","version":"15.0.0-canary.0e3dc8e38.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0e3dc8e38.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"41a1c39067b9bd5164916f1ef4227a8848dade90","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0e3dc8e38.0.tgz","fileCount":36,"integrity":"sha512-M3LJezTgzY4YTVoNV1iKHSx51TEmKhBy1pHZ8pqtndaZfOt5F/GgOLi4Pnisawo5BUuWVfAxU1k2XnspFEydew==","signatures":[{"sig":"MEUCIEEUviRzwh+OwXfeIamjEifZ9Uam6b1WbhmKTZ5uQAPyAiEAwewNXkd879hH1yd3R73I2yFPeGisnNzoE+gcoLpi/Qo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9U68ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqlxw/+J018v4HCGedVWtEv3worwPf+SVMun6nKIF97Ffa7RnqleQFg\r\nHmfB0WjXwr7VAciDnMIhEJhdH0XA/GHS0kI3Y1sZEDrZlvIluVzp6aXVpNtk\r\nHcodc00aUrph9DJegG8/HAZ7a1NGS1jRLz5OJIrkeQOTij2/3VG9cQt/Q3Bh\r\nMdd+/BhAzW3SvLP9GNRGEGfTQn9HrZaWjJVWHmsyZwsG6nphcv71nnuxGJ6N\r\nhhaqhl0z3qsTbuOCP8KKVgquj51PM3QnGjY6tGtT6EoRW91loVaNyRo+XrKy\r\nGTsKwEgSRbmDeGZL+byTFuI5t10UKV+ZB661EGplY91/YswJ8rq5qKcJ1A3G\r\n5Xe+tTu4oJj+A3hAzgrcb+io3gCJSe4uGrz6nhLcWSZSlHOdP0YqCiC7MXZ/\r\n5Y8VUaJn9IIP/ZrnEdWIU39oLLIccuuvhKMwzhGa/6IRyQW7HyttAz79UYMm\r\nLa/zOqHxZKmtzcZPf3BoAMMkvwIF++Y2UfNtp2QQUBuy/zajlN7kOc1Frstk\r\nv/V08fEGB0nZ9l9uIPXq0njA4w0xJ7I4dgf6H4SkplL2IrG2sWU5sFHU4Xq8\r\nwd1eyfsjz2HVgf5I3sjLw48oxDruOnjnLTzoi4ZD5w1h9Q1mzdauQyZr/y18\r\n63gyK2CBLWlt72txG//fdVAlUOFVldqI7sM=\r\n=9C7i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"51983e03d07e3c1f50454770dc24ff8d6d6f97a1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.0e3dc8e38.0","@material/rtl":"15.0.0-canary.0e3dc8e38.0","@material/base":"15.0.0-canary.0e3dc8e38.0","@material/shape":"15.0.0-canary.0e3dc8e38.0","@material/theme":"15.0.0-canary.0e3dc8e38.0","@material/button":"15.0.0-canary.0e3dc8e38.0","@material/tokens":"15.0.0-canary.0e3dc8e38.0","@material/animation":"15.0.0-canary.0e3dc8e38.0","@material/elevation":"15.0.0-canary.0e3dc8e38.0","@material/typography":"15.0.0-canary.0e3dc8e38.0","@material/feature-targeting":"15.0.0-canary.0e3dc8e38.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0e3dc8e38.0_1660243644473_0.36913681816418364","host":"s3://npm-registry-packages"}},"15.0.0-canary.d5a11f1c8.0":{"name":"@material/tooltip","version":"15.0.0-canary.d5a11f1c8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d5a11f1c8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7fecacd1284f31b690f36e38aa329d4892832efa","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d5a11f1c8.0.tgz","fileCount":36,"integrity":"sha512-ZWpim+Vqk62ewLQ+cbF7vIKtXh2WWcueyNzhCxcb+QmlKhr1LZszLrGAvObbnYpJJyUxwXrq6H8Q2+DPJE7/Cg==","signatures":[{"sig":"MEUCIQCgAo6pkfZGCxSmWcHrVg46po70NuBQ8EWxYhaF/gtT+AIgT90v6IXENZ/ffHPXox2bKZSyyrjmJm3FbRLxCXCrNas=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDpcWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpkDhAAijLd8koMQdYEk1EIzT2ThFEOXRuWRHeDNWGE/Wksp8UyUn6l\r\nmFOw9oxutR9M897OoKDbYctdDA2RlLMpNE+K86876WT6+6VqatBNopFSBCwn\r\nFrEvgIl2kcKcpjYNk8Soh9PNyGulTkFZ96IHya9X4YLIgAi/+w2hHCr5z/OT\r\nRhKlpz1VcKx+qKSesyYBG6qr0NGMcPbyyKd4i/P1gjpjlGbAmvnqa71Dkyko\r\nG/vnuMgyEI9Eikq9LqHu8evQkJFnFrpAhy6Irqdx51785I/zaregnjFavyGQ\r\n7ArhAEE87U9luL1Ky0iifoammTUMEENumKdTThtCiZsZLaS29z1nSaV18iwQ\r\npCXR9qMLAAXXlvn1gMcBCH2FWZ9/+OHowiliQmhaEdvWA87GdXewwTEMkGi/\r\nTV/PhfISdEgV2ijaoozJKzicmYrq6imzcLUTE1DXawStfVmpoQA7C65rtmCk\r\nQiXmQ8IZctqZFrW57GsaOjYmtSBEBf3P8Mo0fDsq33LGN69Uf4/IKRdDKAsu\r\nhBqeNIyTysVHdlfPsdqBAsz5XcFKitOakhEy5jBs7RKTc2D841dkaIA5r03o\r\ncLXTHiNrVdyJ2PSGtBnUilH/LQLO0neJ6APgyeTpDrAsJo8TDRgUAP31Dqbt\r\n3VKLTEC+QsIgYCnA6MhEJDGeBuZC9mrMHaE=\r\n=89dQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7ac71b54192751de3a5469d20cb2e1c30e544d30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d5a11f1c8.0","@material/rtl":"15.0.0-canary.d5a11f1c8.0","@material/base":"15.0.0-canary.d5a11f1c8.0","@material/shape":"15.0.0-canary.d5a11f1c8.0","@material/theme":"15.0.0-canary.d5a11f1c8.0","@material/button":"15.0.0-canary.d5a11f1c8.0","@material/tokens":"15.0.0-canary.d5a11f1c8.0","@material/animation":"15.0.0-canary.d5a11f1c8.0","@material/elevation":"15.0.0-canary.d5a11f1c8.0","@material/typography":"15.0.0-canary.d5a11f1c8.0","@material/feature-targeting":"15.0.0-canary.d5a11f1c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d5a11f1c8.0_1661900566537_0.5080174126724939","host":"s3://npm-registry-packages"}},"15.0.0-canary.bac992a95.0":{"name":"@material/tooltip","version":"15.0.0-canary.bac992a95.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.bac992a95.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f6dbc1fea192902cd12056ddf05fe9db729afd08","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.bac992a95.0.tgz","fileCount":36,"integrity":"sha512-HUz1cVZCEVASRiIwUDsJjZO8BgCunXRo9V6yGXUuWu97l2dtukuPnRqsMtlVAcqzW/E/EIGDneF2u419lRW5ng==","signatures":[{"sig":"MEUCICu1yHcOaJGzCvhx6CtQtowzmcpaRq+wImnEKrMAz9yfAiEAxPEelRBlWo8FXRDQtkFEdeFL1R6CSzpRKYSGEfZ5A/Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEFonACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQ/hAAlcnhl+8RThMb5c3/LBjROSp2ysI8yIdEjqtQmb0GLma6QRNU\r\nofrkYRDdw9MZ7Tpiinu6jTGQfvL4BSmQ+PU3dURDhsXhbRStZoziw4Mw+k4V\r\nHba2EXbnpaxllFyH17OWLTrkGMu+A7X0dBBCjP4LLzesxWKy2NzwJWmIyPKD\r\ngA+dTPKYLn8YeRgfLd9I/irm8FU7mfvJAwzE23Coo+RfqIQnt4nkUS/tIHgG\r\nx54yB1NGFirt7Eq5rrUOTCnOUIZ2ScJX59yJnz38m/XLBVVW5EafQj7gScFe\r\nvF3zsyv2LRTScEpKCMJNkkFPdELZXo4BJgynmjUdF5jvpaxPtZYnLInZGOZW\r\niDEjsFwlo1CyHbFZC/4qKWdQ9TKoDufPOfqGimi8ZGeHsd/Kn6rU0Orz/V+F\r\nVsL4WgsTwjY4TDEdWqkMOl9pgqF+10UJML2Lfh+kkyZ/6Veegpn9FEETWlB3\r\naiRT2oQsytc4bOh48l5Jio7ASMut5hLBp3Y8ywL1wuAmG27Ayr+UFsa9+Ir9\r\nL7+MwTeSHU/piE03NWSVw6m4xNzKM5oup1aRwPLcanrltZe5G+rAB+7Wpm28\r\n7EaZvvSPRAYZirCwjSNVgbF7b4dHvHIu0RYKD3T5MnzoP61nIYHHYiCocIvY\r\nVG2vIb9gZUFNwz7QzSHDGSXw1wSgBhYL7AE=\r\n=+QSk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b8dc8f019b6b9a7241d55c21925faac495f9230b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.bac992a95.0","@material/rtl":"15.0.0-canary.bac992a95.0","@material/base":"15.0.0-canary.bac992a95.0","@material/shape":"15.0.0-canary.bac992a95.0","@material/theme":"15.0.0-canary.bac992a95.0","@material/button":"15.0.0-canary.bac992a95.0","@material/tokens":"15.0.0-canary.bac992a95.0","@material/animation":"15.0.0-canary.bac992a95.0","@material/elevation":"15.0.0-canary.bac992a95.0","@material/typography":"15.0.0-canary.bac992a95.0","@material/feature-targeting":"15.0.0-canary.bac992a95.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.bac992a95.0_1662016039440_0.030349670089245162","host":"s3://npm-registry-packages"}},"15.0.0-canary.920d8a79e.0":{"name":"@material/tooltip","version":"15.0.0-canary.920d8a79e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.920d8a79e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c68e4f13edc98e4959573eda7c59e13ec58f9743","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.920d8a79e.0.tgz","fileCount":36,"integrity":"sha512-E8Dz9w6mZoy2E+omgE33dIdCBq8iSLqbU9e2rQITL49ZDDc5BkS7Iw98Y1zlNpXcUOKW7mwxnm1SWYudmQGVcg==","signatures":[{"sig":"MEYCIQCaZ+9Kn8dY9yMvwN01m+hPU83D56HC6Y6/UuQMQ1lCyAIhAPGNWikKlNUWaQ6zWr1yszCdPOjbljT9qSkkT8m03cZ5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjERSEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEZw/8CNvDAM7L9QXuarPCkz4heKZ0iXuOmDJIP3kZer4zwhePglie\r\n/cQWqebizsvF94GKmhJ6xahlH02PGT40gTpW0AOgHO8LuFIPROqNY7e4f/B3\r\nsgkYpJK/vAp4xlfvqh6w5wz/gyfN5gTe9zKecc9KdU8oDZdQ2WgLG1quIBLD\r\nAtXryU9feVUHT3nf+4OQyeJyiZjjhVT13a44v+eyncc8JAU4I4Zk9tj7CCrf\r\n3XH99quukflDKtablJIlHi922qGp85Kzypy2EEo8fJS96rEJImg+g5aLeCwP\r\nPGiFe2t8Ts8RbUbzYWaC5xN4oz84qVdUi696C7c8h1hUSX4Xde9dARIG6nL3\r\n/J6OEAXheFgLvpha//gJ6KBbslVZz1H34ktL8JOAQtLVRDnI3dIiGz6KwjqS\r\nr34/Dghs7Xo4Kb9J8p++s231C4q22o0Qj07xSVRdPe0gXjDiXvpLATuXTg54\r\n30A5k7NNLNreav1p/uKgT1m565htr2N+FIs1TAlFs0iyNF783tkAMdDjsEyo\r\nFPtHfJg9nqs3zBDsoCOdRAk0w6LKQrSSnIqAw2oz97a4/t2dGaH0YeHYgX0H\r\nAgjCLW8zCNO74gDgfJHQUQlgkY8h63mrfPWw25F6mkTML6MWmBFPaiq7euaM\r\nqWm/fMWWaupDAyHTfM+f6Il2xFLmKYxoP8E=\r\n=b9Cg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"781a4c78770587fd97c25633bf9f137081c35bc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.920d8a79e.0","@material/rtl":"15.0.0-canary.920d8a79e.0","@material/base":"15.0.0-canary.920d8a79e.0","@material/shape":"15.0.0-canary.920d8a79e.0","@material/theme":"15.0.0-canary.920d8a79e.0","@material/button":"15.0.0-canary.920d8a79e.0","@material/tokens":"15.0.0-canary.920d8a79e.0","@material/animation":"15.0.0-canary.920d8a79e.0","@material/elevation":"15.0.0-canary.920d8a79e.0","@material/typography":"15.0.0-canary.920d8a79e.0","@material/feature-targeting":"15.0.0-canary.920d8a79e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.920d8a79e.0_1662063747860_0.4408546594365612","host":"s3://npm-registry-packages"}},"15.0.0-canary.c363f267b.0":{"name":"@material/tooltip","version":"15.0.0-canary.c363f267b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c363f267b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1b2278e0623969da7a51dee2e818ef19d28263cd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c363f267b.0.tgz","fileCount":36,"integrity":"sha512-Psp5ujXhcGMSRBmoBXJydSn2SnhfUaN7w4GOTzipkGkN503hJdCWYjma84555X9YMNOedi5GZRnNd3mgUK385Q==","signatures":[{"sig":"MEYCIQChJPa0eIY5qwq7H1DREJubJl8BnsLcmcd0Smh2K79v3AIhAL+9WkdDa+xGG9Cwx+GCqYP2CBHfawBhcECucCVpTsfr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjESHzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmob8xAAma1VSPqIQhyYsVMKLFwS8OWVP9+lPhdQ9Jp59UrpeWWNM2La\r\npEhk17UhpiJCNwH877WprEsNC1X2kISSJBUk8tvNqAPzr0LWy5UOV1Mi894h\r\nkhUN05uKorIdSTFZhj13wdTuUOaxGSqksRwH+GXm7SMTk8t+VWDGmRdmZZxp\r\nPooHt7pFoL+8hQ84eei/XU+e4fplDMuv3eDZuO3jlyKf9i2moIyCtlxQWBmx\r\n0E2QlXBCWNzWIohfllQ19VEZOqMHAWgVoarGHewBtpUDUMGMFYet7MPSRC8q\r\nQzUQ23+mthlUzWD0Y1HFsbGwGTf9ZxJC+qDmLY1FwIGgO5JsTn85zcn8YhCx\r\n1d+mfHFv5P2ESC2HEmarzHEK6q0rKPrWPAIeuTguRH+Ul8b2dj6Mt9jTZhHi\r\nMf5G1dQO4JSd1pteg+Ylor0ofIOKZhUjtXk4NRQ+CfT28hwlSkzXtwDmJsPN\r\nHXBgOaoreVl7SrQWAT8Tm/egrKW8Y8cvMMVgQyfy+fJoneQqsb4Dq4nTPxKu\r\nQH2Md325avL9ivXDxrUv2dDU8jT9nA8zzpJ/aU5TxVanknnh5ZKVAKQklYlh\r\nAOMhCrLYdh0e+rNClgNqZ+U1L7BKdb2eCRaVKR8Tk/HPbXxybho/nelZ5ENS\r\nZ8Nq84xks9Ad8gcJGiwAvl5M4duLIBuBxC0=\r\n=Peau\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6e2ef624f85a84b5510b55933f017db57797f611","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c363f267b.0","@material/rtl":"15.0.0-canary.c363f267b.0","@material/base":"15.0.0-canary.c363f267b.0","@material/shape":"15.0.0-canary.c363f267b.0","@material/theme":"15.0.0-canary.c363f267b.0","@material/button":"15.0.0-canary.c363f267b.0","@material/tokens":"15.0.0-canary.c363f267b.0","@material/animation":"15.0.0-canary.c363f267b.0","@material/elevation":"15.0.0-canary.c363f267b.0","@material/typography":"15.0.0-canary.c363f267b.0","@material/feature-targeting":"15.0.0-canary.c363f267b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c363f267b.0_1662067187063_0.9776204542892821","host":"s3://npm-registry-packages"}},"15.0.0-canary.a4eb4937a.0":{"name":"@material/tooltip","version":"15.0.0-canary.a4eb4937a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a4eb4937a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"460888bb45a5cc1904fe966e8a9808921ff6e732","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a4eb4937a.0.tgz","fileCount":36,"integrity":"sha512-HukZdm/UREvGWFlS84Uhobs8JAVP8ls86dNIwS5tjagHi438hEdJR8iImQCSpP/Rmtu6C/1OqXfs98UxeFyYUQ==","signatures":[{"sig":"MEUCIQD1HBb1CxmO+vCl/BXrhIc48XHjkq7QzK4XM7rYHOywPwIgZpEqA1VNCkkg/hQk2rhKK99M2v4X4EmrP24YQlK+sNA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjF4+jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpudA//SqNHdtKmE2q2y9jRxb6M/8H6Q3lJlZKAkWLE+4ukfwvAjedA\r\nLThdZq1tjQ7AMy3puxzckE8laaB7KI0rNUUMXQrDp0YY1JwX0HzXCUCBSxWB\r\n4+m1OoPaxzDa4kXeYAN4Tdj+qoUhtM6g/EMls/m8jfj31bjnKHmMxL482bYH\r\neTlfg/caLto0Vn5AZvfhbM51+XRQm/Lv6vdnajO4dyUTJ8m45YJlxl148ygZ\r\ncYNm9NW9VSzsBRX/3bnWUZ422cYnOm6SqvDcsOEbOPwIQ8OVXrQb/CPI/aUZ\r\ny/Pr2eviweWGJraTUP5CENdi1FflOelW05B9OwNe55r3hBz9Bsg9EdC1CNcF\r\n4E/JIMJp4sJMm4ehv9QxGn99P1mPvvXoJhPfjuKE8DoiKIyRrqeJ/KDpMErw\r\njG+7v3D5m9/RJrQBs3gA79ZRVuQQG2HkY/s1PynvZZ/FYEbcAY6ZJBsorhpS\r\nuOxyO43ZQZ9t2pWbiNt/6duytAZO0Iuqy8IcBqC+PJCtwGw59FSnKdGT+FqD\r\n/7c0ySS0hs8MpFYRC88YIRfsGDYFbOiADcqjvhxNJf/Hs6Axcvr0KxUtEyYo\r\ndi+JqGhN/jWKzoBv//rEDlDJZvLS2JpAAAP1QCO/k7A5UEi8NShxnM0oPNG9\r\n+oYlSKjtRBCFK1SLAEbNuCESSMf4eDdP/ss=\r\n=ApUT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cc03915314119934676831cd7a244f70e12dd2c6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a4eb4937a.0","@material/rtl":"15.0.0-canary.a4eb4937a.0","@material/base":"15.0.0-canary.a4eb4937a.0","@material/shape":"15.0.0-canary.a4eb4937a.0","@material/theme":"15.0.0-canary.a4eb4937a.0","@material/button":"15.0.0-canary.a4eb4937a.0","@material/tokens":"15.0.0-canary.a4eb4937a.0","@material/animation":"15.0.0-canary.a4eb4937a.0","@material/elevation":"15.0.0-canary.a4eb4937a.0","@material/typography":"15.0.0-canary.a4eb4937a.0","@material/feature-targeting":"15.0.0-canary.a4eb4937a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a4eb4937a.0_1662488482824_0.4106544846566422","host":"s3://npm-registry-packages"}},"15.0.0-canary.4299717da.0":{"name":"@material/tooltip","version":"15.0.0-canary.4299717da.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4299717da.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5345411149c5a5d61fc05bf2736811722812216","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4299717da.0.tgz","fileCount":36,"integrity":"sha512-dwMa4wiJ4T9+51uJIyyAzQRFIjikOJjRsbIplviCo5CKZbDs5fYvkPkHR7ccZWRLRZVHIWw3UoGgAL8QJYtiLg==","signatures":[{"sig":"MEUCIHS0abGXmG+kTDe9KF48P++DzWRbpZ7AOTSUafbBiYK5AiEAtUrxnES8W46oKeC1VmYEoqQGQuZH75lkY/UrxD2KMrM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGMQOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKog/8DrZRgGa7K4FYinxX5r6B111E3U2TeDUTzWG04TzkXRjEwyho\r\nr+sDWR9aPGok+GopeC4/Ea7ALVSak0JuI7I0Mwo+GDQ7ca/HWJ3XR1HTATFY\r\nw9dEN/mWpEikFA73Oihp8LxXR58S2xqTH2F6fuzEJArgoJGLzNCOspRspMno\r\nQXV8jlxCcdjW3Dtv6i9dTPPfADfHzF9m9z9uBjBICk0GJX1zEHTLVdLjTILv\r\n+TqBJlQNEezf3N4MXlbMyyhUnI1tbG1UNqurHd9h8cDtbOFLTLyJSIg7Gyib\r\nSzDObTzXQyMQgEgxUFbKPNzZq+sbHEIhMR6YUvIa7xOswpccBGwgR4Rdu+Qh\r\njy50Y7xucF2LLgQ7R4Mnv3pClRcECHLlJIYxtDa41338IPAIcfD+d/Jb0wPf\r\nIon2OR0xbU2yDUpM0C2XERe1kajXyEOqYH147vZpMizCVDLzU8iyAPvrjTse\r\nMP55yiGb1fr4/fEizcmiqNXSMXNT5t9nsTJMx+Bqp6gf+B4tHTlCuW06PeAp\r\nITRrh6QCKMJgEXX1ZZ6Uri2/rvSRMNMjG6EgWwd+YasiCipJNW9ccMN87N/G\r\nPtkN0f8DuVrPYt7Je16qDaCPz9mSNJSaYWNkwOHX0iPFaM4J23iDCC7N1BYo\r\nCysWJC+RW1lckViDQ9dwjoQuZv6eoOTItRU=\r\n=gJGW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"22082634ffad1ea812192e5ac62786a8ef47aa81","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.4299717da.0","@material/rtl":"15.0.0-canary.4299717da.0","@material/base":"15.0.0-canary.4299717da.0","@material/shape":"15.0.0-canary.4299717da.0","@material/theme":"15.0.0-canary.4299717da.0","@material/button":"15.0.0-canary.4299717da.0","@material/tokens":"15.0.0-canary.4299717da.0","@material/animation":"15.0.0-canary.4299717da.0","@material/elevation":"15.0.0-canary.4299717da.0","@material/typography":"15.0.0-canary.4299717da.0","@material/feature-targeting":"15.0.0-canary.4299717da.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4299717da.0_1662567438427_0.548250814586867","host":"s3://npm-registry-packages"}},"15.0.0-canary.fa7d8d44b.0":{"name":"@material/tooltip","version":"15.0.0-canary.fa7d8d44b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.fa7d8d44b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b4bf8a3d23f9808bbe8fe3d0577b39886f69041e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.fa7d8d44b.0.tgz","fileCount":36,"integrity":"sha512-Dngj6mBOlLWHs/dTOV2y8sPPH+cD5klWt5rD9Ro3rugrAvk7VqbJslxvkSBTjxMD+u9Ysf75t2pRgTfcqLDLHA==","signatures":[{"sig":"MEUCIQDVVa/YKhB4n972eAUcA2Ps1o4k0XjOuhunu1fPAB4FPwIgOFTbfuxsAC+/tKwxrpVvfH59HAHJldYn2R2olGJVUEc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGO8BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAXhAAiQy64KsbmSCi0t9+UK6+JMDjvsjxtNGVFfGEf3nS8eWxN1wa\r\n6/uv3W7jcw+DkslNqS9igqg2Y4WxaVHnSzNpwWAYQE0ViHAl+4jgEw7RJAXW\r\nTCsRB0Iv3UkzFyeoUQNGe+iwu4rC7OuAJPd4dzmMfJUu40e+isqznI6TH+Fw\r\nU9p3/iJ2MF8ljF5hC80DIjRa4qC4OLQt+Mut4KukV8tZQPkc43t7Sv8ivDpg\r\nexNHnAgCef6M5vGC84mIeJxlBD/ydZbWLyQ2agZafYTVbZchBTy6A4PVvz4W\r\nlIOhsWMuo/n/LshlHcg8FmiOyTPhtqZ1xnqYko9fNVrJycn+T1CBOfME/Jys\r\nzMzbCIjQXh5gem3mS+eFHQns4im7FMiLhLsttSGwGPlsL9RfQA1+4dRJv+Im\r\nzdtirE1Y483UgjSomefx0e5alN8frYAWShC0FdcZTinuGwCnDpCe+7SWW6ri\r\n5jb0fjV0/A/hXwXVgPoGqiWXTC+6fiMvqD489KOe/uyhg2gLUOVPunIT4R55\r\nyk1cfC4QTHZChWkxZTt141rjyeYUxv295u+T026wDPT5/RkU+gBCE3zpBM8S\r\nz5N0HTKghKetPt44Ij879Iuy/Hycx2xJQ9mW2JLj3HMXG1oHX7cfvjU1pwkR\r\nTEGWKi+LZmJv7YM47LojOkKYN2Z+l6qvgPk=\r\n=DD+0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6fc828292e73ec2f8aa4332891628e90f4586658","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.fa7d8d44b.0","@material/rtl":"15.0.0-canary.fa7d8d44b.0","@material/base":"15.0.0-canary.fa7d8d44b.0","@material/shape":"15.0.0-canary.fa7d8d44b.0","@material/theme":"15.0.0-canary.fa7d8d44b.0","@material/button":"15.0.0-canary.fa7d8d44b.0","@material/tokens":"15.0.0-canary.fa7d8d44b.0","@material/animation":"15.0.0-canary.fa7d8d44b.0","@material/elevation":"15.0.0-canary.fa7d8d44b.0","@material/typography":"15.0.0-canary.fa7d8d44b.0","@material/feature-targeting":"15.0.0-canary.fa7d8d44b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.fa7d8d44b.0_1662578433474_0.9766188104918778","host":"s3://npm-registry-packages"}},"15.0.0-canary.a40e3c768.0":{"name":"@material/tooltip","version":"15.0.0-canary.a40e3c768.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a40e3c768.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"553ec94b91fa233f13d23d1b26bc4e58a94f8d2c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a40e3c768.0.tgz","fileCount":36,"integrity":"sha512-R/a+vQSQwHITlguEfZQzhahiY+KBAGXLg1ZCGCg53daJixFKwi8xzVQGh7KN+iUhENdJMve2sduTg5w9lBhJ1g==","signatures":[{"sig":"MEYCIQCE+THsX2iQu4eV6uHukqD2CqHoRV6a0deG3MCUNDYX1AIhAMyktWFCeydJljZ7Ylx2vQBJ9QOmBHgctfmC2ji6OeHf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":840243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjG5yDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBpg/8CTqAoG7ahQJinlX1SeuiCDxR9PGAhmmeQ1AcY/+ZECGeAtyE\r\nDh9OyW+K5i2OYvU89TExUNLTvTrscZRFe41/1ya+MEr9+q+2iQNkR7A9vAYa\r\nHam0Irk7t0VkRf0bjUjywxCLmiqGAAJTNUACvLHvH7LGEO+3Er7m8U7KFInn\r\nL83p3X52bvIm9p4K4Aikdh3osiyFJvmebV9/kYdDGW5GHZikG2jb5p7kU0y9\r\nQ8O+gfotJ+ilEvk5oBA4IGFf0B1Bhvz4Acngk7w0MuN1lGUTwVcIL+Eh5KpC\r\nZ5LBmH222zxkJkuR5VpqzJMw4HG3VsEmh5sB4d5XddkB8dyZ/bTLndpx56h0\r\n6h4ES+5urjkI3X3Qaw9zKguLsTFhgtVQom0eXPIJAClMVdpcFHAs9PI3/qzl\r\nsWItUMePI+VH7fqlhmee9f8TGA6XYkFpubE0pLDvfOFeUBVjrs5HoVvT20nO\r\nCuMZp9WygScv+wC/J2bIcwgNj8NCA4CYMSI1rhyOfguttZK4bqSgBh3Do4Li\r\niJLZpjRiHnCpSCaLhmDh/fmGZJaFoDrrp1RMp+LP8scU0CZqqb8Nx/irq688\r\nVZXCGZk3PuR2knJM+c3qmZuEFkkKOuvl/aF9Y3hwvz624Yz6hT+I5lzEeAZO\r\nl791JXqXBUDOY3yrOlGdVPG2FGjxnnuyVjQ=\r\n=pKCw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"33ff1e71e12298ba7158884edffecc83f0055913","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a40e3c768.0","@material/rtl":"15.0.0-canary.a40e3c768.0","@material/base":"15.0.0-canary.a40e3c768.0","@material/shape":"15.0.0-canary.a40e3c768.0","@material/theme":"15.0.0-canary.a40e3c768.0","@material/button":"15.0.0-canary.a40e3c768.0","@material/tokens":"15.0.0-canary.a40e3c768.0","@material/animation":"15.0.0-canary.a40e3c768.0","@material/elevation":"15.0.0-canary.a40e3c768.0","@material/typography":"15.0.0-canary.a40e3c768.0","@material/feature-targeting":"15.0.0-canary.a40e3c768.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a40e3c768.0_1662753922925_0.899941398985135","host":"s3://npm-registry-packages"}},"15.0.0-canary.7ab3cd3c8.0":{"name":"@material/tooltip","version":"15.0.0-canary.7ab3cd3c8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7ab3cd3c8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b41f414d41d3ac969db54ba642f7822f7b5d441","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7ab3cd3c8.0.tgz","fileCount":36,"integrity":"sha512-Gn8F5ha6dY5rDiEsVPl/3aIeouGNF/yJHGCGe6LaSLy1/chIOMuyRL9AgmvGUuGt5LnoQl1cvq4b6RP+80cyeA==","signatures":[{"sig":"MEYCIQC/QIVsJAoOSOlZQJFOiIZNw3GNwlsbXUEsVxKQj50UNwIhAKsbuLWSPPlm/nFsQprvu6SpIfPzgZRZu0MKdWt8thru","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIQboACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd5A//WlFa8uXhM4T+gE3Rp15HzyqiCEFiqvB+uga3pXhB/rQwgvwP\r\nYxXkxahawd8Qet/XCwDnEJkcYKI4taqajwATOWlVx71Ts3pOe0EzhClVM7bU\r\nDsw2QRfNn5kuKW/aA7uKYdbDbxi2ZA5JrABTh79YYxwUDtgqEilnWmU3McTM\r\nz81d+Rm4gZ2hC72EfAeDag5IEunNkQq5GpRUBLxqDKS4fFoMwIjWWyoYnb+3\r\nHgSVU5ycYYP4Lz0Ot3aKg6BhrJqRqBkFDhWbDbMWVcnytkTMWsIlQSaFQmzi\r\n+ZFJaWX6MKflOPa4b2aPoWzkawd1wljv9ejnJzCVqESru+tWmKS2x0yXv3yZ\r\nxe6nUcZ4UJFHjAHReECTFnypGSXasBTSVplQxRcnfn18pdCWgxniDFEX21Qg\r\nOBF1+pEVxc+96IXBMmnrvCAwkvkSMgmxYR2hrKxWZsKWYDW9SYfUNcB+0Qyw\r\nzmXykf5gKDVsacZx11dlO7m8wghbKh4czRnsn9OzZLWAE06dIJYLUytNVJt6\r\nUTeXvEJJT7J0Q5ShM8C3txz/YEqXFERF2rV83cPcZzQ0Eqi0Ux13K52ePtgs\r\na4l2KawYVcmIEcUjJk0HV3/vSmuW8UtpLNLqNo+MzAGzCWvcKmYBd/5x0lIO\r\nyesBdWykJKNLAYk5C7yHv7oGGV9O78QcFz4=\r\n=h8jS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5e840f2c9b221706de7ff81194e71da2b68b82f5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7ab3cd3c8.0","@material/rtl":"15.0.0-canary.7ab3cd3c8.0","@material/base":"15.0.0-canary.7ab3cd3c8.0","@material/shape":"15.0.0-canary.7ab3cd3c8.0","@material/theme":"15.0.0-canary.7ab3cd3c8.0","@material/button":"15.0.0-canary.7ab3cd3c8.0","@material/tokens":"15.0.0-canary.7ab3cd3c8.0","@material/animation":"15.0.0-canary.7ab3cd3c8.0","@material/elevation":"15.0.0-canary.7ab3cd3c8.0","@material/typography":"15.0.0-canary.7ab3cd3c8.0","@material/feature-targeting":"15.0.0-canary.7ab3cd3c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7ab3cd3c8.0_1663108840304_0.3936642026125794","host":"s3://npm-registry-packages"}},"15.0.0-canary.2860d244d.0":{"name":"@material/tooltip","version":"15.0.0-canary.2860d244d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2860d244d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"da58e482fa91990f64c08231e9c6c99e06b44f0d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2860d244d.0.tgz","fileCount":36,"integrity":"sha512-Zectsh3A6Gj7LtiXAjZKg14wUH5Kof3//fTvDTwA3OYDCJf7rtBD48uPFEzKqFmbQMxD5OKFHIV1b3xPpEqE/w==","signatures":[{"sig":"MEUCIHumRqhUJaCHq5UZtrh9HcsNBdiVnqL2zBy7GUxnwBr/AiEAkZzKl1pLp0Ok+GDok8+vz/PTX+pEKwhThlWsJH9ZxQA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJP8TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqqPA//QcUKTtZpY82HQz/FESq2bw+jiu0IaR324C+jvNsadlTm6ZmY\r\nTha9Htu1nQD6saAYdKp9wgOxgSl/BK8lWwaLxWCkC0krZG+dPyitRfUudzn5\r\nZjiDinYoj7yXbRfkTi83mCSmOr2V5/m70x7iEkAC+PBTUIIcOdszLxOisQGB\r\nAiWcWDzxGETkJ38Wcmg/rlpLRoOx3mPBiFN1+L5rQVUJvGDhYfpxCq1LGQiV\r\nwQavLmlF9/wbK3uO94ibMJFr2/cHTCswFwGgF+Rohmzn83lrs3b1QYCjFXyD\r\nXEfEaA+TichovYJ3h1Ky0uxUvv9Jrabilaz5dHOfMgUD1RU3zwdBdXHBqFHc\r\nFG0UHC5wcvVbh7dGApulz73zLLJ+lCGtlx8ALAvywBmqRMXgss/gpsnAAoMn\r\nknuppEudnnaGEasPRXWZXnlbEixQSG+yOYmxBhoyYR/ecNMFKTUTtHzXz3yM\r\niF3rrFFzsCfd+Fmqx/Wju42h1sJ5bIvcyVYpaKJsSuRXGZj2914zTwiX2pdB\r\nMnINYXQdslkYeqYOSwZONTuULs8eudHDt7R5gKWnhNnqg5KpAUwdF4imi7TS\r\nqyu8EVlbtMyhBav7mWE1COOhLFvl2/gyPtY13Lci6qN4q+i98jZV+y/QuMLI\r\n5zo0PYcPVt+Tk2UtdglI8F1gh5dEMhptSkY=\r\n=hdVi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"992b4ddc7340e4e4231d1001d68229e8911eeba5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.2860d244d.0","@material/rtl":"15.0.0-canary.2860d244d.0","@material/base":"15.0.0-canary.2860d244d.0","@material/shape":"15.0.0-canary.2860d244d.0","@material/theme":"15.0.0-canary.2860d244d.0","@material/button":"15.0.0-canary.2860d244d.0","@material/tokens":"15.0.0-canary.2860d244d.0","@material/animation":"15.0.0-canary.2860d244d.0","@material/elevation":"15.0.0-canary.2860d244d.0","@material/typography":"15.0.0-canary.2860d244d.0","@material/feature-targeting":"15.0.0-canary.2860d244d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2860d244d.0_1663368979065_0.03749542437871067","host":"s3://npm-registry-packages"}},"15.0.0-canary.e8726533c.0":{"name":"@material/tooltip","version":"15.0.0-canary.e8726533c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e8726533c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"87c528bd2de18780135b1fdb8a4e297fd3182f4e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e8726533c.0.tgz","fileCount":36,"integrity":"sha512-CwwS1nSYoPTvlvsyawqxEGGDV/IpE2dEGLHeTa8TRL8cbsXVYWOJgc32sZHvkskm2O/61aZbSmZ2cIzj4HH+Bw==","signatures":[{"sig":"MEUCIQCWCZP4R70YJOVtPWehYeKdW8JGZ4wr/X5xuppQD77bcwIgavxMkJm6FNQn8/39GS1u63SAhQeyqjF1o/ArQKv70HM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKiA+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnUA//cBEHVLYv4Hz3w2o6Pbs3vRhi/qXEioxHFetSMOMUSAX5hS3X\r\nYaZ9eEvSJQvOYdJik0NAJTR+z4WAuN2tFUhS/Nbk6B7tFxAjxZ6g3P5F7ixH\r\nU5M/9+gnMDlDkrzL2ZlMwH3bZYYdEmmkUkpjALlp+jVIAD2vFfVaNS+Op3i/\r\nlEV+wD0V0NRzoboM5pYWLoyigwBiYVfKjVdJeqoH62cszdNKScVfGz/AkebC\r\nhwM+Lo/uPWkFGLqx6ff2BXhvO7Tvc28b2YernkbgbKKnKh9CzIatLqzaGfJO\r\nDNx8/gJlE2WdLOaRvJH7WowPwcmYJTbdZGLzYFiJaa6w4O/LI7k6C3mAUUca\r\nWSaV58GvRuYFO2Gf5670CZYIUpcFstMk3bHg5kVlKsPx1v3HGYao+fERjCtX\r\nL8YWhUZfB49mBf731zVg8emPL6cdG5epeLIcxZusy/bF8LM4ZnJ0H8RFi2JD\r\njS95QKndqlTgH8uQavND6apjY1rGQtC3CTGzlfZsdq4YRVrktYl+99fUoR/p\r\nHbRQPiHvfc5CSzWi7m22R696g/Fe4tUQJPlkkgTl1ac/hRXhKw1ozr1//mdP\r\n2+Znkc9qFnm56p97og51KU9FW53Nemd6pCH8ZdEqS2edZW6/mAtws+epaS6E\r\nWZSJy+3/eLWDzsGB4Hs6mJIiV8QodWI7fA0=\r\n=TV2w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b85a9f4d1ad6e30de8175562c0093248848c2598","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.e8726533c.0","@material/rtl":"15.0.0-canary.e8726533c.0","@material/base":"15.0.0-canary.e8726533c.0","@material/shape":"15.0.0-canary.e8726533c.0","@material/theme":"15.0.0-canary.e8726533c.0","@material/button":"15.0.0-canary.e8726533c.0","@material/tokens":"15.0.0-canary.e8726533c.0","@material/animation":"15.0.0-canary.e8726533c.0","@material/elevation":"15.0.0-canary.e8726533c.0","@material/typography":"15.0.0-canary.e8726533c.0","@material/feature-targeting":"15.0.0-canary.e8726533c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e8726533c.0_1663705150005_0.36480130624562124","host":"s3://npm-registry-packages"}},"15.0.0-canary.00d8de0aa.0":{"name":"@material/tooltip","version":"15.0.0-canary.00d8de0aa.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.00d8de0aa.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4bec9bccb1a134f7cb7fef18613e6ffb3db2e1a7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.00d8de0aa.0.tgz","fileCount":36,"integrity":"sha512-9yrVlPRkF73wfB9odxIZehTExf19q+u5v55mlqqli0li4PEnhrW/9kCzIUvJI9q7hD/Do0lZM42UEC44lIiBvA==","signatures":[{"sig":"MEUCIQCKlgfqMQ4hXrxjh3I+2cn68YZxD+T8M/B6MmIgSXVcbQIgPM8/fqG1J9ZR8lDx1uarrOzqEN22qULiX8/dMm9wmOE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKywWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmriUw//afO7uy0auJM5ZiSKNpJ6V6fyTyhkPnAPTLaFez/QqfcGiX9K\r\nCuNxS5NXQQBoOENutAruEZzNAoFphjxuW27D+ZjKZUKNuJuEhSckiXI0DSqy\r\nILoxqr4sBNKGK3pYuoZv3L1aa5kY9NQZ16hRJL4lCwDwpzXN+HRJeUQ6rRGt\r\nop+Me6IWO4K+VCFRiosj/rZg9FTGS/fWvMLpkrNoUt1ekyx0mX2DeyWuSRqd\r\ndjFk7Y15vp8OZHwsAZ3NayKz3NCRz8wrJxz3y8AyVS3dbDqp5+vbePTWZGuC\r\nOMT554POLtE8rBaj1p36w41AgxynUKV3JxrVWSBfrOkOCQGfMBd7iwIodJGZ\r\n5BfsQvPIA6vvj00vRCbBEgVKr+leyegISaGPCf4bjbrVnV6PqAdDB8KXrTk/\r\n683c5/2ySABnyeveAIM+V9Q1V4pOd69NHP2Mx7ITOTDnDDbIrL46M3SouG0P\r\nGwRK+k/6l5d9aQ8PESzYyukuhLzu62AnUVuk9nSuylGx2HbGx2scGvrnRL64\r\nlslJQD6W2Q1OZUR6uWV6vzPlN67Udv8abG4FU6GP8qx+h9Z5osn4MuCEmo7b\r\naMJ6ibBqjXHXsYz2iZ6u7B1zz5PkDrjN0RyoPkckW3ITKcy6U9dU71VjMdsE\r\nfDo8hC+gB+3G3k6UfuyzUS3ZmutR/5JqGzs=\r\n=gnt/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0be0806991396e042fbbfb14ac3ad622770647cf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.00d8de0aa.0","@material/rtl":"15.0.0-canary.00d8de0aa.0","@material/base":"15.0.0-canary.00d8de0aa.0","@material/shape":"15.0.0-canary.00d8de0aa.0","@material/theme":"15.0.0-canary.00d8de0aa.0","@material/button":"15.0.0-canary.00d8de0aa.0","@material/tokens":"15.0.0-canary.00d8de0aa.0","@material/animation":"15.0.0-canary.00d8de0aa.0","@material/elevation":"15.0.0-canary.00d8de0aa.0","@material/typography":"15.0.0-canary.00d8de0aa.0","@material/feature-targeting":"15.0.0-canary.00d8de0aa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.00d8de0aa.0_1663773717587_0.5466400181260036","host":"s3://npm-registry-packages"}},"15.0.0-canary.271aedc30.0":{"name":"@material/tooltip","version":"15.0.0-canary.271aedc30.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.271aedc30.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"35acc3a62cc78410462546b09511f76b8eb580c9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.271aedc30.0.tgz","fileCount":36,"integrity":"sha512-PSklGtOtv56nYGXh0YfqMRSwA1O0lYuZkGIS2qZTtIeqdwDmtLnyuGURT7WekYmcHGUzsC5lpwHiDF+1u2Immw==","signatures":[{"sig":"MEUCIQDDhS1W4HMhMjRdMyKEO0qcChceSSS3FkQEQYJ3B1vADwIgZWe+NHKCm2rdyty6/NX6XkfSbgpGGH5HrPXejl3VUwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKy/JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr5rw/8C8QYRRZxzcRDsVuvH0fbK2/bSXIFLLXrsWDETT/gcPBEKNjE\r\n8Az4P1IuEcWvcsK3Gz/pCEnhc1/iXSjJ9hrva19Cp3u7M38cfjjRF6/wTXp8\r\nyXpMmbp8U7joKTL/GY9d3ztEgLMVcyu6AGKKgFYC/bL+tMUYViG6ZrGaPARG\r\nrw74zy8Z4VrKddi5P1zOeOMK7T5n21Ycs5G6MBzRzUk/DEyrpmq8yIYYO63N\r\nJSw4otxE4aUsLq4dUyFPqbJ/4SVOQ/MmKQTRuPSH6AgtVTXnDF5SQl1ofS2Q\r\nvWm+ScJtDqnZbFD4rEWdTmeSQkBLsFISmRdVXRnVA6aNpMDlXbrvxuzDTAer\r\n/A9jx/juUTGwNkGAhqBKKte3uvMvsy8IZ/i+Y0JHsxfz1g4LuKT+Ci48mAM/\r\nY1xVf9bMxRyaaHZ8rarUEykrwiQ6KaG2Y6+pJvC952P/yJJD+avSOv9MXLgN\r\nXH6oSmbFqMhnN7rhYRdaprQWGL/g1l1tUyTtGLEB/YJUzgXM8DNmx+3DDtDP\r\neAMfHfCqQzZgy2KNyUjCkecMcvJFeHMJkpeA4rHtyOeMRCSLYQwF+r7Q0I9r\r\na9jp9YQ8aHEeePziimA9IT598Vww3gVqnIEslc/4ptjkd9ZWDhGnu74n9zQf\r\nJtVN3gneojNHlE16+ZdW4m1qVME/LW7Nth4=\r\n=Jkbw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4972da221d6f097e904fd1a001de647e0e185749","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.271aedc30.0","@material/rtl":"15.0.0-canary.271aedc30.0","@material/base":"15.0.0-canary.271aedc30.0","@material/shape":"15.0.0-canary.271aedc30.0","@material/theme":"15.0.0-canary.271aedc30.0","@material/button":"15.0.0-canary.271aedc30.0","@material/tokens":"15.0.0-canary.271aedc30.0","@material/animation":"15.0.0-canary.271aedc30.0","@material/elevation":"15.0.0-canary.271aedc30.0","@material/typography":"15.0.0-canary.271aedc30.0","@material/feature-targeting":"15.0.0-canary.271aedc30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.271aedc30.0_1663774665234_0.9660881139807558","host":"s3://npm-registry-packages"}},"15.0.0-canary.d3344c16f.0":{"name":"@material/tooltip","version":"15.0.0-canary.d3344c16f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d3344c16f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eb91dd92b7212a2d34d1a07122175b07983ff0a2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d3344c16f.0.tgz","fileCount":36,"integrity":"sha512-FiOF1vlESOYn/BGj7sW/5/8iMdA1iHBOgPxMWs5ckzTKYt3piLycyPAAsQxOj7vLOquXKX6mkfbaU83a8eFIYQ==","signatures":[{"sig":"MEUCIAySi6c67XzSDjqvCt5ilKUQiIkMBbnMEqEqDBkVkq10AiEAhho6vdPfSyXcieaYo0uo5Aah8zK3gskQCMjFO36bsJ0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLCovACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwDxAAj5eicf7vFYksZDBPicEpw53Ndh1CeRWxRSP1zwgSKQLQ57LT\r\nRjGfK98iS2tWXjyODKHd4q83j3hGhYz/1tqEXtTmS02R6WA3/4TB45IZXV3X\r\n6QiS9Jj2NDxlqspOWckhH0JOKgdGJNUHK3NSfZAyQJvA7rfEeOmnhbOh2Fqa\r\nx7sJS0Iw5BT/mv78y4CwOVM3uXqZh33CkrP0xxGYZeasMhnoGOQX8aL4rLqy\r\n2mnAOiLlxeyVf9Qw6RO9Bjwo9Yscy/AeHZzoiimhWNP3IX29n130pWJ16/NW\r\nexJTmGUwjFZG5KC2X03jfUKYp4stbJXML3DZdPMRduKSFQThZEUmZ+OyQX29\r\nZSYA/zeNIo19+2LDSyN1jG+MSWhGGfPCNJ7fRJws50ZKPW/TEH/EAzXBhxFS\r\nCT9qctTodSx5Rfa3EvdA0AVv+UGRE2GIJpaKTTvXvjQ4ExhR2Z6103jwAF2h\r\ny1wDP+XT468zg8cNLgKHRFSFMmK8b70v/8zA/zqDQ1CB4H+/4F3JFMADKLLd\r\n//Ds9HCTAVnT99wjI+kppllAEfiXqi7v096ZWLm8y8IJPhnMoDUYjCLYh6aV\r\nLgFZxNPNlW1aADLCakpSJlFbUm730QjbSIQSB/fOUOMjr7lXanj29VfK2Xas\r\nfCcmB/s91BMVZhaeLJFYoua9PjXlOGIA+Us=\r\n=VVfE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e0a8dfcab6df46c9fcc9969a6dba1f4fe48e028c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.d3344c16f.0","@material/rtl":"15.0.0-canary.d3344c16f.0","@material/base":"15.0.0-canary.d3344c16f.0","@material/shape":"15.0.0-canary.d3344c16f.0","@material/theme":"15.0.0-canary.d3344c16f.0","@material/button":"15.0.0-canary.d3344c16f.0","@material/tokens":"15.0.0-canary.d3344c16f.0","@material/animation":"15.0.0-canary.d3344c16f.0","@material/elevation":"15.0.0-canary.d3344c16f.0","@material/typography":"15.0.0-canary.d3344c16f.0","@material/feature-targeting":"15.0.0-canary.d3344c16f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d3344c16f.0_1663838766874_0.2776556739007403","host":"s3://npm-registry-packages"}},"15.0.0-canary.94f20ccb8.0":{"name":"@material/tooltip","version":"15.0.0-canary.94f20ccb8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.94f20ccb8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f65654e993d973820322a21ec8f3a2d3d68cf3ad","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.94f20ccb8.0.tgz","fileCount":36,"integrity":"sha512-pWIzg1QazKZHzypfwsGv4y93hMwul25CWU0qYQNs69saqvKqk9S9N9+0y+pbG9a0SDj/3rgF0XnnLbZaMNh8KA==","signatures":[{"sig":"MEUCIQC5iH+HQYqkU1xRSxlfjddnTHWrISvZ0tcT9JgMthqAEAIgQDukMtOsJFqyC8uZv7IY1C49hFL5fIHoTNyocEkINYk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLMpQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0Jg//aJlxZcZFQZa63ML3H1ORWibyfpj0v8G4T7mWvRV7aNd0hpsz\r\nQafAqh2iLqkhHUuvf8xej9C0W3Nr/VQD1+6yOsB4cxwy34GJGGBOwMRxy45E\r\nHm32TB3YhqeIy7vGkc65hmrOrvrhh5TX3J/7BobZ5R4JDpNna/w0NGa81DHn\r\ni2G5OC8SleSNwUdyHABOt+Hbfcnsi425/7Hhk5mzXBhUpZYLFYiB2jFJjjFu\r\nTGwAREAdqYvkSCotHd+BLG/KCSFoqkbWKehJHvPzpMmvzjLhKCqQAFrSJoQi\r\ni9wy9nVB5/ZloCXzX9bay+/0ahzNFdlQ/tFNolUIyqE0OAicn1JXQy9EESVG\r\n/NkFIQXdp6/jGrSN46Yrq3d6J0x4oan8iZnCdHG0msX+M6yCNamdSzL+usgJ\r\n+g8Phq+7UUe38XqwPq30/8/2Kl9zclZVR1rEDrWbgF4I9Cc/ZlepaqF86tlE\r\n2OCeiDB67O4PhWZqzfeakA9/lUL7McXQ6v3ga4VywCl40sffSlzwq8bcSfEQ\r\n2gKsiyKXTDjUliWUhgJtHkjDWEUMQ8g9DxU4ZjkaP14xr8Z0QxmLFS3PR/tI\r\nFMtg7E8hSuNT98WYJhku6d/WAqPm1YbklZhll0cIbTXLeRakgTmLLBI8lVod\r\nPp1so7t4fg8NZWYhh2htWnZd6GbJ+Jbzu8w=\r\n=itgx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"16225f613437ecef2ed2d760a08046953ecd51ff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.94f20ccb8.0","@material/rtl":"15.0.0-canary.94f20ccb8.0","@material/base":"15.0.0-canary.94f20ccb8.0","@material/shape":"15.0.0-canary.94f20ccb8.0","@material/theme":"15.0.0-canary.94f20ccb8.0","@material/button":"15.0.0-canary.94f20ccb8.0","@material/tokens":"15.0.0-canary.94f20ccb8.0","@material/animation":"15.0.0-canary.94f20ccb8.0","@material/elevation":"15.0.0-canary.94f20ccb8.0","@material/typography":"15.0.0-canary.94f20ccb8.0","@material/feature-targeting":"15.0.0-canary.94f20ccb8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.94f20ccb8.0_1663879759886_0.1514395655722942","host":"s3://npm-registry-packages"}},"15.0.0-canary.81e4cb7b2.0":{"name":"@material/tooltip","version":"15.0.0-canary.81e4cb7b2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.81e4cb7b2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d035a730590846db4e01e5b288744cd75d4349f1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.81e4cb7b2.0.tgz","fileCount":36,"integrity":"sha512-3jR3tT+gfJ6NvGwIxRZGZ54MjGQJ593w2G5OyR/YRwYSVdLWotm8XVX5vVZjjlTJ5VFaEacAp/U8QY+ARF6HJQ==","signatures":[{"sig":"MEUCIQDvHHoJ7Xh2DABpQEJI0ibtH9KNLT8onTPwu69qTbkj3wIgUhnnhJ/aI4+qlJvIA0UidA1YfQjsPBy+Vpnc0UiBYKw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLcw/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrgzg//eT8+70skoLw5xfKXMt5PN2VVcZ2iOHR5jxzUXPU6JF0sayil\r\ny37qoXXWuhSEt52ihkGQYtPQx7HGIfbcSIG4fXdraqMipkn59pBcAmav/cb4\r\nBkn1o5RQ5aEbQe3J7rcc6T6ZN9L5j0ulYGXLWVVrMNMABxzHqg+ntahl7/ao\r\nPTtV+fQMi2gDVuoFF72QoZXVfP61Wch3RrrjejABkpyRxnCYiXHFAFTF9U3k\r\nn8/sra0por5jyfRKtoIwRFUHYlAt4MgoRgXdBAEDxqwzXQEHEFEudPmiU5or\r\nvEXwsA0HsEpQqcwN6yhU5Qgk+54X/5diXu2utUJtnVLj4aPuPl6K2vt+927K\r\nGbNIgTJl8KAz+UZ9AaVEvQ1uhodv0J9wJ1jLlIYkwG+lVIad9I3PF3SmKocg\r\nrq1auPPV8Xj9l9Biv9tUhWSqxjZuo424SgBHKnFiAkvbTiJC6ppql6/uAqkN\r\n0DyPRFnTWfUGIgQ4kGOw7mBirFMggVKgWHrUbCYKIC3WEOp5by/kTPwjG6/5\r\n5XLHHBOkhRQkMTEXGXxge1Hrrl9cjHA+dtgQK7HNTk8jpFOR3Tsypm09Nmwn\r\nedoPZW3qUePmMNcT24Wf40l4pp23p2bQ7hPv5QVNiMMJDXsC8wNAoc6MbWMt\r\n2sliWAlyuW7WnQE9Nrq6mcivRWtecSL9VUg=\r\n=6Vr1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"63fefc99b30106d8aae83dccf8e6e8073043a3fc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.81e4cb7b2.0","@material/rtl":"15.0.0-canary.81e4cb7b2.0","@material/base":"15.0.0-canary.81e4cb7b2.0","@material/shape":"15.0.0-canary.81e4cb7b2.0","@material/theme":"15.0.0-canary.81e4cb7b2.0","@material/button":"15.0.0-canary.81e4cb7b2.0","@material/tokens":"15.0.0-canary.81e4cb7b2.0","@material/animation":"15.0.0-canary.81e4cb7b2.0","@material/elevation":"15.0.0-canary.81e4cb7b2.0","@material/typography":"15.0.0-canary.81e4cb7b2.0","@material/feature-targeting":"15.0.0-canary.81e4cb7b2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.81e4cb7b2.0_1663945791561_0.7158995879746353","host":"s3://npm-registry-packages"}},"15.0.0-canary.aa85f9413.0":{"name":"@material/tooltip","version":"15.0.0-canary.aa85f9413.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.aa85f9413.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a94033aaa8249bea4d0c29d7f08e5513d8ecd08e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.aa85f9413.0.tgz","fileCount":36,"integrity":"sha512-DT3/9pIsrO00PT0x0wOGHMOPhfTn9j0YQz0Dccq6dhppjr9puf626Gr8xtkrFPGWlZFmc5E2oupOVe5S9QWVww==","signatures":[{"sig":"MEUCIQCIHmrjg8DCW+z1a1nv3LOr07T6tSeI9nZ2K48k2v5V+wIgF7y1BjZZP0c5q6gxoCsi18whM9K/nlEKqBJZjBsfd3E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMegmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoz6w/+IyRw+sCzmxwfr+PVNOYMGS1mVmt9h84CBT9b6qKrobbhrGor\r\na+x4f1UHZzwU+q3gC0i7F65qOACqrApf3U8r3bkXHMsNnenYvI/N0a40O0LP\r\nurNFZcbAude/Nv9WGR9eU0RnafELXke7G+jOQNUhsjurciDDwwitdDWzvJtj\r\n6TmlSWnTrDzhpOSVT0X8WvcowI/AwWU3qpeJcirIR9Xda7VKyPOZOueEl8Ly\r\nmlvt+Kpz94M6LPPPVDQ//J6Ai8W2lGEg9HqrjuWnQYDdBgIdKUbikiso/6y9\r\nC/9H7YlHCSGBhqBf3twxyyWRd4HG9SiMwVOqh4wgY4xks3dxLOEwAzQefMnb\r\nE34DrrC5C7TiRbE6068whZxd9YFHOFQ7n7KVz587QZg11bmzwIkEnCfkKIci\r\nVDw3sTu3I5KgRGskABy4p5ikOn7EWV/n3MszES/Mzkt9PPm1WXVpzcTwWP8M\r\nYMaBXA2fHLhQZ8q4m9nzUwfsDn+59H6rowLNqp6JNsgDkQdxwtYEmoAmNSpX\r\n4W0Jsr70cGCwSho46QYExXMoPS18uNA0Ry3HDGE257F3vvJnie0xP9/tRtSX\r\nsGMB1h/206fUmcj9CrAZ6UBbDgCzq7OC0i8GoqJlO3PCo9I8rPGxHhfLArXa\r\n8/MXhXAyC+Z4VgoOFx1pM00FkmkeAe7wVP4=\r\n=5SXY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"73f7402d0fd839f22c2c3bca08292a66389f5829","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.aa85f9413.0","@material/rtl":"15.0.0-canary.aa85f9413.0","@material/base":"15.0.0-canary.aa85f9413.0","@material/shape":"15.0.0-canary.aa85f9413.0","@material/theme":"15.0.0-canary.aa85f9413.0","@material/button":"15.0.0-canary.aa85f9413.0","@material/tokens":"15.0.0-canary.aa85f9413.0","@material/animation":"15.0.0-canary.aa85f9413.0","@material/elevation":"15.0.0-canary.aa85f9413.0","@material/typography":"15.0.0-canary.aa85f9413.0","@material/feature-targeting":"15.0.0-canary.aa85f9413.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.aa85f9413.0_1664215078387_0.0806290403069223","host":"s3://npm-registry-packages"}},"15.0.0-canary.7134a7752.0":{"name":"@material/tooltip","version":"15.0.0-canary.7134a7752.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7134a7752.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5965f75566ea1f86e784fe264b7dfd3ac5a3dfab","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7134a7752.0.tgz","fileCount":36,"integrity":"sha512-7sXVWkO1MfIQvcL/4DQTIEQwByl5/S92NFXQAQV+kOxznXMx3Z1GkxqSF7JtA/iSYYuN5MMBTMZuD23iR5jT0A==","signatures":[{"sig":"MEUCIQDXSFgjA8G5gWfS4u2MLrw4W9MEx2rvFBwXSPonh1WErwIgSguPpmw22VV3PxzO4HXD2L3JVMrbdey3eJMvYhp+bWU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMiCpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoM7Q/7BpSAY7AEMaF4PnyAa37sJ/lhPOJpQB51Qvde3rfcAnKlbS9i\r\nxJWgAPUZhnz6P1tKn70fTB1r1lW8HXtJNg90k408ZdMEyaZUNLeYgTeoJsKj\r\nEddg8yDyuuhmDbsK9eiAQ/wqMmRPIXJnl6jNje5gNIN+l4T8fVk/92An0HOU\r\n3hI/EaU+pctRHy0hOHTHQSxZPhTKD6vwiDhNVaMHnaPs0u/FY4kAjcg4ydFI\r\nR2ClIWbyFNXgaUFarlQyttBGXtsg9OtXQa393HjP673Xl1g1QyaTIE0bpCs+\r\n8rFxns7vlzmzD5tcgSm0L1PAFxVPxWhJDMv6SQ8GBRXAo64UICn9KjxCsSJm\r\nDE3dvkO5lFy0PqyPjxsAniatGf7Jx4E9iyxN8w4D9xZlkpwICcKSGiY2NDPx\r\nSDnoK8kxj2GyXPEgK642E0nvFg//EC8M7+X7iiYuAL8/JsUc0LFfrHHZ0/gu\r\nK4rPjG6Oq4pPMpI7Ew4E9/QRdxyOZ8B/zY/vYhfnMJzNrNVzK2nr0zu+849U\r\nFWYvzwlw5kuLn5NU6Lfr1gQh8yiyPdqt+e4hiI/9UI+8jIZQkIw1sNh06nBl\r\nA/958NPrc647Q0qHryWe7WCX1fgvQoV/FylLyQkR4uIG+5lKyQud0lfVMMA3\r\ngb/9emS+F13FTEzA8Bv33wHbcwcJl7PCMjs=\r\n=dCbJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"31aaa09805eea1ad3a30e7b91a8bf8ee8911e80e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.7134a7752.0","@material/rtl":"15.0.0-canary.7134a7752.0","@material/base":"15.0.0-canary.7134a7752.0","@material/shape":"15.0.0-canary.7134a7752.0","@material/theme":"15.0.0-canary.7134a7752.0","@material/button":"15.0.0-canary.7134a7752.0","@material/tokens":"15.0.0-canary.7134a7752.0","@material/animation":"15.0.0-canary.7134a7752.0","@material/elevation":"15.0.0-canary.7134a7752.0","@material/typography":"15.0.0-canary.7134a7752.0","@material/feature-targeting":"15.0.0-canary.7134a7752.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7134a7752.0_1664229544677_0.07773690494834695","host":"s3://npm-registry-packages"}},"15.0.0-canary.70b8ac16e.0":{"name":"@material/tooltip","version":"15.0.0-canary.70b8ac16e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.70b8ac16e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"043e29adb8a3a8d98fd64415372e5c22faee4f65","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.70b8ac16e.0.tgz","fileCount":36,"integrity":"sha512-pgLu90k5gNNmanwOZglbMoqzSNs+n2dh0opjQnUhSwfKsvrNHj76ZuTb/qm6RB/doHA5JSnAQZXySaaVTkGtoQ==","signatures":[{"sig":"MEUCIFaceGDn7jT2UNtSgeDUViZNqVpLUeT9PmW/ynfZFMWAAiEApQi8e0uphgun8UCpzcJb0vzO00nSH7NzJBqE/7sbJ10=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM306ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohuQ//e+bU2uYW4mfOuJw5sn2EgV5CpAPpw1nH7OCHPk4jddYKNbup\r\nvEJ/wBz24ol7hN6AI4DIOxZ0+zBQH5wlTQClx0ZTMPeCGQhXwQZ0XJ032qVx\r\nSUJ7J9P+SXeDynPmDj3hVEfodRK91PJl6E9KdthIv5+UwACRc86LG2l2KG/d\r\n37AcAu14Kac40ZmSlQ72Nv+X2b+vqGhqIwUaLEAY+8cDqStVpnU3OWOA75Vk\r\nHHqHVsT7SoGmuQG5uJP4BAipMoV0e7hE4wQsQ8a571UmvmkRX+JJoltZ3bHg\r\nitqKIptgGtVYT8bAyG4kW6JL6cEzz6kEDU0E1vBmmdvpHuK0MZw7nhOErOVd\r\nlanOImTPQCS0ySW6YWw1j8kbxySVQmYZd9qZH8192WDn+6K/y9gPktEKaKkY\r\nmiB6eRJzSXd9NpOGVYI1hsVNCXbOsyYPidRr8VGIJ1SJAcNCXCaOGow17Q3P\r\n7u+f/C+BJlCEBoZj6SETbrraMG8ihLTXGXyNLV8f2//p/Xzcb6sfaD6jc+3i\r\ndFVHAyopqhGQxSAwYReC4xQGXDKmBl6uIRqZtKRsX9scxX1FGG9MTPvKU4JI\r\nJGMX43eWIPBjequgte1QgPO6H+WxAP1NiKR/mu/vmchDo/zDob9jN5L1qEWO\r\ncnWv9ZaAonnKncKzXHpy0+a9m6SAzOeLdcE=\r\n=srrI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9f9fb4c3a4123798d2b993ab287cc4bb7e8d7014","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.70b8ac16e.0","@material/rtl":"15.0.0-canary.70b8ac16e.0","@material/base":"15.0.0-canary.70b8ac16e.0","@material/shape":"15.0.0-canary.70b8ac16e.0","@material/theme":"15.0.0-canary.70b8ac16e.0","@material/button":"15.0.0-canary.70b8ac16e.0","@material/tokens":"15.0.0-canary.70b8ac16e.0","@material/animation":"15.0.0-canary.70b8ac16e.0","@material/elevation":"15.0.0-canary.70b8ac16e.0","@material/typography":"15.0.0-canary.70b8ac16e.0","@material/feature-targeting":"15.0.0-canary.70b8ac16e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.70b8ac16e.0_1664318778138_0.6446630759661596","host":"s3://npm-registry-packages"}},"15.0.0-canary.c20d74405.0":{"name":"@material/tooltip","version":"15.0.0-canary.c20d74405.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c20d74405.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d58b6c1db55a808f0c601bc37063e911947f9a8c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c20d74405.0.tgz","fileCount":36,"integrity":"sha512-si3FIKoHZia+3oKwjFa+CtWZBm+Bvc713MGc5Uh6gyhFUaXbe7aBuBUyM+Fe8inDO7bsclWx97J9OnwkNf2uvQ==","signatures":[{"sig":"MEQCIBOyvWxqz9bYpu5J4avJ00CLuQ1UcLwoPh7lphXcqW6RAiA6/7WVLWBjzCW68CdDuynJ6OX+RglMBX/Q16QvnFZnHw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM4gXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEDQ//R+oftJSu6hUQDMq1jw40tvuV1mwaNQJIKMkUhGQt6nyXgKfr\r\nWpTGMO4/pcr0duDSYpPEN6P/KgdqmE7fRigyA3QnTsQtJH1Sogx1tyE7dqkn\r\nO2mp/Q+2PEKkXN863alFX69D9UKjv7iZXQ9Cddnxf/DeTLVvQ5sLwXc3cGxe\r\nhle0IC8oUMjGiM/Y2B6vQR0UQ6DdU8ieLC078D9fz2R+CvLS5XKqcU4dqCMB\r\nNCS5DrJVPyMMo20vHCd8fGW6YFXSSufYbSE70psZdN1pzXSoZN8e5I9a/pAN\r\nY2nVTNEyhClJpOgE3C/YDIWTcYsh2Zaetw7oEA0Mv7RYGV2FYl19Q6dWzDgA\r\nGipDg/flgh89fgVaA82w2PA7AR5liwjBzndFQPaeGdprH2A2LRmHe4p/O8g0\r\n5+EvfnjbL3/BakJ5ywzeJcpj2YBHxPN9CoZV1143G1pT+mKhPUU1m1DQ9wcb\r\nTdPD9pwTI9QEVh69nO3RNEe1LTZRDu0UK1X/AhFk1WG8r0J/o1N7rvzlHUlX\r\ndp+2qZ9LDkvt4v/M7L4BJsqTGveYmPqVVZYxYLFnYYh+PWFSjoskyEq/2bWz\r\nsJBKy4Dibe9YKTLiruxT8qP6a1+jHIGPVdp8IH4uf1BuC9HHHCcjbHk7FNVc\r\nG9mzbqKv8Wq9u9yRsOD3AewVGQ4TXzmobKc=\r\n=9ye4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7e1c6f9d7e3c90438265d23d710997462d087d78","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.c20d74405.0","@material/rtl":"15.0.0-canary.c20d74405.0","@material/base":"15.0.0-canary.c20d74405.0","@material/shape":"15.0.0-canary.c20d74405.0","@material/theme":"15.0.0-canary.c20d74405.0","@material/button":"15.0.0-canary.c20d74405.0","@material/tokens":"15.0.0-canary.c20d74405.0","@material/animation":"15.0.0-canary.c20d74405.0","@material/elevation":"15.0.0-canary.c20d74405.0","@material/typography":"15.0.0-canary.c20d74405.0","@material/feature-targeting":"15.0.0-canary.c20d74405.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c20d74405.0_1664321559405_0.8673872428625595","host":"s3://npm-registry-packages"}},"15.0.0-canary.f033fc8d1.0":{"name":"@material/tooltip","version":"15.0.0-canary.f033fc8d1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f033fc8d1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"130571f0930390f0164134b6c2d3572ed576281d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f033fc8d1.0.tgz","fileCount":36,"integrity":"sha512-avUp/I4GtE8FWvH5UvEIRv66DU2qdqYASqQ0YgfLi77Sgl0u4TeY6ABEHbLwItTGsHojxGE1eqsBoKbMLdsfoA==","signatures":[{"sig":"MEYCIQDP6OYWRq9FmRYSNgS2fLWXI4c9XGI6nD8mi6OWmDOT+QIhAO+rnyKc0iNXm6IupNLOXSLPepeCSx4TW3aVfrMCU/kK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM44/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOZhAAljLGNglSzPt5GnrF/Rk1CFL3qZr5V3LPScS6xs9NKrqRJekA\r\nMFnOSeWgT5z/XcSxhXH6DePw2XBoSbugCeUcDlrfJWZyP42iqL+A2Cw1+KyM\r\nRAyflOH5b50zXBD6ib0fNvQ/MVOG+hLt65J4rlrDIsYGCBm4hppt3v7VgcG9\r\n8Wn0CI84A/SEHWbBUj/dh84Gqv3GimamC8fPqi6InZ/y4iHhGWkaQJSvEmb1\r\n9aiEdkaxcq5Sx7A0+wTHqg8nFq8kPSFqexSOhZKXiZUR7pQHZ/uHNO9nshLS\r\n+1CApoqzJz9MKtJWBaAXnYYHOUP685jWh++JTWR4mnLJZU+hR5vt16QENZdS\r\nThxVAzv2oRZDdzRzEqdGH0zPePN2jvSpr+Ajs1VbqLmv/ZkWcVNmOadPx7hd\r\nwLRmBhkWOMvGKdIeq8VU+U+SHnQCZ8rCLDJI2EZM06fYVeooY3IlIAxiNcbv\r\nFUsy6SUyxovFIh2ifwSzApmduJ1oWjnlL3fPRG+4bOzQIRh82lT+D3wBuB3F\r\nk+rklKCYK2QSmxe0pubpCftnGc/HbVkTbxFRwSrkNRDHefAFzAoNk/f1nzpi\r\nhIsLAaMNjeB+JEEYng4wYHkrAiB3y+k7PJ+AOF42Akv3Pe5qyLgt/76rjoA2\r\nXCzTivUftOQxvZ+BKYKy3G1LFA6bAZoI3Hk=\r\n=a2Oq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a658683d647364520f9de8a2d51f15913b5ffb78","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.f033fc8d1.0","@material/rtl":"15.0.0-canary.f033fc8d1.0","@material/base":"15.0.0-canary.f033fc8d1.0","@material/shape":"15.0.0-canary.f033fc8d1.0","@material/theme":"15.0.0-canary.f033fc8d1.0","@material/button":"15.0.0-canary.f033fc8d1.0","@material/tokens":"15.0.0-canary.f033fc8d1.0","@material/animation":"15.0.0-canary.f033fc8d1.0","@material/elevation":"15.0.0-canary.f033fc8d1.0","@material/typography":"15.0.0-canary.f033fc8d1.0","@material/feature-targeting":"15.0.0-canary.f033fc8d1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f033fc8d1.0_1664323135495_0.9065495976134488","host":"s3://npm-registry-packages"}},"15.0.0-canary.8d7ae912a.0":{"name":"@material/tooltip","version":"15.0.0-canary.8d7ae912a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.8d7ae912a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"17bc320600db889b1dc3439110a17b03b91d5380","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.8d7ae912a.0.tgz","fileCount":36,"integrity":"sha512-UBBj2mf/3yNBQ0URVfOLdpDPfRwQw/rQjJl5ACXtxvCiGqqsySQJafiNPyDYwi51HQurX6WYfHsVD+sZViCUUQ==","signatures":[{"sig":"MEUCICKnBe2+eNIeRpqpQRU0BzXQU7tPkzBzeOJ08cYKWaGwAiEA0TG/tIWkWnsN0jjdYMwnby1gpy3fqVp8iKw83WE8Rgg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjM/5rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZpA//XVw3+KO2Fuq4upRakZEPnk8tIN0tqJScpGXkY8mF/+hXxfhn\r\nSK1grvADkc3d0TYnJmudCym+jwMNJOSmc2AVlUScgxN62kmMApKLI3t5ze/w\r\nw9MNtRq2TL93Q8OGtcPc0rEVaGnhjVQbCOamttHt80jjkaPPgwkWEXW6PHvg\r\nycyOXlejoZt6FCSl1kXJwBeIeV4fmm0Bx8MbXBmoEYttSUlTqGyc4bXZZT5b\r\ngkJrrfGkRH1o3i6DLe8a6xpsTkNt+TlcKFLtBQ1sodlxDLs78wPHlRxsAHi7\r\n7q0PpbVP4gq816b/uvTyRzO8KEU/UG6yKrFieda2FYbNjdPjrPEcbkFOWca1\r\nDHUl32QR77pRhn1FPYWbGj7E7eC9YUYH/adFHGI9xBev0AdfsbWyszyPSLiY\r\nT+BTtPZUwFr3WsbyFb9lzGZrTCKmSMibo8FyqM+S8SdnUnTX/LKojCu5Crrj\r\n01dE5thHWGre1Us9QVFfEoh3iU+rBi6Vdiyp2J/PitJ920HU8lbClruBFCYG\r\noijkSfCD1u+dC3La2QwDNH9PBTPPe/v0JybbBt4Qiaq1OrCMhopoIuQhqbMQ\r\nUJH98SEe/pZqeLBKGVXInbrBLU70vN8KgPg8eYTqkdAUmR/6M0p+/7pojQjT\r\nYZWJsaG3zTqNZKNDyBvUtQsBnD9RN1aYl1s=\r\n=TOqu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"26b2ab57ab7cb3eeceab31102ed1b6cb133f4cc7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.8d7ae912a.0","@material/rtl":"15.0.0-canary.8d7ae912a.0","@material/base":"15.0.0-canary.8d7ae912a.0","@material/shape":"15.0.0-canary.8d7ae912a.0","@material/theme":"15.0.0-canary.8d7ae912a.0","@material/button":"15.0.0-canary.8d7ae912a.0","@material/tokens":"15.0.0-canary.8d7ae912a.0","@material/animation":"15.0.0-canary.8d7ae912a.0","@material/elevation":"15.0.0-canary.8d7ae912a.0","@material/typography":"15.0.0-canary.8d7ae912a.0","@material/feature-targeting":"15.0.0-canary.8d7ae912a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.8d7ae912a.0_1664351850911_0.912283219860156","host":"s3://npm-registry-packages"}},"15.0.0-canary.db414b864.0":{"name":"@material/tooltip","version":"15.0.0-canary.db414b864.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.db414b864.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"86a4dae25e6b25f2cd89ab19d517f9fc758c961b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.db414b864.0.tgz","fileCount":36,"integrity":"sha512-ubK3lUAt8uC1VWKbYceG9gIOX1Z2LSHnx6Xp4oVNFiRfGzhFrC7fPLVKq3q+PRiqyuj8xUpzSlhtn2ib31v+Ug==","signatures":[{"sig":"MEQCIERb61pqPakfB1+O7+elQALDzQ1cdsYnYLfAQ6CFFP4TAiBk6EV3+1+F+JzUGbtZuGyRCQpXVuNfHghRl/g4FeQGBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNGAWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMFBAAlwsZcI+udZCbvLpKT1L/3uVxJh/rxa6hJFg5nttPKCpP+WyC\r\nl6wh484NfYBtk2MiLtGY4TPJLJKyUMmHisJv45xVE5dMI0OwLPGJZ0otnuP1\r\n/a9Mgk9TTWnN9KAAgjME42jGOTcJXhsAsaeiE0bHJ07NikGx4IknHtIHGOhN\r\n27qS97gSW+R3jN+yP913JBnLaGw6xApnp8mMdYgYNhm4bSa+UAlaZT2LS8l5\r\niobx4VJ5s9t1dAftAi1mzhN/w2gfsLUAyWbcQRhgisui1X9iQPIqcP4lyODp\r\n4KPNPuenjWwO0gvfP4bKmD4RSZTdNXwBWwesXRwB8/0EuaG8+vUhKxzpaTWE\r\n+Yi5ON8Vf38ADqA9JfRFb0gA1x0nMKiPml6VbOwnAQhXgLrGirBf639/anjs\r\nxuLV2xPM4LUijzVE3Z7UqGReyjc9KDxhRAPeX7L8mhb+dQUxXWQv0tf/P7X8\r\n3c/oZv25SdcP5XPM/D24oAqiSplEzUXDs4YZG+LVgr+LSqYRDfp8BLDiKIAE\r\nXKGNhPG0yToaTQnHK9kEEdWoR2lsEQqlr5nBnyDS1SFIZYkrKJsoN8p8aqWt\r\nvsWhH38aa4o2aNOi8MfJ7X/10dfsDqDbDr+1PNipbZ0Rf7WAxth2h6nMWbcn\r\nFcb5Svj8qrmnZb7B2V65Vj12AgGLFWTKfIY=\r\n=96u6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7601f089a2e7599728805effc4e9bdee40008aa0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.db414b864.0","@material/rtl":"15.0.0-canary.db414b864.0","@material/base":"15.0.0-canary.db414b864.0","@material/shape":"15.0.0-canary.db414b864.0","@material/theme":"15.0.0-canary.db414b864.0","@material/button":"15.0.0-canary.db414b864.0","@material/tokens":"15.0.0-canary.db414b864.0","@material/animation":"15.0.0-canary.db414b864.0","@material/elevation":"15.0.0-canary.db414b864.0","@material/typography":"15.0.0-canary.db414b864.0","@material/feature-targeting":"15.0.0-canary.db414b864.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.db414b864.0_1664376854619_0.9620218992700129","host":"s3://npm-registry-packages"}},"15.0.0-canary.28cc6791f.0":{"name":"@material/tooltip","version":"15.0.0-canary.28cc6791f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.28cc6791f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"509396794dcd58ee2869dfda8340c782da3d2381","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.28cc6791f.0.tgz","fileCount":36,"integrity":"sha512-Z5u1dBBC/O4UzR1ETNEofiwJysIfDEb9zr9rZuABDfBzs4r2lFXRZG8nxLSWCspMPzWUBtxzzjiNO4vOjf1Z/Q==","signatures":[{"sig":"MEQCICp0N+GmnDoPGASsVzZH0VGopWtD1Q7zQG0FJf3SIR5aAiBJUvuPkBxpSlVJop4Mho+nlcOPTPtZc1ApeJmhqCXglA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNI2oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMqA/+P7jJozMHx+7fhDvHli5P9oItitqr0k97yu7ikQGrDYApoq9l\r\nwUdBhU/xGrbQH2Y065uIoXRHX7681+4IQsivZL2b/6uvb1yU2lIgXp2zzNJB\r\nRPPJISUzWiOH7MVNwT84CjiyNvK1e9RgyPB/r5O9GtTabh2KOBxkS3AzqGJl\r\nPHv6ML9lsJ1YKFQ2IQCnVrSB47fpq9bxwDDbLGYQuq3tZ4FJFtVhcXF8MQJQ\r\nhLHgNtPWPP0hGAMH+dLpdv3EhJS+KNu7WN6KqJhP+jub/PpfuYwGNMr5bndT\r\nvbP9mTlnpej9fvpjhazJ97wzvSrTNnFurwsnpTDVsvz6RCrY3U8++FKZBAOE\r\nQH8vyWiKGchj6D+MWb3v3TGGtYoJuqMEkZOMpKUS/TOBZsMniMc7Wx/XNuiO\r\nkhfW7m4BCH+p5SuIystM7E7NzjHSRJcaf+IwetoIRqoUAtRKacXTHt3p9MJE\r\n/tp35/KjtfiJYU9vN8JwmDZyCjGMs7R0MSsGeHBHVQD+nT4aA9hMA8QCpDPp\r\n2YT1Ita2aniFQhbbo2lMNG4aaJyXnx3gdTMpYt6zbXpzWn9BHycCDZJOACPh\r\n1lmQqzrrFaH8Og0i5ETaCSr53LxLaK/j8mCTlzU2Pmh5kfII91xwwX8yYiM4\r\nkTAcpxkcA8GqIhtMipJTIJWHBqrkBfL6GAw=\r\n=WbSo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d2dfa219437727922f4cce877090f9afdd87edc3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.28cc6791f.0","@material/rtl":"15.0.0-canary.28cc6791f.0","@material/base":"15.0.0-canary.28cc6791f.0","@material/shape":"15.0.0-canary.28cc6791f.0","@material/theme":"15.0.0-canary.28cc6791f.0","@material/button":"15.0.0-canary.28cc6791f.0","@material/tokens":"15.0.0-canary.28cc6791f.0","@material/animation":"15.0.0-canary.28cc6791f.0","@material/elevation":"15.0.0-canary.28cc6791f.0","@material/typography":"15.0.0-canary.28cc6791f.0","@material/feature-targeting":"15.0.0-canary.28cc6791f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.28cc6791f.0_1664388520729_0.5399192362451246","host":"s3://npm-registry-packages"}},"15.0.0-canary.a515a2d18.0":{"name":"@material/tooltip","version":"15.0.0-canary.a515a2d18.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a515a2d18.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f7c189ca8c4e809538c132a9684b37b7f87da99b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a515a2d18.0.tgz","fileCount":36,"integrity":"sha512-5NqqsHRXKkXgBxOeEeT5RjWzSVmNZy+oUMib1st7o6P3TUGiwyUy8+vLeWz1HtMasDhjkyKNMFf9plLjipqFKQ==","signatures":[{"sig":"MEUCIQCr1Hwio2+UbCI1KCSLXOCYJpYbkbuoFNC8yWHm/tu8swIgfhycW2X+e1BWqRr5khZY/ppYZreAOjGPfvwaKSp2C7M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNJkMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYcQ/+NgkK23BC0S4XxLkrri2ejuNlNnq4TC6BdDeLCYurwOhHgSwP\r\ndDcy2NYFdTSUn9I1RgacT60iGDSO0PeP12n4PJcmBw+TtqDvUJf4pIxnoMPl\r\nRbLXdhB+Me7YMBP1DEx1pHVCUWE+afz0s3S9spHTC4djsU+ANahAFGsoB+RH\r\n7m8iCdqT1LkCoLffigbHyylBpsEvQ/iUjnaJFASPjUl4nLhuJUf1fSFfP/ly\r\nOpXYrw8eiUyualHdIE6KmyZXJxJMu+paM9kSu+AlqNTzCq9/+SBnjYf1LPa5\r\n9H02rPL0dMZt8yCTTuDBG7il80+H+uS8vOkDevTsgcGUw+AmEUmTXF88AzLD\r\nQhnu/DG7895pN2WbqUhbD7VujqS5DpesLYW5U6BfPCb2hR9kMpzcPPGhYviy\r\nPTUu8568g94X+rBLcmYDNn7tYvwW3NITNnH8GqrqjlLFQJ6VxCAPb3A7Fyxj\r\nUN6UMLG7EKPis7iiOeo67gNOJkbXN1DqxIpCgmZGENIS+GmP3fZtyC2Cemrc\r\nA++3PQelDFSRGD9Y+Co8l62U6WNTdNLMIA9ypqn0fFg59EsjngxGER7ImQS8\r\ngHVcE7X3uSBodY2XU6EoXzH8jZKKIzC2FdFOAzeVNBTqc6RlTHxwEp5HqlXr\r\n/wckO6ucsTuaeBYODaiEk+UZvRqW1ny+mvU=\r\n=CGTT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b634251c1f816bc66bc81c76758fd339ec40a76b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.a515a2d18.0","@material/rtl":"15.0.0-canary.a515a2d18.0","@material/base":"15.0.0-canary.a515a2d18.0","@material/shape":"15.0.0-canary.a515a2d18.0","@material/theme":"15.0.0-canary.a515a2d18.0","@material/button":"15.0.0-canary.a515a2d18.0","@material/tokens":"15.0.0-canary.a515a2d18.0","@material/animation":"15.0.0-canary.a515a2d18.0","@material/elevation":"15.0.0-canary.a515a2d18.0","@material/typography":"15.0.0-canary.a515a2d18.0","@material/feature-targeting":"15.0.0-canary.a515a2d18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a515a2d18.0_1664391436168_0.13120555799540412","host":"s3://npm-registry-packages"}},"15.0.0-canary.ce9523167.0":{"name":"@material/tooltip","version":"15.0.0-canary.ce9523167.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ce9523167.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d08dec380cde01a713a3c0ed1970068f1a780ba0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ce9523167.0.tgz","fileCount":36,"integrity":"sha512-A9HxjtNTZhw3ELFboGIuUfOPabI+meYa/a3szknIlXbONi/4K78B004sUKIKRRuQQ+YBmdwXkHTJzjk1itOeBw==","signatures":[{"sig":"MEYCIQC7rDbaOYjNJlA3lCoUrSJbtx6zeGQQ1kpPVYvwP1WCuAIhANBcc953USGzVAGf+W/lu3YKCaot/klTOWqoorQikIsG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNgDsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd3g//UDyxuaryKj1PNxpI1gOxii3ME2lQcN6Sy35rVgf+zEAaMzFf\r\nz0S7y9ATfsVwfDWkf0/Ue6VVPYlLNvA9EGzW/s2d2hycmp1/1RsOuXFi+4ta\r\n43hRAVj44fFCm3fLYWnHA+qZlTX8F9d+mdmQQ2QIbl0ywQLW7c86rX0MI8sI\r\neSkP2zAkSK8R4/vJszaZqZvkaiMT7q0TM/NHdj6nYcgUEYvrt7xmC+22MzmC\r\nQjOvfdzFHXZbqITDnzP+P//J9qmOxBpWeoZ4ho7GmSZULN0kuI8bajbe6V2M\r\nN9nzAPHQkrInqD+Y6fqQVsIc/sgU6ijbrp9CBSCuNjywnJyP1EJMfwK1yKFg\r\nGitgstOFbzfPf/uUqx8SznCX6zfwWgsL+POCTeC69B28PJV2djnIgbTk4kP8\r\nZamkYXgDN0vpLY/8wBCY6NEk1hKfTk9AsY7h0Uct1NbMn0DiTLzj4fOp3fJo\r\n/Qx2i08iZEYc5t5pYgmS5KKTT0+ccuh9LMBV6XPafA3skLHDc60ppYzw+OPn\r\npl/f6F4v3Qikj8xfESkucFWSGssPTMu4aXbTt4bL+Opf2sLkIFIdVkMH4Byk\r\nJ5AviJZkJSucHeC36CPdgRwE74PCzIGcbYLFC+nRDMG9j7sHaiP4PL46RDDf\r\nyh9l1AVx43SnXJHU9auIm+Xf/a8EWfUm1cA=\r\n=tTOz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8aac5a80fa36dceacc7b3a6e2474218f9092a107","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.ce9523167.0","@material/rtl":"15.0.0-canary.ce9523167.0","@material/base":"15.0.0-canary.ce9523167.0","@material/shape":"15.0.0-canary.ce9523167.0","@material/theme":"15.0.0-canary.ce9523167.0","@material/button":"15.0.0-canary.ce9523167.0","@material/tokens":"15.0.0-canary.ce9523167.0","@material/animation":"15.0.0-canary.ce9523167.0","@material/elevation":"15.0.0-canary.ce9523167.0","@material/typography":"15.0.0-canary.ce9523167.0","@material/feature-targeting":"15.0.0-canary.ce9523167.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ce9523167.0_1664483564586_0.18409717677600113","host":"s3://npm-registry-packages"}},"15.0.0-canary.b2310f7dc.0":{"name":"@material/tooltip","version":"15.0.0-canary.b2310f7dc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b2310f7dc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"45407c3ff13496eb591ed1b65984117e9c8bf088","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b2310f7dc.0.tgz","fileCount":36,"integrity":"sha512-ptmNHTXBAGzYXiLJqzLXbh0nMkS1VWRpzzhj86gwQp4Vd5ipcw8CYlHVungL7kAviTIVXrIe+CWdsHCOKKdxCg==","signatures":[{"sig":"MEUCICr5mjb4u1M5zLJa9EjAOK8kQOT4vl2MTas4K44reQP6AiEAgERPdl348+c3w0JchCpBuhHnmyHps5LkHajOEpKXcO4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":842985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNjURACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorSw/+NJuUFHBEZt+2jcSfadpw++zebV6zpDTI1hbS5Sm4qty/kl5N\r\n3KEUWXDEVGPsOzLoaXxMCeZ0q1lhmvsvpwOU6g2HjuEo2AHaTxB4ovNmnhDm\r\nKzCqnHXcWlOm5uP8KIuPmnfmgd6zmd85gJJG6N1Tw75yTyaRQ3i8/LG/btqq\r\nkoMDTff4BuGj4aMVjprC6L7qQpMXaJ4K+vlYEJJQAOYRE91mLB4hQ2g18B/E\r\njWE5QYtnvGmvTlarWfXVphtSuk9CnGpDIgF4MgZA7AZLzF/gbq+inyZdQjXK\r\nB4NxKvSRmLs5qf5Kf3+1lRgKKlKrZJKCMReGbw1t+HNDvqkxfv/+qDsE7uvA\r\neWIQu4KOgqpO7uaCKU1uaq4PgJlu/7MykQrbQtf01wYPF1raIGm6f9TeOtM4\r\n92Hn3rkPyZrJMCs3E/CrJix+0LzmxI/Jlmba48ab4+woO73KMmWCIX4VSP3O\r\nljCsT3ZL/l3iVD6Kod3FL/ewFRC7SO8GRR+MPuzKZVdZOaDZ9R/fsEEJTcYj\r\nS3L50n/na8caWD1Xxp+aC53vdqjLnVzm+RU7UiQz5C7rDTu7S59Tsw+3ChYp\r\naU36zSLJvH1pp0VPAve71xn3eXiWDWHtJHVi0sm0+MDAHDv86AqRSctjJB9X\r\nCEKSDWPXCPeQjWAkSiu+KVEahF6bzSx3IDs=\r\n=yKLV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1b1f8d124dcef049ff4f3730b930eadfe1e2a58f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","@material/dom":"15.0.0-canary.b2310f7dc.0","@material/rtl":"15.0.0-canary.b2310f7dc.0","@material/base":"15.0.0-canary.b2310f7dc.0","@material/shape":"15.0.0-canary.b2310f7dc.0","@material/theme":"15.0.0-canary.b2310f7dc.0","@material/button":"15.0.0-canary.b2310f7dc.0","@material/tokens":"15.0.0-canary.b2310f7dc.0","@material/animation":"15.0.0-canary.b2310f7dc.0","@material/elevation":"15.0.0-canary.b2310f7dc.0","@material/typography":"15.0.0-canary.b2310f7dc.0","@material/feature-targeting":"15.0.0-canary.b2310f7dc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b2310f7dc.0_1664496912858_0.618438089484548","host":"s3://npm-registry-packages"}},"15.0.0-canary.a44241e54.0":{"name":"@material/tooltip","version":"15.0.0-canary.a44241e54.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a44241e54.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d48680cacf1da943c0909ad22a55afb56b008861","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a44241e54.0.tgz","fileCount":36,"integrity":"sha512-QeLNoJX0Vh8gviSHTgThO/BoDC04mHIwRvcfnWfL0GfErfoY0CYL0sI/2MfjMVy2WWiTJKPZF/cXeZ0hXnvx4Q==","signatures":[{"sig":"MEYCIQD7wiJQf1Ssy7hKSG2BNkmdk6YgOM6Afhc48SPD2ZKakgIhAKdWdbGQu6k2+Ofp+HuGms3YS0xeTSkgVoT5r8kqKofJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1179241,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNqdGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/jA//dNAdgcb543yAtT/+QOBGjdoJPvqpjRjwDLfd85mWc0bzo/Yn\r\na3J9+IIyaBD9Jqdp3nasTBFZmtj8Y44o0loZwIFYs2r0vEm+X1V2foBVZFNW\r\nxXbNm1r5ETi4X6RA1WqmRY6eOu3FmXijByjNIQkjrFNb7nOjHsOO8ukm4wB/\r\nNUBFGW4BE5Nbneo7M2G5XeUIQEb0xtRz4iiVP/2TyoiIbd9blqYEoXVTMtk4\r\nQUhD+EAxgfU7F7qsP8BAZ4Gf+sTJgYdnoNr71+LRZCPv7+lBbOd2Au6BjZg5\r\niTyW9IavrV7imnZM0y5C6rG1zM0vo6htQq0wzm0r//n57j2o7ZTrs8vkILQ+\r\nmCwoJ4UUWNzQ0siS0qrTeTtEYS3NkEbR0YlDxVUwDLICqp71A5Thf6PJz908\r\n6sfaX/Lm8w3vOY4lJhNdPYDo6jWxfhmqFVl+WW2UTmF4tsjQiXVY1lQQAMuG\r\n9VzaovQ/O4k5CmlKDsj6ECemYJjoHAW4R7wHPrmsf2QW4KvOiM8UqFsB/fSe\r\nmQULu7ti31C92U2WqCBosa4Mov9eyeQ797SPYlsoCiN0qKSf7tjc9yk+4kRF\r\n7xOt11PXZnz601xYscp79F+a2ylaTo8uMxaKegbcB7TJRp9RbT+NhB/rrxAY\r\nx2MC4/nUSpXKlVFJOHUmOpyfmQHUdKxpcGw=\r\n=Kc7g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2a5fa6460bb58b3b2866631eacb27411a12f8d21","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a44241e54.0","@material/rtl":"15.0.0-canary.a44241e54.0","@material/base":"15.0.0-canary.a44241e54.0","@material/shape":"15.0.0-canary.a44241e54.0","@material/theme":"15.0.0-canary.a44241e54.0","@material/button":"15.0.0-canary.a44241e54.0","@material/tokens":"15.0.0-canary.a44241e54.0","@material/animation":"15.0.0-canary.a44241e54.0","@material/elevation":"15.0.0-canary.a44241e54.0","@material/typography":"15.0.0-canary.a44241e54.0","@material/feature-targeting":"15.0.0-canary.a44241e54.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a44241e54.0_1664526149919_0.3303391876753803","host":"s3://npm-registry-packages"}},"15.0.0-canary.0ce81e115.0":{"name":"@material/tooltip","version":"15.0.0-canary.0ce81e115.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0ce81e115.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a270bc72b35f58cce1025d71ff35df3cceca0b41","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0ce81e115.0.tgz","fileCount":36,"integrity":"sha512-2WNp/5E/sbU9/r0SFuFcCbgTQwMazbLnqGQ7xr2nVDlkWTi6k2IqXB1pwikC0Jz8MK2bds/9+eJwNt/KRLcVwA==","signatures":[{"sig":"MEYCIQDLLH1n5u6qgKWb6OINvczImCEXjr8DupkZ6efzg3GPDAIhAJ5NmiQLhe8NKvTXfs8nZgE8iNJzMCsW8rmsjrIdq7LQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1179241,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNzNDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgDA/8D8szblmN9eZg0/iIiUAA5ppa/id5fsv7yEXqB4xoCM3YL1xg\r\nes2f4in3nO1ccFe072xQxyT1zebFSsMWcBTk6xIgmwkgvLcmx+gZ5DrOV8fz\r\n18qt+FhOOcHjaXXEuLDltZ+vm7S6JuX0MvWXV8joKNs0Uy66Ozertemb4O7u\r\nVQRqANVlyQyAXp2ROew8G297m7iR1q9sU4H7iFpX+vCJky7/7R/LGEapZcAP\r\n0DrJNZObGDNhQtwYhmr4ju9XwSRgAyq135XNS44Vd9yFFGc7sfODC8EoWvlt\r\nqorq4xKxafzbjgrHRh5K2uCgV6yhzllhiJfuRtlqB7RxEKM2pPQLFczUt0iq\r\ngWCDhiOLtLTJGhhLSyAutqT4Oni2HFGxry2dji7M4UJ9N2Qv9yBMY5Yb6SP/\r\nyLZBwpHQOcCFHKCOEHm1i8FMPyCND5MfoR08gMAhGqvxEeFX/XsSDF2Rzscr\r\nBl2VqJNh3DAqZr7N8ekEXCcchT3ooEzyxGlurYv7RKKuHjqu69crVJMT/A81\r\nBV8QwU7iC2vzYSstkkUL/upcmIYJ0tz0l0U8fZKYONoGdMngWoXSD0O32Gt9\r\n4JXzXcuDCOspNjSThghbSSSD4IFI94+aptDnh/PyibfUTi3TF0sqHMDeLoCI\r\nB3HkLe9Mp05vF9xAYyD28J9Dj4HFch2WDQA=\r\n=d4XZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d690b44f4e157e829199ea749861c3b827d46dff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.0ce81e115.0","@material/rtl":"15.0.0-canary.0ce81e115.0","@material/base":"15.0.0-canary.0ce81e115.0","@material/shape":"15.0.0-canary.0ce81e115.0","@material/theme":"15.0.0-canary.0ce81e115.0","@material/button":"15.0.0-canary.0ce81e115.0","@material/tokens":"15.0.0-canary.0ce81e115.0","@material/animation":"15.0.0-canary.0ce81e115.0","@material/elevation":"15.0.0-canary.0ce81e115.0","@material/typography":"15.0.0-canary.0ce81e115.0","@material/feature-targeting":"15.0.0-canary.0ce81e115.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0ce81e115.0_1664561986898_0.13083779465622802","host":"s3://npm-registry-packages"}},"15.0.0-canary.3cc30f6ad.0":{"name":"@material/tooltip","version":"15.0.0-canary.3cc30f6ad.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.3cc30f6ad.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eb9453d0fdc4ba972bc6e9b40ff05ba421fa07e2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.3cc30f6ad.0.tgz","fileCount":36,"integrity":"sha512-p/45lyxAGe3gr+vwgmpfubPAQYE3phc6fi4p1yh4GzJdZlrUzDr9DJfhQe87IZByXEv103x7uwkRlL2W7ejKuw==","signatures":[{"sig":"MEQCIBOkNWXB60G27z9Eoo4H45slg9mtTBPEwWCEv8jn5PxOAiAxw6EV3N6FMTFmmWUtQKz9Okf7GscEHyYriB4GsQBVWw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1179241,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPGt+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/eQ/+Mexw9HklU7Eyn+fwgzLLrYr1rV/jXPPydzgChJTy6+rVyCDI\r\nXznh+qLYICdqofA6nz+n9P/lyir0ahwpCB2aDHa10fDMCMFQX0L2KNemuI9D\r\nNEXvfVrPGChJc4dq5U03JAQN0dY2H9jscJWjgkBzOJqR2+3zOWiw1uZoT5nY\r\nXpsRGlHkKWXYJ0HU9gOAYF713KIai2ByyZmxF/cdLGlX7gd8SdhdgFvMNUmu\r\ngryImJv1Xetdq3YUNNcPbyk0EHLEttZ46hamQmDwJI3DyEColLYn3357PdIO\r\n5JvmbDwiA14tzx9HPUTpPuXLD36241shh6UcR188urfGMFLkuI3aHe8IhDZc\r\nCH1d9p/X8e+8HsUnRtH+tGISf3iQO3LDY411Iurf3pWNx/Fi8aAZMOMtVJ1/\r\nJHXD9WZGJYbKi/L+hybL2r2pldtkC9t4xDqnz6CrLXLHliqQ3JH7n+Sap9dl\r\n/xO8wjSk8iZp7kwYn74o8Gm5QgpEAIkD0Ytt75N5JxSQYOz0UavX+OO4aJwV\r\nVAoLeIUpCTljjj9g2Op8QE9Zo6dY6SRrmjyi5LvJzbvKRzttmM5mVHBGGl4T\r\nCGz3jXtvCWnsw/VthoW4MyxbNJc33xLz64I60UrMErCnqrKCzSi+FkDP4tW1\r\nJbaA7MslPg2gwWE3nKb/G0nkSFqZDnUfpCk=\r\n=8A7K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"78d02265193749df2eae507da620e7571c09da12","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.0+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.3cc30f6ad.0","@material/rtl":"15.0.0-canary.3cc30f6ad.0","@material/base":"15.0.0-canary.3cc30f6ad.0","@material/shape":"15.0.0-canary.3cc30f6ad.0","@material/theme":"15.0.0-canary.3cc30f6ad.0","@material/button":"15.0.0-canary.3cc30f6ad.0","@material/tokens":"15.0.0-canary.3cc30f6ad.0","@material/animation":"15.0.0-canary.3cc30f6ad.0","@material/elevation":"15.0.0-canary.3cc30f6ad.0","@material/typography":"15.0.0-canary.3cc30f6ad.0","@material/feature-targeting":"15.0.0-canary.3cc30f6ad.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.3cc30f6ad.0_1664904062702_0.8671396050983768","host":"s3://npm-registry-packages"}},"15.0.0-canary.d9cf98e60.0":{"name":"@material/tooltip","version":"15.0.0-canary.d9cf98e60.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d9cf98e60.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7a3f0175d913f293b52c60516154eeb32e9ecb05","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d9cf98e60.0.tgz","fileCount":36,"integrity":"sha512-k1TiKaK2Gq7HDaHT+9hEll4lgSRrA7o0zbNhK5HJie0S53a7I41uVYhEvzjFOyDWPT4BhnqwU14tV7gTEXsGIQ==","signatures":[{"sig":"MEQCIEX5ItoNNovNHLjnXGL9AenFKSWNu3tqC5B3X34N2eHGAiAW3VMvHz4GZTIiDXNSbs5angOZTdeg418fiydjaq6Q3g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1179241,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPIPnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpmdg/+PHUjIXBmA3mPdFkxGLdhvE53KOn+VFRLTpoXs+YEmnomw3o1\r\n/IKzpjp7O+fT6qDTZb0T15V6JCqHsIaQM7xNLhjLirFnKxu3oR/XiyjiFoAk\r\nbQjk/kHY9BaAPgsqs6zlEc/Cyotm/yVBhyHtWW/PNZZed3aifw7oCH7bJtCt\r\npaKRuUxYCm0F1QgxKpqKXJRxJpj780RwQgcWUmcgkIHlMkJTXt/s6g5bRWU3\r\nrGb1GeV4zAvqbBP93MypE64PTHgQ2eRHjPAsmZdPXF9yvFNMQcUDjXusidAn\r\nk4kD2q00QH10/nPTUsDTXNocylLPChX90OlUmOSdK0Nn/rrkDOibP6EEhPyF\r\nzbxXFGpNPbrwj/lC/LUsPy0BLFN49JuPGvaks+tQWqU3OUh91s+04nIQS6Fm\r\nXV4bCodnkKQb7Mo0tMkEORZ119OeB+cKHGvTTYtkWiXpB2R950xl0vRnGqrP\r\nP0UA2ihl5UUVcR/fb83GiG0sRSbzVcfh450a+Qm56in1tIazs2Hj6NmKBkiy\r\nk5J9omScbryvZBOJXHXh0t5VrWCVxBIMAaZoGw7sD0ZbXpdiu7IbLt+dlhnv\r\nWb2kmeyl8F00a7JQ0CkZh34yfEXPLDTQncEMOs4PXnuAjxhwZRAQkDiX+7VA\r\nouU2EwqVJh1ymPPWQ5S4iJNtlyDrnPg8ODU=\r\n=nwkn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"554e3182e6804b0bbc262ea0e730d556747b7382","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d9cf98e60.0","@material/rtl":"15.0.0-canary.d9cf98e60.0","@material/base":"15.0.0-canary.d9cf98e60.0","@material/shape":"15.0.0-canary.d9cf98e60.0","@material/theme":"15.0.0-canary.d9cf98e60.0","@material/button":"15.0.0-canary.d9cf98e60.0","@material/tokens":"15.0.0-canary.d9cf98e60.0","@material/animation":"15.0.0-canary.d9cf98e60.0","@material/elevation":"15.0.0-canary.d9cf98e60.0","@material/typography":"15.0.0-canary.d9cf98e60.0","@material/feature-targeting":"15.0.0-canary.d9cf98e60.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d9cf98e60.0_1664910311405_0.0500666088046926","host":"s3://npm-registry-packages"}},"15.0.0-canary.d71935c8b.0":{"name":"@material/tooltip","version":"15.0.0-canary.d71935c8b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d71935c8b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"778c449080e0be8323afd3ae6c00a120a120fa69","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d71935c8b.0.tgz","fileCount":36,"integrity":"sha512-UBFJTXqb7r1VFG4RPXDwX9k2XOLILlTwtE0IJfDweY/yEK/joiUJO1HdHDiQKuCNg0xhISAjEOt/3p3FWZmoZQ==","signatures":[{"sig":"MEUCIQCD1aS9gkAwn+RZz9u5f636Z3qWZqATu2fEWhCYRfJN4AIgdvdkS8+y76o2+yrb4awkQSYIuiqHMQPvWawsVP6tJiE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1179241,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPo7TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqx3xAAlqwSHtqFJ/F14xlcW4cAQUXfAOfnfKshmyMnhBQo0B8DKcsJ\r\nfOZQR8jiu3ydgUwySWuKCmsLwNdXeywMTz+xVIM3Ugzg6QJtGlh40bpAcZd7\r\nJXLvv7koQ9OdCftOum3iqWZfm5U0mZP4CTvCJkNsTlcZI77gXt+wIhkD9yos\r\n0YaBtTP7sj8MKS7JfBb83jMWeYAY0JWPHO3zJQhh/EUcgAjxrtGDd30KDVIy\r\nLdslPBiJb+cqW7xo0d3YN7Nte01Aa6w64GxQRAbxpllFr7oGdPwks+aM/sjM\r\nh3BnrcDzaqziLH7cZ+4z7YQbKbEkRh9x+FmMsCe/ud3ADaJI1SWsOFyK/4cv\r\nYrQFW718He4LRgtV2OdQ6A9lKNH1Faz9JIhjELapIthKe98vYwQS72fVujzU\r\n7iuz30+jIhTs39U8APEIEDAL0EXUUL2sg6pZCgkciTLZdjOY87EkCVWxu8Xu\r\nZ8I1LgJKHdSfGlJ3wovcBgNmjXDNWKXnC4p4Qvs5sY037nSaNeURwNFvpaEo\r\nh9Yrw+r0V+sY3g9lBUAYR2RZRTx9Ia+Zcm5/BrrpoB0sytdw+W7ByAFh0d6H\r\na+mR4u7CrrUdRMY5ksXhIOTe1GOdBij+dDrqrk4MPfOaxnMcV5HEfgJlfnZY\r\nqY5QBv8UwjVV2DsG/n9IY16sWWB7/E4MMtg=\r\n=4RqZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0e9f697d8ab3c0b93969f61d22a2b06760934fa3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d71935c8b.0","@material/rtl":"15.0.0-canary.d71935c8b.0","@material/base":"15.0.0-canary.d71935c8b.0","@material/shape":"15.0.0-canary.d71935c8b.0","@material/theme":"15.0.0-canary.d71935c8b.0","@material/button":"15.0.0-canary.d71935c8b.0","@material/tokens":"15.0.0-canary.d71935c8b.0","@material/animation":"15.0.0-canary.d71935c8b.0","@material/elevation":"15.0.0-canary.d71935c8b.0","@material/typography":"15.0.0-canary.d71935c8b.0","@material/feature-targeting":"15.0.0-canary.d71935c8b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d71935c8b.0_1665044179138_0.9863642057497013","host":"s3://npm-registry-packages"}},"15.0.0-canary.49c56a25d.0":{"name":"@material/tooltip","version":"15.0.0-canary.49c56a25d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.49c56a25d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1efd8fd503cf8ebded64b2e18ce06e682cf5cffa","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.49c56a25d.0.tgz","fileCount":36,"integrity":"sha512-gh48HV8Oqq1hwNXyNtkNmS5IZbzAlRolRon3SbRPo5IpNsQz76+kU1NUPqArhXpvrldvJoHqAaXPW17nlrcENg==","signatures":[{"sig":"MEYCIQD9T2OnQAbx4Gl5U+eXKZXv1o2AdxKiyvwwAY4DITI+/AIhAKEoTkKHwCa9fOg2lJFVxPpwEREopWoqOLQoAbzmcDqQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPyPjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr36xAAiklvtJ2onWLufw/7exk9XOYTqAHApSXcxbkf30CMjO4tlKVl\r\ny8hnSOMrILfUjd0LBfg9+FSsSNdZahcvunRtfcBpr7OUyASu54NpSsvbRd9U\r\nD5eIyHPWYMiOxsMqaD1PrNgiWelqOUl7+N+LBuHake9KMaVpCcypVZS5Fs5v\r\ns/myhKSUdLq5YidhNjXNgEeaIn4JzdwpY5mBLOOR4DjrQVAEe88MgNkIjePA\r\nlnUhZLq4XfRzuPJ9vX51qblHDMn6Bwx2A5p4++RyEkdrMKG9YtyfrYqtYe7I\r\nDo6B4vSgHE7urvdd6v0gp4uFA1E2XOZEZ2LywdpQUC6COYlQAr1XjeQiUnNG\r\nRia3imgiNnfFaaextIt03kifm1iFG/HYJIyILr0QZAw5WpDIGX7pMoc1gx4x\r\nZp+NNhTFMgJZTjzMpnRz9HqcQtKeTYPX8a5KOai5sjmB0WQxr2Ko/bjht6N/\r\nKS3KlDmWnmmOAiCNjfCwRNf751WXkZLp6dYdkQ2q397/WK9N809/J7nXAZdM\r\nPTBJxq9s76X/WShKZDpoQcZhh6LDl0bLMF3KgaAz/O8kBVzxoLd8hJ+GTwTv\r\nF0LG2/5i3cNI2SrWQ6uL8ogDd8KL4MMPAq1FIqDmZ97g/u6oLx5iYzkVes2P\r\ntN1moM15XX4/mISrTo2Eig6uZWAorVgSg6o=\r\n=8vTw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"46425b4f1ee71ec9e841d7ffacdce7cdc35e7b69","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.49c56a25d.0","@material/rtl":"15.0.0-canary.49c56a25d.0","@material/base":"15.0.0-canary.49c56a25d.0","@material/shape":"15.0.0-canary.49c56a25d.0","@material/theme":"15.0.0-canary.49c56a25d.0","@material/button":"15.0.0-canary.49c56a25d.0","@material/tokens":"15.0.0-canary.49c56a25d.0","@material/animation":"15.0.0-canary.49c56a25d.0","@material/elevation":"15.0.0-canary.49c56a25d.0","@material/typography":"15.0.0-canary.49c56a25d.0","@material/feature-targeting":"15.0.0-canary.49c56a25d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.49c56a25d.0_1665082338972_0.8579416219441707","host":"s3://npm-registry-packages"}},"15.0.0-canary.07acddef3.0":{"name":"@material/tooltip","version":"15.0.0-canary.07acddef3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.07acddef3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36d1b26fca0922a8309acd08962f665a9b61efe4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.07acddef3.0.tgz","fileCount":36,"integrity":"sha512-wv5POIGX0svJ0o8QbQAgK7qd9mced9US3vAhb6Os96YRgnxGJt4SsYV9ce2vzaVyR8WHXqcU8a3xIh8ZiFLHrw==","signatures":[{"sig":"MEQCIAxCXV8zjxn0JMv+NjcDlC4qzKFaR+3FE+ET17sGSi64AiBCHLsNYEHqlSnoDwLZQRBvKzYV/XVoSd7YdXGcJ3FPPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQJxoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1hg/9HVAkX+0pL9BeJVqADDKfOmaQpa1jUyAmHh4GGwsM0FROxm6J\r\n3jTm7rFpHBHFgG+XlMm8w9Wl8JjXgeitPmchewbkcsrO0OXIvfEIFk1aiP7Z\r\ngIha9lD2QxPx863xCa3RvojlNwnUXawDSW73SVjAhtAGjsf5mugmtBqDbfx9\r\nPoEeFxHdU6ZSedvBZREytsbz1VEFnJnmmLGbxp61o5I4l2iEebZs/Ei6WO2j\r\nsrGl7gw4aiCw53aI91nfSxfE9Wuo0Oy5zhtNrZgw3Rl4eWHnETeYQw7uxOu2\r\nX+pT0jaldewTFFw8zIXxYuIkvLkK1OWq2/xGIK+tqIP+gBzMVF2G5KagAk/B\r\n55r/mhfRIEmcnKWHGCOL5LexfONP3ZU9aUYwxtri1VtlHICvpc83yoz2isgX\r\n+pxu1vE5Sh593g96op8De1cIsU2g/+vjN8x1yfOInuPdoYAitb3H5Fx5ya4Y\r\no+PAdSpCKpdxag9z5/okHbtnsRbeMmEF75m9Byz5qJ5z+z2H6qycGZdFwPFQ\r\nJ/r4LoedyFzu0UOogG66xZo7ahXriT096Ii64bKsKXxLByDl+7b16F5zVcmm\r\nDRkd6lQ439BitB050+za5ru6dVhTd2OtmD5qfhNWmRuU8uN6GlE2Y1mE4jR4\r\nn9p1PHUq3mQsgZ8wmU1mLH9cODUmp8qCr8k=\r\n=ZMat\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f61a6c26b4bd60354b690448809f9dfb7ea11564","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.07acddef3.0","@material/rtl":"15.0.0-canary.07acddef3.0","@material/base":"15.0.0-canary.07acddef3.0","@material/shape":"15.0.0-canary.07acddef3.0","@material/theme":"15.0.0-canary.07acddef3.0","@material/button":"15.0.0-canary.07acddef3.0","@material/tokens":"15.0.0-canary.07acddef3.0","@material/animation":"15.0.0-canary.07acddef3.0","@material/elevation":"15.0.0-canary.07acddef3.0","@material/typography":"15.0.0-canary.07acddef3.0","@material/feature-targeting":"15.0.0-canary.07acddef3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.07acddef3.0_1665178728412_0.3302701842010982","host":"s3://npm-registry-packages"}},"15.0.0-canary.1c74eb2c0.0":{"name":"@material/tooltip","version":"15.0.0-canary.1c74eb2c0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1c74eb2c0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f142c6eea40a68c741299951c23882616d2fe34b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1c74eb2c0.0.tgz","fileCount":36,"integrity":"sha512-gtJjdCq3+2webUn256ONATRdOc0/MJ1TXLMpbh+PdX+bPzYNb0OGQuOn7lAvMCwwyFcG8KIGxqiAdWLWHz+SYA==","signatures":[{"sig":"MEUCICgz4RaRRV37BECUZyBDMEFCM/kzzYEY+dN/+5NmtK9vAiEA+VMrdHa60xu2S5HLigpDD7PELx0RV4NuPkHr4qAem9M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQKCsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHwxAAgnlFarpkaPs0PXTMf/726xsRaJd7PUSvMl69aeZqfeQakjh+\r\nasXxH0TE4U6hFhfnBNqxajXOVaNFvHTsFJgqDfZuaeb/e0+DZwPJVHv8I9l/\r\nbvaFY1b3iMahK5uqquWWJUohGNLMtxIX6t2occqtbauceMud+rfp/5MoKRih\r\nHFp4cj4317XhM1WhdFyop24PgZivbXkDdi5hvfLfG9upSXMZh1s1Mx34xnya\r\nqOk0SlhGqolqX2T5uozRGxQRukOaKQpxTHn6p6MDQtek9g0wRGu5ZCkOs12V\r\n+WwdriLjWAJuwczR9/hTy//15z1lUFbCiY2iB3AuqwykLGqQ4OI8WQq0Bztz\r\n8kwWr89BThOTvbNVwByRs7OJroeYyJcA9RVO4Lq9BZg4QAtty3N+47DyIM2L\r\n5WQSCT9voxA9+Uk5HSUC0KChnVKCYCrOSDr6hadigO1bC5QD/TjK3aaEdkya\r\naD+IIVe+9CN9fQ5uMIrcv9rx1F+AMhdRZJtZSYZQhCy6zo/niDg3ALgw2RY4\r\nVcIKeh2YYawtAtUkSZi9v2vF2DQJJFv3jq1mGN8TxYNew3eolloGUZT3lBus\r\nJqknUExXRRiILfNrWb9wiXhOclvDhdi1okRjvDoNclvOnaNulRw0MqSKmtwB\r\nVpILMTE02qZGEu9QlJio5rzbfLyBycbxA6Q=\r\n=3Qtu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"fa2e48f4e71714ca4a637a500ddf18f562031ba2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1c74eb2c0.0","@material/rtl":"15.0.0-canary.1c74eb2c0.0","@material/base":"15.0.0-canary.1c74eb2c0.0","@material/shape":"15.0.0-canary.1c74eb2c0.0","@material/theme":"15.0.0-canary.1c74eb2c0.0","@material/button":"15.0.0-canary.1c74eb2c0.0","@material/tokens":"15.0.0-canary.1c74eb2c0.0","@material/animation":"15.0.0-canary.1c74eb2c0.0","@material/elevation":"15.0.0-canary.1c74eb2c0.0","@material/typography":"15.0.0-canary.1c74eb2c0.0","@material/feature-targeting":"15.0.0-canary.1c74eb2c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1c74eb2c0.0_1665179819254_0.8493182370708874","host":"s3://npm-registry-packages"}},"15.0.0-canary.dadfb713e.0":{"name":"@material/tooltip","version":"15.0.0-canary.dadfb713e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.dadfb713e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a30344d1d303a07ee0e0ddd8b284835d80e54378","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.dadfb713e.0.tgz","fileCount":36,"integrity":"sha512-TQc4qtXAl4YTv5FRPL/7sIlO20oHOEoLxvUKPgNWn7qExYQvkfJ2AAvVCCrQEhRoEeBWPZrAb/nAAFQyvyCMag==","signatures":[{"sig":"MEUCIQD55ncM51sJ+ySpDhQby0EX+GvXAqMIUEmCvZ1Ij7epHAIgRHeWxGzKG3VelWm50YHtHNOPSDUpFsU7zmSncYYvf/8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQQVzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoSiA/9HlQooiv/0gc6JWdzDg+e5Plc7Jgc4H3OJmDf+FsalDpzRLRP\r\n+d1qc26qdVBVS/r4SQKrGwXBX54mAY8/IhM2ompVxZGi1CmntKtgRl6DaCjX\r\n/cNSDtToVa/ITMis9W4x2L1gs0NEWf3RUVU1pcydgw0YItXPI8QlyYmQUgGR\r\nguf9xc4kjRZVV6JBDCO5mX+uYWaq4jR5gwZYyb6RKvoVWwYsrtoA1iKJV4k4\r\nD2iDpowqS91ek9hXUma6JH6vS2Yo5hmtYzt7FyYPcWZX44UKNivUqzUcvt6I\r\ncePxYZg4G2qs2BFtduQ3GjNDlUpSJIbjnTgj5IffHVsUDxo+AAdF4ggpdaUQ\r\nrh43cnNkzpPwuRqFPx1EdRwE/hJ0o5UQaer3DugRIQ+iZt3oB8z4DkThjvii\r\n2Wul8imAUvGo77aPUwxvorBakdsllWUouLd6cBjK7d8yZwTpf9n6t2iz/G3v\r\nGp7M3VcpYOmZt5D2MZEooz+vBycZKksPi7SSY+XPZbqQoHvNChYMuDNVhlaA\r\nbcZrNMU+vz60LwVzGJZ9I3KJ7nnF5MFlY20hqaWGYPQKoB2AtGTXBBYLUCaf\r\nZStKpKOgG8+JE+Gr/P7WYaTztNBsOauK5fuS7BSSD4mxWxyvW30JUZUSfTHH\r\nrEAUzXjJPktoqEZGIxH54YgmqZ7W9H3MGP0=\r\n=s2i3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"dc577772f45028a4c4dca1d7c8ca8dfcf636e763","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.dadfb713e.0","@material/rtl":"15.0.0-canary.dadfb713e.0","@material/base":"15.0.0-canary.dadfb713e.0","@material/shape":"15.0.0-canary.dadfb713e.0","@material/theme":"15.0.0-canary.dadfb713e.0","@material/button":"15.0.0-canary.dadfb713e.0","@material/tokens":"15.0.0-canary.dadfb713e.0","@material/animation":"15.0.0-canary.dadfb713e.0","@material/elevation":"15.0.0-canary.dadfb713e.0","@material/typography":"15.0.0-canary.dadfb713e.0","@material/feature-targeting":"15.0.0-canary.dadfb713e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.dadfb713e.0_1665205618767_0.35110343843844816","host":"s3://npm-registry-packages"}},"15.0.0-canary.395f1ce61.0":{"name":"@material/tooltip","version":"15.0.0-canary.395f1ce61.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.395f1ce61.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36cb562b9c6801f43e3d140565f0f619e7b9c78a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.395f1ce61.0.tgz","fileCount":36,"integrity":"sha512-p+dV1wV46aS4kIjI4WKWo7Z1C5XPQNWZYhhEWB3nLTKqENmYFfG7qHUESIwDOB65xZcWd+2btRetqtjKGJsRYA==","signatures":[{"sig":"MEUCIEh0t0PzC/lqAR9683FC8bZEjgLpXfZ0/mQrgUvA6ebkAiEAyNmir0r36QIsMBmAlYC6T4UjZnDMyH7BI5rw8SjCZpg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQQXqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1Rg//YZtYiEwfo9XIlCXpYPdErp398vt7pJsNRPodpYHQ7ZZwgASP\r\np/yx+cJt0vs9+W0m/vZy6jeKzV0bSQJf0lMCYif0esBlgSVt5GFoQEjKyzp8\r\nQblRfY6/6xEObhjIeAYE+eXUfLYjxtbwb3lRbcqimqYG8zXBMck4bEjBS5rA\r\n8n8KiFWYTK32t5qAdRnr96uDXOttTMBaFUDW4wfiuKk+oRR3u7YdwS3c1dGU\r\nfpTwr0pJXOYEEhOeQHSpCG262TZceJNN1xgDfAtg1G+J5n2EZw51XajqpkoA\r\nKjagFIndcUGW6pH3kwYL89tX8CPVeg+fPo3abqVyobRKszOkp7fXIVyj46+L\r\nlqI8pvYoY47RcKpOK1V9J4goiVj6rM8cb5/TCW+/8AGSCZd5700LxmQiWQ2v\r\n1Mnqda6qce7VdThqDFUpPXVvKeUnyXr1qotFjb9zLlV1+n9AU9wtUX3JL9Hb\r\noG+m8+S3MOtl4myTmOknbUOsHs4FDGekcFUDAcm/d/qrD54tKr66WDX97Hwo\r\nI7TOiwZKiX2EBXmIWvs4r8WGLUHWKMc3EmxZ4siNBFWsg8WYdgKVhKP5yqR6\r\nzH0CQElf3P8ULXFg1ypzG2K6tGpRPv760Lv/y4WLVJgthZ9kll9wD5SULeoS\r\nvV8bgkAkJ/znkM0f61BQWB/CSOUrpaLO6II=\r\n=oRVX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"15a2d954f8c5260da0e9b6f65b6f49df69764a95","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.395f1ce61.0","@material/rtl":"15.0.0-canary.395f1ce61.0","@material/base":"15.0.0-canary.395f1ce61.0","@material/shape":"15.0.0-canary.395f1ce61.0","@material/theme":"15.0.0-canary.395f1ce61.0","@material/button":"15.0.0-canary.395f1ce61.0","@material/tokens":"15.0.0-canary.395f1ce61.0","@material/animation":"15.0.0-canary.395f1ce61.0","@material/elevation":"15.0.0-canary.395f1ce61.0","@material/typography":"15.0.0-canary.395f1ce61.0","@material/feature-targeting":"15.0.0-canary.395f1ce61.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.395f1ce61.0_1665205737988_0.6883779932056053","host":"s3://npm-registry-packages"}},"15.0.0-canary.e741b5c82.0":{"name":"@material/tooltip","version":"15.0.0-canary.e741b5c82.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e741b5c82.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bf735ed5c483c1d7562726ae7f1eb5bfc38504a2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e741b5c82.0.tgz","fileCount":36,"integrity":"sha512-+lFbhrFCJQrgTH3KMQghPN4bEKhjD5CORepbW6LwUk2asgqhOI9QIzpeWD5sk8uqONEZCxx4C1SVAsyT/vUUfw==","signatures":[{"sig":"MEYCIQD4sVhgiMh3rJbV0wg16eZZGMpHr8m8VdzB2nvj5FYKmQIhAJUn3B1m2Uhs9hYxJUtUb4qifPJ0G+8a3RAgkUnQmemj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRFjLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmreVg/+JZ8bxd2NX23AjQkMmxuF5G5NchcywYBRWeiEez90BwY6VdTt\r\nj7VasbtsOBnvUOyHk0ZeCG6e0XZ5JUa1yCXm85erBhyOYrj7iWm3vwF5SHbO\r\n1lChAd7rcAdbm12LUSt+cpAY3Hsv+yX/0x92zacOTXXYVU+RbrTdwMy3bkNX\r\nc3lZzY5Zi4C86VcISc3larBXI8E6806+UR4/m9u7/X6cz+gjT7O4CFpzj65B\r\ntY9YXhAen5WFc1doUDgrNAId0OFlxGSBGLAezVE/WD13Ranr29w2dKKeAnyU\r\n5UZBZdBKzF9fa8aLIG1VfIpAW357YDIitlV+Yen+9Rx8+I6RSSvenLAAQfhD\r\nsaN2m4mUX7csmPRsHAl4BCkMvOUtBzMS3Hc9OoRYq2U34/6z8AJ7QEGtVPyQ\r\ncM06tf3GFbRvedTd9P1CHDN2TyD+EjLufrSb9RwbADr3e/pjBNL2JSvkDdLM\r\npPgD/+LOY8TPNyQ6/vzXrK+Uu5uwBD6Cv6mBvZFYSv49V+pkbypsSq/JIK50\r\nPA3LNRDmkJkBZbq/TMeGmVu7kHGOfgdUjKPXBg+YBgwbLcYL31g0Bxi5U7Kf\r\n5bKEodCtwztfKLHxF09IvsOvdA27p9gZt94sUR+77h2gWf4X09d3cJVUKgm/\r\nqeK3OE9D/iEhX0asv2J6frx0mwWZAU3RNqI=\r\n=V9l1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"489583dc41bf06c909feb0a87f9679b40fe6c03a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.e741b5c82.0","@material/rtl":"15.0.0-canary.e741b5c82.0","@material/base":"15.0.0-canary.e741b5c82.0","@material/shape":"15.0.0-canary.e741b5c82.0","@material/theme":"15.0.0-canary.e741b5c82.0","@material/button":"15.0.0-canary.e741b5c82.0","@material/tokens":"15.0.0-canary.e741b5c82.0","@material/animation":"15.0.0-canary.e741b5c82.0","@material/elevation":"15.0.0-canary.e741b5c82.0","@material/typography":"15.0.0-canary.e741b5c82.0","@material/feature-targeting":"15.0.0-canary.e741b5c82.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e741b5c82.0_1665423563115_0.6809806475532152","host":"s3://npm-registry-packages"}},"15.0.0-canary.582f3cc1c.0":{"name":"@material/tooltip","version":"15.0.0-canary.582f3cc1c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.582f3cc1c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2b6b7870b2de31d22df241b99eadadd4ec4d140c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.582f3cc1c.0.tgz","fileCount":36,"integrity":"sha512-UMi/yHvz/l10uRaRQKBRMDqcWnlX5PC0NmuJ+5RSIzb3n+ODCCcnJrSAUcA7Rs3nyckEGatmO/TgCnB8SMS/FQ==","signatures":[{"sig":"MEYCIQDQKZWU5PzNU723S0rACvdahOu75qu8LG+fZt2p7VmF4QIhAMPVKu4il/t6rTNL80ZY4Z8idUcUDuHBfyVvumGecGza","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRPYKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpuzQ//VW5J7ANUpUvZw7kIGkF7gX0i58bG8UAnwzRDJgGPDgOFeVex\r\n/+Au5e88kHl8ElJqhFycgXGhQnEyEDI9zEq3GFJFc76iCHPxNaKgGWe6HwUW\r\nZvezTW9nPw2lapzJ3RxcQBoHGXb/4keiC8Vxacax473mN7PBeD7dHxerYne5\r\nW6trwQ8Ds02Dn+TFfEXI4asjsJsRvfV7NmlNttyjjw/KTItrZFHwu7iD5ZhE\r\ne1WYcKBklU2VlIA/7+OPMvz5RyuIcja8Lmr6woo0bE2ucYkCPZ6+mkMLGFXj\r\nO8z/GQlav+TGXGLIvOGNVqipcixaNrPa1SAGxsymz5ZnxY4fUkRWgS9oQCmc\r\nmW8h237p5WkJrzFH6hsy0B11wfuoPRbOJH2CZozuRDM+BlVs9ny88BjEYwA4\r\nDFgTulXOWrhdJ6pr9SPQigfsSscZWXYJnuHEiM5tSAtPl/NzH4+TgXL1V4eV\r\n99X2pLFNiBPA0w95FGA1EbXXhLk6Aa5JgTMw3D/ka3ArYkB+I/d5fJs7NFU/\r\ngBXkxdcSWQHfv+e0OSSgi9I2TAhPJvEKFwO04ZtsuEq1xm6GH8hX7zr7e6lx\r\nQVUP6kLrf++pfZJtE/8NpzU90s5a+AElMYNWDIDh/7bz5Kq5/VaYmUnb8gtQ\r\nDxx7RRp8zHM9OC1e03wgIFKeIhrw87E8ocA=\r\n=uPAq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9910dd1f5b3fa962bd02fe552774781896efa7ee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.582f3cc1c.0","@material/rtl":"15.0.0-canary.582f3cc1c.0","@material/base":"15.0.0-canary.582f3cc1c.0","@material/shape":"15.0.0-canary.582f3cc1c.0","@material/theme":"15.0.0-canary.582f3cc1c.0","@material/button":"15.0.0-canary.582f3cc1c.0","@material/tokens":"15.0.0-canary.582f3cc1c.0","@material/animation":"15.0.0-canary.582f3cc1c.0","@material/elevation":"15.0.0-canary.582f3cc1c.0","@material/typography":"15.0.0-canary.582f3cc1c.0","@material/feature-targeting":"15.0.0-canary.582f3cc1c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.582f3cc1c.0_1665463817963_0.4592108245411899","host":"s3://npm-registry-packages"}},"15.0.0-canary.b1a6e3e88.0":{"name":"@material/tooltip","version":"15.0.0-canary.b1a6e3e88.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b1a6e3e88.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fdfb5fcb4d44713f74b234eff08511f7eaefb67f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b1a6e3e88.0.tgz","fileCount":36,"integrity":"sha512-UfwQkiUyzaYw08HZjX4xGHaqYhG8OJj7XTo+b9xF6jUsMjeTJs1SpG5CQn703NdepqhFl1hDT1BalKgjLy0w4Q==","signatures":[{"sig":"MEUCIQCtFaoR4h1EEQ3jfSjBWsF6icrgZXq4t3Fs/OM5KDMXHQIgYFinwrvXbx8VSyZkCQUiFTaTFNj1b5oEZUnpZxzGwXE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRq0VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYOhAAiHLcYG/WQWxFjyu7sjZy2sC5afoZMH8i+KOkJ0QAkUIOcffY\r\nzeTu/6QDtV4r8F3Srja81CmRtRvLvVGeniqaOmRj2cVEkqMPyDUbNYmEGKzU\r\nRKhhreoRFblMG8B+CoZfA3HlY4pq+NMAPPBcKWUIHcKLHIkdnuAQ1kKPvgch\r\nztjwJ1ZJJfo9Cl1ZTeTM4aIbtxDX/YSKs7GlRjMpyg3r1L4Hl0d0yIzn/246\r\n8GYKpNdpKVZ/stFVru1UI2X29ixD3eYfRw5dgSthMSD07WoOpibAgUuyaMUk\r\n280Jm7MKqVXivI6C+Wcl4xdX/TPvDSnsPB65jXtmpJQiHU0QonoPen/eANmb\r\nzyW9HHtIrp+iD43COfoLM+h1ovkTv8YfOdGmpWi8dfJLn/Et3CU9qmErxD8o\r\nxMLrnkNncufdtoOqBxQ8unQ/dqpIx147zITWjvmDK6C0AgF4vSb87KTbv3NF\r\ntBRKGpUQZFeJdQ8a49bn4wq/82mSvN1z+yOohArp0HPeceIM7zr7D9mqwBfI\r\nV/NFJjyd8hU2fCtK6Ws9AxP7o3IUN/BykKFSfZJHTu/kAvL0kTkSrWSrA3cT\r\nhe74ckcC0r1hG6N5stCQxPo9Bo1PlkbYwAgj/KcpQeQM0xFq5ESJgTimGtN6\r\nkAPatNexq4sXTaVZ0dflwbNM28Ed/CVMfkQ=\r\n=tt08\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"fd6420b1b81c64578026927a4acf4ea73b7358e6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b1a6e3e88.0","@material/rtl":"15.0.0-canary.b1a6e3e88.0","@material/base":"15.0.0-canary.b1a6e3e88.0","@material/shape":"15.0.0-canary.b1a6e3e88.0","@material/theme":"15.0.0-canary.b1a6e3e88.0","@material/button":"15.0.0-canary.b1a6e3e88.0","@material/tokens":"15.0.0-canary.b1a6e3e88.0","@material/animation":"15.0.0-canary.b1a6e3e88.0","@material/elevation":"15.0.0-canary.b1a6e3e88.0","@material/typography":"15.0.0-canary.b1a6e3e88.0","@material/feature-targeting":"15.0.0-canary.b1a6e3e88.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b1a6e3e88.0_1665576213177_0.7070108427034076","host":"s3://npm-registry-packages"}},"15.0.0-canary.c9b1a31e4.0":{"name":"@material/tooltip","version":"15.0.0-canary.c9b1a31e4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c9b1a31e4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c778969153b0a384cf99059049dde30dcd25e0dc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c9b1a31e4.0.tgz","fileCount":36,"integrity":"sha512-KZNp/j7oXHsEe5xqmtuGAr19+oeMLEM1i7xIvys/tAtB6bDDVAGJzLGWZ22nbCuXwJqCRfNWtGIztO/crUT14w==","signatures":[{"sig":"MEQCIErhd6LoMbVCnccokheJ63XVGny+6AbI6TxBZkq4RlZ+AiAAxeIbhj54th7aw/4zUS8wLpg3LEvgZkpTkJW2bJpBRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRvKCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptQg//drm4i5TcxaDvzTOJZgkPNSak5U4iUXN/04nfOv4KQc+xxK4P\r\nDnhrW0mYO6oX5NG/vyrR5DF4I2z9Yo/DKlizhaPPguiWxtqjhcTS1oBXgJro\r\nvDXmxawMgSPvdDU1pwDOf51PMkg+6XbzLB1RKIDD584acXsiB10RL7LvObhp\r\n7VumHgGPehJLHRBg/kcIAoSk2JLP13Qeyqhc9GnelLqbDnAY4KNh0NASHr1W\r\nSpDoPg/LmQYUN8bGfhvodYDSZeb2P+4l+9qMyugWpOj3jev+DAjQNt9lZy2Z\r\nc7HvKTY80B3GCzaGV/6MXW27Plk8JOB5PWqnUv3j89teo5ox2xHcvKgeqgUz\r\ngm60lEta3WwZVnF10ipO0ifqIN2nifvxdXgxfi9PxG8UtT/beYWDAmxYNxZV\r\nUOB56Lfn8rtmqDVx+rwV/HXUP+ggBWPhjSqeJPAMCuhKNjV++j1GEFxWXkNA\r\n9yHVf9U4xt3JT1K8JyKntwFbEQXIr86S1rGvazJBsCUZBcCNxAqy+mSpOJcZ\r\ndeeitfRvEO3ptWnsma5/pDJNNv4pkf6PL2Q27l4Okx7PWSDB/7my1BfNSKMA\r\nMjBNvcqyljYgtxMC2ZHfAnHGc9MoU9zFbesvrXVMIpPTMizjqvBCjnRYkbIz\r\nwaojzWSHBCinMrJVatehJyv+JQ98tXcokMg=\r\n=tL8p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f7a6b71c85fbf0d1a9db952402e002f8421baf4b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.c9b1a31e4.0","@material/rtl":"15.0.0-canary.c9b1a31e4.0","@material/base":"15.0.0-canary.c9b1a31e4.0","@material/shape":"15.0.0-canary.c9b1a31e4.0","@material/theme":"15.0.0-canary.c9b1a31e4.0","@material/button":"15.0.0-canary.c9b1a31e4.0","@material/tokens":"15.0.0-canary.c9b1a31e4.0","@material/animation":"15.0.0-canary.c9b1a31e4.0","@material/elevation":"15.0.0-canary.c9b1a31e4.0","@material/typography":"15.0.0-canary.c9b1a31e4.0","@material/feature-targeting":"15.0.0-canary.c9b1a31e4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c9b1a31e4.0_1665593985938_0.8190546390515792","host":"s3://npm-registry-packages"}},"15.0.0-canary.13e9b0d1f.0":{"name":"@material/tooltip","version":"15.0.0-canary.13e9b0d1f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.13e9b0d1f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b7ec3d2c96f578c885e304c563bfd652ce4587dc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.13e9b0d1f.0.tgz","fileCount":36,"integrity":"sha512-DbNStxLTfs+ySMer3qiZmL74fyxYL63EfCROLl00MNVDA98LoG2yGSmwlGx0ccYw49q6IYVMFnWDtaMVilxc3A==","signatures":[{"sig":"MEYCIQCOtazmI95E26eELVP8a0oUfB6Hr32rVCEfX8dwdhF70QIhAJIfzFwNO43y/j9kNb4A+lUufsmoL99Va8ga0+kfupDj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRxPyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJ0A//Rxph8h2IpYX35z9/ivBJPab9ufHuP4nsWNanzKcKQrUbOjKP\r\nr383SNeCEyfX3x7CRikyV5cuZb4OrQF9yR9kx46LUmox3HDscE5x+V+eMijM\r\nANGnE0etdjFllvDWU3Cp4g2Vx4LVkIAp2BiMS5l7mMSDDKFczbNlGbBRCJ2d\r\njW1JBD1ip75WzHHvNkby7yCN6nvJgX2S3WLaePQlqFjl0nr7/NNIof5+gctt\r\nyi1sGnHw1dOQvLf6SpQ93b3bCOUW5IuY2lR1FrEVNGDlTwsoVS+8gmjENiEB\r\n1tHJoBPZNNpYpB7yf4rzMO/khX2M+E74A1eyeR5RNlvOVra6DGHgAQSfn3Y0\r\neiPSbYYlaCzBoI0DJhgLk5Kdpj9dyhBuXA8xlLWSiQ9/pXJNKVj7/3sFZPN+\r\norojmQDrq7OAeIPP7DziOk4dWhaGQaCKLNIAm5zFZTEmnZ37xE83NMTnojXR\r\nvDfm4XqC1JE6KIru0dvTjTr7G2FCqpzZnTtiS/IsTMxb8nK0ewRghRKiGQnI\r\n9Fsyc8tpsL/FcWmSdYL2ZU4UUDzWKE2ZeaX9caKluWf9caNY4i4mI5ilzYDI\r\nrbRFRnCaIG5mKBRa//ZW3sMszUG5JMYgG3wfomt6Pq/w9v0qXaJwJJHJ++jY\r\nNQhNz9tbPPlEuHvYJbCsB6OYKpAxzPcv2qg=\r\n=yLtv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4d9f6e4f27b68587a15ebef6f003f73cdad60bff","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.13e9b0d1f.0","@material/rtl":"15.0.0-canary.13e9b0d1f.0","@material/base":"15.0.0-canary.13e9b0d1f.0","@material/shape":"15.0.0-canary.13e9b0d1f.0","@material/theme":"15.0.0-canary.13e9b0d1f.0","@material/button":"15.0.0-canary.13e9b0d1f.0","@material/tokens":"15.0.0-canary.13e9b0d1f.0","@material/animation":"15.0.0-canary.13e9b0d1f.0","@material/elevation":"15.0.0-canary.13e9b0d1f.0","@material/typography":"15.0.0-canary.13e9b0d1f.0","@material/feature-targeting":"15.0.0-canary.13e9b0d1f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.13e9b0d1f.0_1665602546044_0.5537871064910374","host":"s3://npm-registry-packages"}},"15.0.0-canary.1dc797e7f.0":{"name":"@material/tooltip","version":"15.0.0-canary.1dc797e7f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1dc797e7f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ad4cfc25fcfc738a3673efdb9f4f33ef9e8979e6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1dc797e7f.0.tgz","fileCount":36,"integrity":"sha512-7XouEZwFfjSmu9Rr3p4bi3ETCGrmtFAx2980KCPxXAoB4F6VtvSzLTHGLfpmwNxXVAEPXZMYXNCrjwBjMnMBIQ==","signatures":[{"sig":"MEYCIQDVQlcbpjtczNd1qRaQUEKE3QZUUYC7hPOxP0+Ga+epiAIhAJhRgOP6kjyelI7ijTUNL7yzV0ND5s4kYU/h6dQNTHk2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSS8gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpwkw/+PB/wblbx0UfNIkWTzSNnCLaYRqjBgWjdz+1wC+YJOnmwA14N\r\nB5z0FiGmh2NU+XlWOASdoJbXbEAczaCEfvdsItjG9iFxZ9/FVeRVtMZbSaFW\r\nNO4RTK2PJ2t1v6re+k3D+fXQwuj96W5mFza199fL/q/pD/Qbl2xNhienE1UW\r\n97ZVlqviseYdz3OUsSNi2jpjGrZDwmTifPtVjiRBBfzCsNW6dcx2F6Wy0xST\r\nShQ+tHvd4+Y4W7k6IOWnH7Ob3MWli1ti7IWNNixmGd/UiMY/2FszevwVsbV1\r\n27VBbWIz7VON5kGNKVpX6sakkX5FofeJHA13ZUXJPviWJGBqFOpppfPHaNtf\r\nahzG4bG2Gt2disdPM3KwAh2N7KonHSn17pm8okcH0HKWM1SCUEtRVy5HEw5k\r\nksmJCHwugA0LGxYfP47MvsGtyQMeDMxY78206ftdoqckE5vTAEBXGYd5q32M\r\neLpZT7JJclaw2ybo8RK5lCEsk9L/IW196zGLoS1CMcLb3CK2125ZDFKQccKV\r\nYnjDuY6o/SGZO76KESzRSW9Vtx7TANTF0uk0MzLs1wRJoY2ImyJg28qPtWzO\r\nZyQ1bYrOL9QL3NkUYPqXV+LBYiYSgOc4gp6VMI4/xF9FXjxCeU9ozs49cfJR\r\nxUtfrLXHRSHH/pNrTRjsE69HtUWKdqrUATQ=\r\n=pODy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"22eb0904d0b7a84996854bc57cc417286deb08b1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1dc797e7f.0","@material/rtl":"15.0.0-canary.1dc797e7f.0","@material/base":"15.0.0-canary.1dc797e7f.0","@material/shape":"15.0.0-canary.1dc797e7f.0","@material/theme":"15.0.0-canary.1dc797e7f.0","@material/button":"15.0.0-canary.1dc797e7f.0","@material/tokens":"15.0.0-canary.1dc797e7f.0","@material/animation":"15.0.0-canary.1dc797e7f.0","@material/elevation":"15.0.0-canary.1dc797e7f.0","@material/typography":"15.0.0-canary.1dc797e7f.0","@material/feature-targeting":"15.0.0-canary.1dc797e7f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1dc797e7f.0_1665740576701_0.15098232919007581","host":"s3://npm-registry-packages"}},"15.0.0-canary.ed4009397.0":{"name":"@material/tooltip","version":"15.0.0-canary.ed4009397.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ed4009397.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36ed5559e4a4bd124f71bc06e0b88e0e41ed1b25","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ed4009397.0.tgz","fileCount":36,"integrity":"sha512-qE585w/jhWnRugte7xbKjQcm44X9DStm/SmcspJGhaT6eG+UIOTfrgxPfjLRjAH9V8fb/kZGml99QIY3uRKsLw==","signatures":[{"sig":"MEUCIAkKzhkDQmV0FojKmJ4mJFwpipR3zLgOlEHLPyolraRgAiEAqUgi8OO5R7i8T1OT5QIvh3eilA+wB7kPa0uK0r5PxXg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSZPIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpk6Q//ZT8NzgVN/d17GSi0TYlp9CofI6hBi57vKtD7lTqW/vk0tARx\r\nP8uHBWWx63/bs9e/Ak8tPFs2IjIFOCKR1pKvvRdFW+zCz9KwVLpQ1PIoxbI3\r\nvwq5zgpleM6BWs1ZRQGZOxl9hAP6PhrcvxU5Ac6qRHONhU2n1vO7/9CjiRQ1\r\n7yiA3jJ+ZRICieJXkZhnf/YGwAyhmEftgTw5CYIO7Ezs2dNVObgT2EU+a+P9\r\nyxdEzxzJvroBedxGrL4ohX7UO0f02u493XCXFvERZsEc5Ziicf1EYQC3o2br\r\nkAXRQ0WkVX3bx4jsmuZmAkKsHrmd7JMiNwbXayNBe9t83IYyKHk8BmY8Ti8t\r\nu0L/bOvZouDUKillhVTD3o7JQThKwR3lBo1dtNze3bT2UhLqDNw1x7beitiy\r\nsXavKdDBkWAz1qxGA7cqFxexs8dZB7uKTzqAzvVlLMeA+expsIk9bcJtjPrq\r\nzf/5OtYhamx5N7CoWBw5BurZff++VboRoo8OQ2BlSyBymhPaSN56k+jFkyKF\r\n+swTj63FMJrh9r9Du2v6CzW+g8XEuHrXYMRsMsAKI4KemSlOCCz5zFUOFj4E\r\nctyQ22zDpzBcuzNgIs85fYW2Kar0TqAyBInCKIMiJt03aCxt6GzmsC7WT19+\r\npJveUOuM4fbOjfuu1eeWb8vB5+dB4cSF4OA=\r\n=sXeV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a749634198bd160446873ac2c5cf3d4345b1620f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ed4009397.0","@material/rtl":"15.0.0-canary.ed4009397.0","@material/base":"15.0.0-canary.ed4009397.0","@material/shape":"15.0.0-canary.ed4009397.0","@material/theme":"15.0.0-canary.ed4009397.0","@material/button":"15.0.0-canary.ed4009397.0","@material/tokens":"15.0.0-canary.ed4009397.0","@material/animation":"15.0.0-canary.ed4009397.0","@material/elevation":"15.0.0-canary.ed4009397.0","@material/typography":"15.0.0-canary.ed4009397.0","@material/feature-targeting":"15.0.0-canary.ed4009397.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ed4009397.0_1665766343806_0.03819952897655643","host":"s3://npm-registry-packages"}},"15.0.0-canary.95ef196bc.0":{"name":"@material/tooltip","version":"15.0.0-canary.95ef196bc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.95ef196bc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02c1fb1c65964792623626ac9547527c863bfc70","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.95ef196bc.0.tgz","fileCount":36,"integrity":"sha512-De4n92mS3XyJPB/L+2ndwia717NU+X4YRNzlsl1S3hCHLYnCz4wlTgDsTRaFzA8Iwg/pvIiX+Hfh2pmT/Mlbrw==","signatures":[{"sig":"MEUCIQCH5Sn5IVTE8vsh1KesWSKoZctNPnBFpz9etuCGrxJeaAIgV4wcC6jb6lZdZr2krkkBSMgjbf7B6kNPTEK0I0xWAKQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSe17ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAwhAAhuTXayzbIaI+81111R8GiDPET8LrwGPrcHJaqE1+ei95O8d2\r\nlzB5iI7ZmtJSt1OUWXFm02+IvN0pnH4TzCRIynij/Oz+oT5uXvQYjlxpnGlX\r\nS/bYk1scJbSfyJXdcGKs5tpfsuCcE2yYo57cJOc26HDShTCUleYGiFXOl6ag\r\nvmgp++a1sfMYJOmupxeIoLWbqf/S+zwlOl3EaHJvkpalz2D86YmY/ep26GJ3\r\nSTyJAsFtEu1413sfEAIWyaQtRDKQ0TmLFtHKSrvlCFNlrg0MCDwBF+KPor40\r\nQw+Ie2w60d9Lvdxo9hI92RjNckTgWaLEZ3FQCcYxEOXSP62ZenW5of8kLYRK\r\nF1ewwSxkMCYPcUsT/T1aO7KpJ0qweMGTZtPaunZJq4S4WsqKit0PmUFVTcAU\r\nca6prGzLGvh8NJrLkCXDF3m2FiXbCw2WIrpCOIZHGY4Xs7YMqvD02x94FGtz\r\nV6Hp2cGv5wOc9WEusKOWSnyuQfizXPTxzO2BPXPuGrOIUj37TGi+qaPTyUV+\r\nMukSZQLcpzOOjl73fpP6wll5VUSvfPDxSALfEgAmQoZJdL2xSiN8/pjj6Rw0\r\nDBvAYl9ZSg27ui0HOZrDcgZ34ybC7y4puCRlmdpi6UXEgjXuiqY2ePvZ+aHl\r\nir6VJztTUH5SIr+WAnR63ACfgXQ/Zqj8AuU=\r\n=qFod\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c133997c8c45e50d9ebfe12fabab75ec90d244e7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.95ef196bc.0","@material/rtl":"15.0.0-canary.95ef196bc.0","@material/base":"15.0.0-canary.95ef196bc.0","@material/shape":"15.0.0-canary.95ef196bc.0","@material/theme":"15.0.0-canary.95ef196bc.0","@material/button":"15.0.0-canary.95ef196bc.0","@material/tokens":"15.0.0-canary.95ef196bc.0","@material/animation":"15.0.0-canary.95ef196bc.0","@material/elevation":"15.0.0-canary.95ef196bc.0","@material/typography":"15.0.0-canary.95ef196bc.0","@material/feature-targeting":"15.0.0-canary.95ef196bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.95ef196bc.0_1665789307039_0.010835485421236912","host":"s3://npm-registry-packages"}},"15.0.0-canary.13eea1b2d.0":{"name":"@material/tooltip","version":"15.0.0-canary.13eea1b2d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.13eea1b2d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d88d85c4a74a5ded127e8eeac092448dd8c0a198","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.13eea1b2d.0.tgz","fileCount":36,"integrity":"sha512-yYsRr8xlGNdSyP8U8wSXHXG6vKdwApB4H8hwdvZYYr5lRJwvZCQ+AwB4Fa7N0slMajK6kMLA1DF57jHHbbpQ0g==","signatures":[{"sig":"MEQCIFRSDLSibuiiCzj9+XIgW6k0K+CzZqdUyDSl+AfuMpDVAiBimG8eDPVN1z+85y/Icg+oHP0hZ1kJT+wKM4Nkqr2u0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTNGLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7tQ/9HbAZto6YOMDMAu0OTGMOWbYO46zzS3NtxYk6MHKA55KbJhQT\r\nnxzXoStWM6yzpNZIxDn0HiltNct+v8S7py7n1tQK83cbs6eMuRrH43JT0MoC\r\nAgIkkceoepIELK8NXPIzC3/YqpINAwv+UXPgfpDmShWi1LS9xiI21ymSUvYA\r\nPOtg9Aj50p0KYWnl1lhXmvYzzb28luSvxSucbk0rt0H/kAXpF6Je4/6aIPHP\r\ndC4YXnkcgoxMlbSQ7qneyPYUF0+/eR4C2iIFhLBDo6NaaBKy31kYSpZ4R1iY\r\n9nTLbz3oa1aygqsx9ZnG1ZO6uUg10jzb+zLih+Nuv7VVOsKLlPkq63QSzq95\r\nXC20aE0qNYRPBWEiyqIemR0YI0tlrJHDd3axIM5URabHi8o3zg0y4kSafUIp\r\nJMBdGyCkVr1wIzoaS/fnxDfrXT/R+qH/H4IjJBFkLEnuvVN5uH4UwVsnj9Vu\r\nhf8DSLYGnF8BiPVajZuPg7H17J1fT+1hnxqvVs/3CwURuuAzDtd0HsjsoUyO\r\n8TjHrJhLaHsroZuq7QKlJffcMvlpsxZ02am5Iu22n5Q/6JkK3lgmqkNNAtIl\r\nGLDPOy0iCMkx/yqZstjFOrMFZ595sKolFh2q9x9wyxJIljuOy6t6Phipbje6\r\njUrwwtrJqmInluDR1ov49PmGvXGLptTjo1s=\r\n=BbUE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e9a13860e495e7f113966b4c71b9c7931a32807c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.13eea1b2d.0","@material/rtl":"15.0.0-canary.13eea1b2d.0","@material/base":"15.0.0-canary.13eea1b2d.0","@material/shape":"15.0.0-canary.13eea1b2d.0","@material/theme":"15.0.0-canary.13eea1b2d.0","@material/button":"15.0.0-canary.13eea1b2d.0","@material/tokens":"15.0.0-canary.13eea1b2d.0","@material/animation":"15.0.0-canary.13eea1b2d.0","@material/elevation":"15.0.0-canary.13eea1b2d.0","@material/typography":"15.0.0-canary.13eea1b2d.0","@material/feature-targeting":"15.0.0-canary.13eea1b2d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.13eea1b2d.0_1665978763478_0.7193411403830716","host":"s3://npm-registry-packages"}},"15.0.0-canary.ef9b2babb.0":{"name":"@material/tooltip","version":"15.0.0-canary.ef9b2babb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ef9b2babb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"68c776d773e153cb979a435f6ba0477e95b5778b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ef9b2babb.0.tgz","fileCount":36,"integrity":"sha512-r+6tR2IGZVOCwMxxIs2eUffnQl4rh038WQyDNLFnFNVLCotHO225g9/hJFf+Z6iqQcOTKKy4S0aEOxqjeeRidA==","signatures":[{"sig":"MEQCIHc/KV065mZ8owG0e9IBbyLKfnirqYYgCI5dJFA5L0EmAiBZZ91aQIHXoXfYQ5hx4YMVTRqIIEX5iuLWlDr+cFxLUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTR4XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrORA//SIRUKcwEvIUNrNqn/DasCxw9m+ldmQKUD4EwxM96Nn9C88IJ\r\nPyNfB8UDOc7cr6lK4fYEnALk7kisVXrbqr05puFPIGe5f9xnmetC3lhFhJmL\r\n6BmdC8inzSIPThhUMYEBMeeB85338B/4tLnlDr/0BzublitSFHzUv2nnPd0B\r\nuBxIj1yi9ZSpkJqpR3R6v1Qj/KQ7Jun03QsMgoSlhENxGah/HwU0RWVBWF5d\r\nZcr45jNXqWQqdMzUheTkNn5+zgJT2t0ol3oKHE8LcXw0dwihz3d2denG3yUC\r\nQZTiDmAObpyTxI6X7bELZEwuAwDwfQerZkskXHXQ6hF631WE2aK0RDalJ71O\r\nsdHOdd2GSGoZB5H68VggQnOAqSruGALT0gQNaNXFeMj1j1xnI8Iv+pDbqA8U\r\nv/b7opXlrjqryWP6/YvNsinO330iKtx7vCFFPxsdP5LzLOaUSO0SOQ8NzGGw\r\nImIVqSscyha1fMRUFRNsjJuJp5tKBW6p+CwNzBINp8OjVEGd5oRLH16WFXOI\r\nIX1Bd6UwpOJVICyVN6ffpoK8rusDtgRbdwQunx8rc5bn+bCZbBmruyTVPydw\r\nZMMMZDv65thLYGz3ZHA8ODzT0W6/iXpLCoLP7uBSrAyIXlj2OG1M4QFoP4Ly\r\n3uuEgpMelHUHTx1e497ZcdLJT8iiyy9xNvA=\r\n=1tCl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2e04dcc89ca80bfb50d7ee1e4172ff9713c149ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ef9b2babb.0","@material/rtl":"15.0.0-canary.ef9b2babb.0","@material/base":"15.0.0-canary.ef9b2babb.0","@material/shape":"15.0.0-canary.ef9b2babb.0","@material/theme":"15.0.0-canary.ef9b2babb.0","@material/button":"15.0.0-canary.ef9b2babb.0","@material/tokens":"15.0.0-canary.ef9b2babb.0","@material/animation":"15.0.0-canary.ef9b2babb.0","@material/elevation":"15.0.0-canary.ef9b2babb.0","@material/typography":"15.0.0-canary.ef9b2babb.0","@material/feature-targeting":"15.0.0-canary.ef9b2babb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ef9b2babb.0_1665998359458_0.484067906673888","host":"s3://npm-registry-packages"}},"15.0.0-canary.cec7fb987.0":{"name":"@material/tooltip","version":"15.0.0-canary.cec7fb987.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.cec7fb987.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce1447c443bfeaee7f4d25e6fd3704340faed4c2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.cec7fb987.0.tgz","fileCount":36,"integrity":"sha512-fSFsTZiwM79oxilkmOX9W5fy8z3Prf1KfeU3aSh1kDLU1CqktTuPk+i02y7HkSu/JZvP3l5LHLfKevREd5zYbA==","signatures":[{"sig":"MEUCIAViY8utMmLuaAUTzz9nPw6s2jyO067GHJ9Zo962t3+NAiEAvIBYCJ7baGZgRYB+APjKHSg+TGfNJnwD7x6uj6jhoV8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTTUYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCPg//aiXj34Sa65UJJm/gv7XecT2TfzuynrwyFTs8D/r3ZN/OdxMU\r\nFzNHFAk5WL6+s1BuThukVnlj/XwipDtLES5GTm1f01EnezbGjwOBpgArsvhc\r\nHoc5lThmofL67kEgKIhU94YIGS/4SncSfAIZg2tnUwVXIeTGHv/L7qLlwyRe\r\nMa5u5aDfAHbzUvPIjqqfoz0/tI+gP52YnaSQYDQNUPniuc6vo13GZM/vjB85\r\nHe85KRF0xuKckuM2XkfH4Z258toXlYZMDt8RtSXdPzEM4XgPx+kcEYS588vP\r\nbMt3Ilfctwb2sUH+B5/yZhnL8ZvRYhvR6YPSJkgx7pSm4AcOZYas20Z7ussm\r\nP3qZJOZ/m0Bn6zcXABxzvco/ZwUP88WZeNK/tRWvGJGc8GzZE2OD4Zjj8V3u\r\nwYbps58KGuUy3oZsQjKIWmsg4VpEhY+9Wer1HxSIdJfRYe5+h0abNHUxZj1r\r\nIRRSlk8ayUB3NjE6kzmczBgkiWCFsGcHI79hIPJ60atl7OaBCOiP66hKrkZe\r\nCvLNpU+1Tdyd9hU2i5ZXeffhTmE851RVbcE7O875rn4TS/caNXmST9DeHthn\r\n/LByNMIdWbE2up6aSlPPPi9VTG+xWVymPjYW3vt0IbDroYarJ0924QQzDgIb\r\nuaxienU8lwy7EKdXW9FOaGdnJoY4urf7uOc=\r\n=mBDZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5af4beeec511ff0266173424b4b179e209402a5d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.cec7fb987.0","@material/rtl":"15.0.0-canary.cec7fb987.0","@material/base":"15.0.0-canary.cec7fb987.0","@material/shape":"15.0.0-canary.cec7fb987.0","@material/theme":"15.0.0-canary.cec7fb987.0","@material/button":"15.0.0-canary.cec7fb987.0","@material/tokens":"15.0.0-canary.cec7fb987.0","@material/animation":"15.0.0-canary.cec7fb987.0","@material/elevation":"15.0.0-canary.cec7fb987.0","@material/typography":"15.0.0-canary.cec7fb987.0","@material/feature-targeting":"15.0.0-canary.cec7fb987.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.cec7fb987.0_1666004248635_0.16544885916467278","host":"s3://npm-registry-packages"}},"15.0.0-canary.4fff58b08.0":{"name":"@material/tooltip","version":"15.0.0-canary.4fff58b08.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4fff58b08.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"194945be400982699a775f025597df71678a8a59","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4fff58b08.0.tgz","fileCount":36,"integrity":"sha512-H6/2T/or6eXpag/VSQpJLNKqXbBZx+VtQEh/GErzdmbjQYzES82enXB/SFJqaFLHEsMcgeJkV6kQDMt6evCz8A==","signatures":[{"sig":"MEUCIB5sg2RkAGZT4ZLq8YLrqW717XFRGkcM9fwSWB78m8iAAiEAr6hWmBwe3PQJxp0txgmAXH2qYBIMwsSTq4BQXrjBuqk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTXOFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUjBAAkKI31rNzaowhKYS0tgvFtLd2WFBDfrE5lg/nLZT1dOJks71g\r\nqlHijwudRXOM14vt5W4paZiZg45F3Wm10ZojNhAf0TEUq+bWcuML12RtrnFJ\r\n748tpECl7R0aDNYisefGtdoCbvI9RZYs5KhVdjXa0dWKyrjJ0rro9OZ7ucaA\r\nBZP/Eig/Ry31c/En1LmVQFn9Efo81UdCyZBr5kU3J7gEjS4f6PKr7xOmlCTq\r\nFpOdA6EdATSpnFg+2Sc/9lOXpnBsN4EGxE3Am+VtGCWa1/cb6LCoDULpIODw\r\n4EAOimPd6TLFKfxZEiLPAX5/9ahPshtRw1btH1b/gUAXZkz7wnzxA/ZSk6ut\r\nkqJVFdKsd0dVis25vBO855TodUch4Ih0FHvQeubrRRQHow3/hbr3zGTbRO6f\r\nZUroVv4xGZefe8qG/M5bTEuTYtypsXj1utR4iZbIZLE8QZ2ZMdloxxLbMXj/\r\nHorCYddmvkG1LoCo2tlIPTChiJg14RGPXUaAPP8R0Ea0/tQN2TYaiXL1OYvo\r\ntQP4xTXbTrSKRv/8cPjrHnCUNN8WnteulYT6c9k+2bARoUcLP2e+WmipD83c\r\nt+mjw1oBF3Pt0+/fiyhXq9W5opKeo5q2N7s2zi2OxIRvrOncpUSqg6gwZE8Z\r\nkxpm9enzsggY/ygj5pbr1RC3E+NVMKbwUac=\r\n=GXSU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b44726c7f5a5db16ef660807b5247cd71a447c80","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.4fff58b08.0","@material/rtl":"15.0.0-canary.4fff58b08.0","@material/base":"15.0.0-canary.4fff58b08.0","@material/shape":"15.0.0-canary.4fff58b08.0","@material/theme":"15.0.0-canary.4fff58b08.0","@material/button":"15.0.0-canary.4fff58b08.0","@material/tokens":"15.0.0-canary.4fff58b08.0","@material/animation":"15.0.0-canary.4fff58b08.0","@material/elevation":"15.0.0-canary.4fff58b08.0","@material/typography":"15.0.0-canary.4fff58b08.0","@material/feature-targeting":"15.0.0-canary.4fff58b08.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4fff58b08.0_1666020229721_0.06969786698431935","host":"s3://npm-registry-packages"}},"15.0.0-canary.587d8f871.0":{"name":"@material/tooltip","version":"15.0.0-canary.587d8f871.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.587d8f871.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"79e22ce7a36a64606e4106d913298189ecf52abf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.587d8f871.0.tgz","fileCount":36,"integrity":"sha512-9HU8uaTM2O8tGnczErfu1B0lnmHloJMCnlZ595n1Z5vH2QPVl5Y0Zv939cnOCsQ3PMYa5jnnMmQ82AZVRlUS6A==","signatures":[{"sig":"MEQCIBb6HT9joTitKb6LrMUPibXzivcWdfOzi6EcxwXMe7x9AiBgRdjbVClTK1rTr3v9TcZZgJ5PkvGNU5SNV7tyAQYEuw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTXuVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAEhAAiSjs4ELTSXPulCQUuIP5oJTg5rS3Yqokj7edKMXY3aFI8tv7\r\nWAEwRopSJEF7A0VHUQw1a+AZV/tfr2t0mV0senXVhrtEVlEixJ6HFea/Galw\r\njPuDVeXepbryLUcg4IKXDMrUniuXbIJ48S6fehvYnRVE0xBClN+VifTOAbBW\r\n7XVysbwXR2scK0OHDierL+s4UQNr6ZdFRaLTZZkwg9CHK2sZDm8nk8QYBXPo\r\n+4xlOtn9Bv6cXveKdj6IUi/MO9fu0YqXRcpYrgqcqEhgissZix7iDS1u6yKU\r\nv2MG7QAxxd3hDkN5N1TypVFKKNAsdUzxR19e5Ami1LmDJ4ZdIfNDeYBNSmyz\r\nkftS9zKR9wdK0U8p0pQiFcNItp3e2C+r+QqeUwDLtM4EerDsh0MYe1RNNV2/\r\n3RZlQpIveqHyXUvP1g7VmPgJxCOFMTM5WGTp0qygZAzuBOgVFtdaBYiqGBtX\r\n9ry8D4Hjpj4Wfq095vq2cIGoHGoXQ3dO8Lf+6h/lybxKYW9a6jP9FY5I+Wth\r\nhmTFUaMyl85EH+CszTGCcNShAV/XW2jmYhVZTzpYGjs3yaV3WUy6Aoyc8JhR\r\n7jVYDB1kAj8FKKuPFzKkqmwTEAxGVdHcz8beXelNfpxyLzI3WJeGM5xLd74c\r\nnZrua83MYaHXVyjObl+rsE3PPAocBAxKdCQ=\r\n=vhdX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2ec38be871dc355461961e4ac44d48ec44c42a1a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.587d8f871.0","@material/rtl":"15.0.0-canary.587d8f871.0","@material/base":"15.0.0-canary.587d8f871.0","@material/shape":"15.0.0-canary.587d8f871.0","@material/theme":"15.0.0-canary.587d8f871.0","@material/button":"15.0.0-canary.587d8f871.0","@material/tokens":"15.0.0-canary.587d8f871.0","@material/animation":"15.0.0-canary.587d8f871.0","@material/elevation":"15.0.0-canary.587d8f871.0","@material/typography":"15.0.0-canary.587d8f871.0","@material/feature-targeting":"15.0.0-canary.587d8f871.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.587d8f871.0_1666022293354_0.5279127686718341","host":"s3://npm-registry-packages"}},"15.0.0-canary.edf4b98d0.0":{"name":"@material/tooltip","version":"15.0.0-canary.edf4b98d0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.edf4b98d0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d65bac36d686948c221172a9a60e2a0fe0bca63f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.edf4b98d0.0.tgz","fileCount":36,"integrity":"sha512-AFoBxBoy8+wk9Z9nZoGTHJyw21OyWQCapfXtuvSCX2cfopLCIPDPO77E04mETrFz/rumx8v+EZpETJiH2Ys65w==","signatures":[{"sig":"MEQCID+nv8AKopX6rIhw1tcb0VR7svYSgZB30JYXYj3oEcTAAiA2a2NIxJ1QuNQjPsF+MBt9KD0ioG/O+R55/FMDEui/Pg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTYXAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxxQ/9GXgOVbzb55AQ4VQm2Ng+h+vMeiGqSZzErB1GwwAQApxSonIQ\r\nct6xwSvgFnFZx05VHvUZ8V0crugStCYeJIvg8ls3pmIONsY4K+m+tQi6VzWb\r\ngsixVQ5gYnBY8G0flClOiQWltuqEDxLGjB7FXjd28rTWDg0DrgYpI5r0eOyW\r\nJCHc8PhhUHTvoNkNhfVYii+PTHzU3RD1qvosvZ7h63DkKmy3gePpIiRCTRwN\r\n/umDYnoc8IoZE+h0EQip6CQIuBhO/kgL50DIKteNn4cf9NmPkUzXrVgnbbcv\r\no0a6Hu0ET9KCMpmHa2fix/f/4tJwCtT5G7PsBLjFIk+ceHvB6OOqnho4qgIb\r\nOhPqtKcCTXu+qomIEWhRAbfAS+a0/iO8//ClBy5PJKwDidTeY7b9avAuWIqh\r\nwf20uEsYwQkTnUsdx6spC8aNYHikQBe+6gyk+gbTr9gxO1PN6kPqOAfGE9sI\r\nR0V1ru7b16f/8IhIc+kVBc8LSd9mb+wwfYI2RbiKuoaN+o4cuu1R9J73Ag1U\r\nIAO1RS/rADLRFfTvvqKr91gkygYxsSPPh0Y8kzrcapJCibs78Tc+GlRFGByV\r\ny0Py83+GgOVMOxoLDR+5NvEbH28j9LWPJSYslYVdPU2RDD91hchVRr3Kwiu5\r\nvSciqrc+bSCqLHPIQrNLUWyH2bu5scg7vUY=\r\n=4N5y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ad4766965d2bd24e69b2e2e6940c960907c93c1f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.edf4b98d0.0","@material/rtl":"15.0.0-canary.edf4b98d0.0","@material/base":"15.0.0-canary.edf4b98d0.0","@material/shape":"15.0.0-canary.edf4b98d0.0","@material/theme":"15.0.0-canary.edf4b98d0.0","@material/button":"15.0.0-canary.edf4b98d0.0","@material/tokens":"15.0.0-canary.edf4b98d0.0","@material/animation":"15.0.0-canary.edf4b98d0.0","@material/elevation":"15.0.0-canary.edf4b98d0.0","@material/typography":"15.0.0-canary.edf4b98d0.0","@material/feature-targeting":"15.0.0-canary.edf4b98d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.edf4b98d0.0_1666024896099_0.7727845107728766","host":"s3://npm-registry-packages"}},"15.0.0-canary.024ac5f16.0":{"name":"@material/tooltip","version":"15.0.0-canary.024ac5f16.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.024ac5f16.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a937bac3cacdc3e700a6522cceb422fb223993a6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.024ac5f16.0.tgz","fileCount":36,"integrity":"sha512-9wA1SN+2E07Hh5c92qPI5AGMD55ppP+CWC1/3Tmm0O7dXL6O2xraqiRYvStafVpnBEDLILC4xWqOHvqSvmkwVg==","signatures":[{"sig":"MEUCIQCe+W5jGxb3CZxm9B36UYlajldcILFYG5olBY809CXuRAIgGQzYzso+zdAaDOaguR9FS9r/ToM7pdm5g6yNI44g1R0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTdqSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq20Q/+KmbFauC+hhNX9KMToQ6VhqtoxrtRWsUZsDLnZha9+npiR5SN\r\n9MaZq60Iu3dG0SC1j3LmGdpL7hP0abRXsLoXg8fwH+QEOzRejYsUSe5lYmRE\r\n/zspjsBN3Jb2ya8fJwnAYlBtomnYA/3KZmL7Cae3o741VezZA3NwT8L+5S3S\r\nINLsm/0augVg2cOfH/bAGiPk4x52RdRI6X9qzcytQZBcWKRX2uzQZla6dSLY\r\nD0mn32YE0mjioo/NmeV/r1Rtos13UB7qcfcjZRXM8RXmU8o1Pz26vwg4n6i1\r\nBEaRCsXCYWzuIuqKdmkHweIXoCeHq37JFMErkBh4b5taRWxpo1HJbvZ4IUwp\r\nVBublF0gPv9auctYNfPznggX71YlQgtw5xDO4kYSUJnyIo+hoqfOfkVxbWJ6\r\ncAmwM8e29wv5jtXdpLrnQJYN7cj3FvYtqSTdlL+JzSnPz9W0415D9f22zEZC\r\njXzADrlcGtpurFCEh0T13gT+yx2hRdo98syfjxsni3hu9oBnnffmMA8Bxkdt\r\nusZlv+DquA5UOB0K45aC9zaRKDFRQJJhmdckI5PDrgbFeulvY+9wttyHtHkL\r\njR0f694/QpxjmbBlqlpdULXYC+avsVYoG5Rh1t22YwZBnbZIbcXbbu6+1B7c\r\neOemzNksyB2Qy/C1KjtAGAqVYCeQLkTKztg=\r\n=Hb9Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9ad8e77cff1167055c10b93b4082fd5b4e1d8643","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.024ac5f16.0","@material/rtl":"15.0.0-canary.024ac5f16.0","@material/base":"15.0.0-canary.024ac5f16.0","@material/shape":"15.0.0-canary.024ac5f16.0","@material/theme":"15.0.0-canary.024ac5f16.0","@material/button":"15.0.0-canary.024ac5f16.0","@material/tokens":"15.0.0-canary.024ac5f16.0","@material/animation":"15.0.0-canary.024ac5f16.0","@material/elevation":"15.0.0-canary.024ac5f16.0","@material/typography":"15.0.0-canary.024ac5f16.0","@material/feature-targeting":"15.0.0-canary.024ac5f16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.024ac5f16.0_1666046610467_0.2439158261741079","host":"s3://npm-registry-packages"}},"15.0.0-canary.c8bdf6144.0":{"name":"@material/tooltip","version":"15.0.0-canary.c8bdf6144.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c8bdf6144.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"859cbfa062e828daa2d71393a4a38b1224eb2471","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c8bdf6144.0.tgz","fileCount":36,"integrity":"sha512-dY1WPqwQg3cSjN5J+RWxx1T4cWRZ68k56CcznNfoHsWzP0uvkQAEXDXHDlDW5K2grLI+PrQrgVbwJgoujg6SMA==","signatures":[{"sig":"MEUCIQDXyHGvk9gG8eVqnFzVCThJV4L4dL1hEmtr8NKBqGYXRgIgKXhI29KLFSYwQLt3Z9LLDFWEA5voE/Ru0V0UxJfbyuY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTu9hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTXQ/+JezCqGejoqyEegKE5WKXzQzFURsd9gVkZk+6vGW1WbqSHNb9\r\n2Wo+55JaRqJnefFUN60vuex2jNHkOXNFnWStbts+4q+dBQ12+o3haETK2ZjD\r\ns+sjvbaO2x2I3xm9/pP0UmEQTO0PzSCX+SATJYTut2B1MLgMgNO6k5Y5/d2h\r\n4AEYPo6ecrQQaDIAr+DE0kgfmkgO1/2Vcskn0VvljMro+nZNSEhTC0WZIfXx\r\nKar9MrHlfaXMroBZ75PGhJaiEtD/QrbQqqLMyMMZAxDDmb87ZbRaxjwuqNEh\r\nnAlCGlrJ2PLEsovnrYLah2/XA2r51/n761EqLaHgRw4a8fm/RZBg6nz1TF+i\r\nq2CRNyaO1EMQMwG0mQuFHIPwcB6Rc2BD7ERKbvTXJS4i6hOmO1daGdjTgUcw\r\nQu/nr+OSv8QvB5mYWsj/As0Pe9Fcc8nMAHtyKswIVzEnrEhzW6AhuWpZo5xV\r\npol+CM79LjJd+/igKf/9+VDSn9PR11m/9R+B3Kx59gH99Mhuj57N26djSjfz\r\nxbVdVGPZcGoqQ35qBXNilcpPhM/JGlsoXgLomxoJF6lnRo++5NYT216N5g5j\r\nxUTGWaiR/7ZLG49Yb1FIbiuky+kvjracbHMvv2EHpms2SVr0PMdJeb0P9SI+\r\ndsr5EnAT9mSkQYjt2Vgghe4rFydjBvNkE84=\r\n=onBK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"92f4fcf51598cb8f9b9e03a35332a980296c24e2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.c8bdf6144.0","@material/rtl":"15.0.0-canary.c8bdf6144.0","@material/base":"15.0.0-canary.c8bdf6144.0","@material/shape":"15.0.0-canary.c8bdf6144.0","@material/theme":"15.0.0-canary.c8bdf6144.0","@material/button":"15.0.0-canary.c8bdf6144.0","@material/tokens":"15.0.0-canary.c8bdf6144.0","@material/animation":"15.0.0-canary.c8bdf6144.0","@material/elevation":"15.0.0-canary.c8bdf6144.0","@material/typography":"15.0.0-canary.c8bdf6144.0","@material/feature-targeting":"15.0.0-canary.c8bdf6144.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c8bdf6144.0_1666117473584_0.5022500722288121","host":"s3://npm-registry-packages"}},"15.0.0-canary.bacda4885.0":{"name":"@material/tooltip","version":"15.0.0-canary.bacda4885.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.bacda4885.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00a9f1097fe369f22e76fddea2bcbd150303066a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.bacda4885.0.tgz","fileCount":36,"integrity":"sha512-PnXlGIXgpJ90WlT09cNnbZD2HqBnJIOW2XxeMrtdxJNiOOiLAx35Z8o5xW79oUWydEDeebPbMFmHcqSUqvPDrw==","signatures":[{"sig":"MEYCIQDc91wPrRBfoRvvHAVkNgqZtXNrx5ledvktdC4oyh3GDAIhALOHiR8ix1EIR4eiw29fugFAEbr3HlmMvS+0A5gpvOYa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTvPtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpOaQ//cs2V+l86Tmh9JQXSrRxSDXfm7MlB9BuUKXIKYJuKw6oP4i44\r\ndeSa0SljrZV000FZmNp3qxbpgK5IctIYpV+1w//e8lB3aJ/CjGVjQiHEUj3D\r\nFrY3Czuadrqx9WS/fEz/74AQTG7GJKgdAEDjr8aedQH4k/qqw4Scnrj18QvH\r\nBfPFzAwlEjMiwneSsEWQkVCuCp0ueVxHjLdBqwae+HfeExYAjctkDKU922IR\r\neBV6GdMavNUFg7sH6ffxf9YZDQjjNOcpgVDGpWeNo67hRBBxyPOGFiUxoctI\r\nwxBcou4s/HeRR8nneTjWBVkRw8Usp81zBGDKNqWqDFZ6IF7C67lEaswcoJia\r\nBTa7Xq6UKUw23gwIj4aabF1NRWXtEEOy9dYMTfgPPOHA0/pMwgQec0UVAc9E\r\ny0NIYCWTMFifXnEExtCmiII9PBHPqq077ds3AqGZC6Gb+127roSKgodkjwuB\r\nFjwyyayt0+M/XVy1196ScAdJ2JpBSwzVnjR9M6WKRgoYStJXlrfwuA9vR/lk\r\njcLytsmGScMPlnRw79JZAWmDzLJjDLoUvWSWRxyeHHcwLAEdxDrmFNNacGd1\r\n3A8nBFodJDeAOPl32ZumEBgiQeyB8ru+9YN+RFpit+r97Z3wN56YmUYeVKCX\r\nY2JZMynFW79vjtWpEjDC7fWHxzheHzKcyuA=\r\n=Mwh+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9e0a7dc5fb5e2d1554093d85949ffa6c2aaa33ad","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.bacda4885.0","@material/rtl":"15.0.0-canary.bacda4885.0","@material/base":"15.0.0-canary.bacda4885.0","@material/shape":"15.0.0-canary.bacda4885.0","@material/theme":"15.0.0-canary.bacda4885.0","@material/button":"15.0.0-canary.bacda4885.0","@material/tokens":"15.0.0-canary.bacda4885.0","@material/animation":"15.0.0-canary.bacda4885.0","@material/elevation":"15.0.0-canary.bacda4885.0","@material/typography":"15.0.0-canary.bacda4885.0","@material/feature-targeting":"15.0.0-canary.bacda4885.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.bacda4885.0_1666118637137_0.1057439328273917","host":"s3://npm-registry-packages"}},"15.0.0-canary.92b2556cf.0":{"name":"@material/tooltip","version":"15.0.0-canary.92b2556cf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.92b2556cf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e2c88262d3cf716f2470eb87a50fd699a21e4818","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.92b2556cf.0.tgz","fileCount":36,"integrity":"sha512-qsLUzpvJfdJhjC5CRNK+yK8i1vsxy8fBEedT6VUWGKYOFU7DimmwEzGmvj/hJYkuPfcwGFmMKGf0KnaaPQBSfA==","signatures":[{"sig":"MEYCIQCXLywnWYTH4NiHdna6T2XkiIj95XwYuLZ6SWR9s+bIbwIhAN84qwqQwkCUMpqMo3CNWEHUKxqNOAeebt3zN8sIF/1p","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT095ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoF7A//eEJ1qACOuA9iU0ogDxiREtcV+ZE0NNokDlpbaAcwBsZmxOKS\r\nCjTOWfMb1hXT8C5d5e9XqS3UmTG2fBW44zEKdrIBG47UMLzjtxuWtThMTBRv\r\nsMVq6d06oVvkHOjIGf+NE679fifklDFDeSzfZ8X+0eMEg+fAHfcIDhVSpSFt\r\nD5l2cT2Gk0iywvCeXI5ab612HX8yCzSWvKse3pIP6drARnMiA+Hb7EqENtd2\r\n84dp6/Qjck6jVUS+6/78bDJT/OrHCDpLuVJoi/rnDzHiMgZPOflteKOItpEw\r\nTdn9TmnNAipdTC+AamnRumtVFfSqhaYoMU0t334k84whxmdk7HH4hRtMbDAW\r\nMCTNA02SkznhvtC3hUzbhu/1bPJC4IkimaxnzqhHroy5xGmBuZhI/0VUi0Kt\r\nhk6j67vwQmbaYqhEuUWztWkc1n2GxhLEtKeRArjYMsaSSaOni8kyv+P/QEJs\r\nlMitTs7ANxIwWlHaQUx2DTDwZVxo5zt9LKCF6Y2e/MsvCKo2fZonFUZWFo/A\r\nC4T3z2+P0KZNbcZteiCWANa067vYooBtGXjAdCG5rA7WcJzLqy2s4qFlZqps\r\nZ1ncy60a+zNNF0pVQhBS1hdFyP3xPCjJAL2dhxgOCehYSlCX58cwq55iwm+Z\r\ntPf4wwq2TZk0lX9XiOlfyGPA6aRBZAb1xXM=\r\n=b3DM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7ac326ada7a9c6e84bacf5e01a6d22e675dcda8e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.92b2556cf.0","@material/rtl":"15.0.0-canary.92b2556cf.0","@material/base":"15.0.0-canary.92b2556cf.0","@material/shape":"15.0.0-canary.92b2556cf.0","@material/theme":"15.0.0-canary.92b2556cf.0","@material/button":"15.0.0-canary.92b2556cf.0","@material/tokens":"15.0.0-canary.92b2556cf.0","@material/animation":"15.0.0-canary.92b2556cf.0","@material/elevation":"15.0.0-canary.92b2556cf.0","@material/typography":"15.0.0-canary.92b2556cf.0","@material/feature-targeting":"15.0.0-canary.92b2556cf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.92b2556cf.0_1666142072815_0.9772002385772827","host":"s3://npm-registry-packages"}},"15.0.0-canary.cc804509a.0":{"name":"@material/tooltip","version":"15.0.0-canary.cc804509a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.cc804509a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d76a42d835fd1eceeae1e41e95bbccb5d4886734","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.cc804509a.0.tgz","fileCount":36,"integrity":"sha512-L8uAoJmbjkqh5I1jzj2Y4hUkFP80ymsjgNwl3POl/FJPFqtqS8XrF0wur3AfwhsBzRqKTzEs8FUUF97IRTxK9Q==","signatures":[{"sig":"MEYCIQDN/9EDAoxSz6DUov7TVV05chsi3KlB3xtI3+PDp55KwQIhAPYZT2Bi5eBspPoZG+PtzHHMGO2xbeCXBEt4wKxvIPGG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT1BZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHIA/+NQzdX+OWM31hf8y/AHEMvvKJGyh7iLY96mB43FapZD/rpM1D\r\nY3bDb+Xp4hK2gznQhnUDBDb9TjSqBOKVGJcX7qC+5aPJ+ig/kb44NMg2wvNe\r\nrt/CAWoc9iSw5lEuJEuCKyq7aMNXGwkcocX2CY/ErFHmIimYZTft7Mev9L9t\r\nHARxBzS67lLD1lJDIx7GCLGK9w6wyg6AnluvgQcwrviC+mOgTomI4pxKgYg7\r\n1E/JE58xD+ghax00t6eEqf72kOvGjv0QZh+sSGNNPOw4m3jaZUmU28B016af\r\nLc2u0HsmBpBaKc9FjdsSga1dUUR5PsHAHQoVJ90WvKpUrMB+jDVWyp9JnfRR\r\n9bCzyfCyvTrxxXra9CmH2Ayyz6ycA9JB67zuqHp+GoZYNiw76oo84TA0WPNT\r\nyphBfp3jFa+3inCnO11/xqJHp0yanNHECcDrz5ukAbgghlkX01FRMSevxgYy\r\nIkOQj7XW4VdCTLy+QwaYpvkMcsFUOKCHBiL7aPYrC9nnOjlKtpeZozPtrxbu\r\nQiaos1GKbL+PV077xquhSOEr48OEX8QIbAgVP/83BwnSacpZ4hIdpXAW51ef\r\nPOHfSGsq2m7dLXr2dJ00k6nfddAXndPGNrpXZcwYnmf1bQoJvXhK/BZ56Rdp\r\nluDCuMNj8yJdEaD+ciTKOEn63x9k1Ip82P0=\r\n=Mm+l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e8cb944f6f2263dc4b4fec5d7ade2bdb5172b4eb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.cc804509a.0","@material/rtl":"15.0.0-canary.cc804509a.0","@material/base":"15.0.0-canary.cc804509a.0","@material/shape":"15.0.0-canary.cc804509a.0","@material/theme":"15.0.0-canary.cc804509a.0","@material/button":"15.0.0-canary.cc804509a.0","@material/tokens":"15.0.0-canary.cc804509a.0","@material/animation":"15.0.0-canary.cc804509a.0","@material/elevation":"15.0.0-canary.cc804509a.0","@material/typography":"15.0.0-canary.cc804509a.0","@material/feature-targeting":"15.0.0-canary.cc804509a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.cc804509a.0_1666142296946_0.4173376765486385","host":"s3://npm-registry-packages"}},"15.0.0-canary.982bedae9.0":{"name":"@material/tooltip","version":"15.0.0-canary.982bedae9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.982bedae9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"269a7b57bd663d18b2570866589794879e797ec5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.982bedae9.0.tgz","fileCount":36,"integrity":"sha512-HFNHC7i3QD/B+V7jS4AmDfCRHV8ARQxipwLmxqqO9g7yfnqYV+x2JZ8/wh3bblEcEwPVFXUWkBDAhNqQ+9MCow==","signatures":[{"sig":"MEUCIQDvMXUbwgLOkMcLHNN79nlQ5QBKWI+uFmAH3mkajLm1xQIgGrNm2VR2xU/H6/oRvsdlyMFS0KQmUgmw9Jpfpc/NL7c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjT1ULACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZRA//aVuCyvdLYQwEaEQdOOasgGFvGg5suT1MbDPNz0Vxwb2g57oD\r\nCYjaFjaYD+NfntpGhBuHHscmiuvpXi9xV8a5NGax0y5EWHh+g1K15N3Q9eba\r\nSLrHw51DBdkUPoFvSqO6MNLShAfyiUdaZXfOK/p4goxodOvDir+y5CAOiWez\r\nyowanhEq2dD5MQHHM7MX/YRxWz0zzuFHb8B8lOJZC8h6xNHH7WyyVZ6NjMc0\r\njxx6FgzbJ2UiF/CObpXz2gUBuUqhrUGzKrfAd7yux/7GPD8xQ1BKp4a+nA9V\r\nf2tPD71klQjyfQEuNutc12aRy1m0c1BrnZac8wSgKWvTE5RLtoOePv8pjCRG\r\nFhOYoVFgONO65hhJYX+K2Hn0hvkXasoVy/5aFHxo7vEAiH/+mjXOBquKvYTP\r\noZ7AZEUZm5SHZrLsrrBNF/YBfUttb+TOrTW2ri1ZqkOoasoiEJl5V+2uNi6X\r\nw+PmItyzAwulRlmTkru+2E9ALVeZGNdox4WLusdZnqAtWPFPcyfZ/A5nc9+E\r\nggV3Q4pkcqR7cYj+SPQZya8DQ7Vl/8rt7soire46TRRwNguGbc/xfWSaU+aK\r\nkdJuTzLYXadiVhvV//YfbjOATva/rKmt9KKjCUug6ILQNFMLZJiMmSbiagCO\r\nppZBlddRhUXPYxSuh3NQB9dqqpRspB0e3pY=\r\n=uCN1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"247fc73217ef7d2438e876f1477d141e6970c9e1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.982bedae9.0","@material/rtl":"15.0.0-canary.982bedae9.0","@material/base":"15.0.0-canary.982bedae9.0","@material/shape":"15.0.0-canary.982bedae9.0","@material/theme":"15.0.0-canary.982bedae9.0","@material/button":"15.0.0-canary.982bedae9.0","@material/tokens":"15.0.0-canary.982bedae9.0","@material/animation":"15.0.0-canary.982bedae9.0","@material/elevation":"15.0.0-canary.982bedae9.0","@material/typography":"15.0.0-canary.982bedae9.0","@material/feature-targeting":"15.0.0-canary.982bedae9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.982bedae9.0_1666143498942_0.7659085288187748","host":"s3://npm-registry-packages"}},"15.0.0-canary.ee40081f4.0":{"name":"@material/tooltip","version":"15.0.0-canary.ee40081f4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ee40081f4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b77cc01ee56b79581d5e79a463cea501e9c43ec7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ee40081f4.0.tgz","fileCount":36,"integrity":"sha512-Rave0HttCMaXnrweB2cNpzygoTZrICw/Gjqr3Fc8LUDnGImzcYo6m2pVbzBzMbgioLIgktbyHDzjRX/o9bb4yg==","signatures":[{"sig":"MEYCIQDEcNSosyXN6YpToTgfC5Lbj9mRgWH7Prhct9keH/cfpAIhAPI1wZke9IiihM0ChmgsrBr5JvS5Ze787gUP+E5eOfX8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUFpOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq15RAAhdH01iRBI3af35xcMyyVBT7etvrblOCfAIXIVMYVeKr5iFSF\r\nxH0CIGHwMheYtW4eYSIL16apEvHiIQ/cCpONSAvf/aCgCE8iGaSRfADTxYcc\r\nsQo9WatvromUnFj439rJK30b3Oyqxc7I/60LmE0CBBhh2ESkz/pm4agf9WED\r\nizJAb7HxApn3sKP+hLM5AF9wSxQnFn2O8l39aTs5R4XTbwAPXMEGh6FdpKdo\r\nXe82vfZINnJxqwVwFRyEH9ApAr6rsyKxjkELAPF6dw3CdJNoq4VE/0SHy+8i\r\nZMNV8NULV5+hClUiZ9215k9ig+FeJqtWBT6DU2SprHBZjqRQoqyamOtiYUN5\r\nGCVxGeRWUZjrL2XymTnbCY7k6suw9AYCTbKaAcrJzvRPAyggfCuIKDyYNlP/\r\n0ZiIw/wt/v/mYE+LYqPQAjb13KXp0vrHMKiKH4fV1OZt0WKcam1Y3YAHOrXb\r\n9vX3w2UywjmXnszlSSR03OM7gfkPHY1FveFwE/Qc7g7hwSF6wYX924B6BgbO\r\niFBjmZdmCwnBssQvtYIitzoZ4IqN3xt4rwx3SU86+fFdCe6rhw9GGh+NXSxB\r\n85sVxbFXkGEMwjmDhFSnZ8ZgOdoBgQaJUkcY9Pn0eZAYBgB59xJxEzmRodU9\r\nbSXMoPgWYlZD7miHCIhlVhyLES+0c6mv8Pw=\r\n=Xeuw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"04ad48e358b6eef4ec9ee359b0ab906b30425504","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ee40081f4.0","@material/rtl":"15.0.0-canary.ee40081f4.0","@material/base":"15.0.0-canary.ee40081f4.0","@material/shape":"15.0.0-canary.ee40081f4.0","@material/theme":"15.0.0-canary.ee40081f4.0","@material/button":"15.0.0-canary.ee40081f4.0","@material/tokens":"15.0.0-canary.ee40081f4.0","@material/animation":"15.0.0-canary.ee40081f4.0","@material/elevation":"15.0.0-canary.ee40081f4.0","@material/typography":"15.0.0-canary.ee40081f4.0","@material/feature-targeting":"15.0.0-canary.ee40081f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ee40081f4.0_1666210382293_0.010685995598018083","host":"s3://npm-registry-packages"}},"15.0.0-canary.98f1b54e2.0":{"name":"@material/tooltip","version":"15.0.0-canary.98f1b54e2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.98f1b54e2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b1b88c13a6a38035e2a52376e8f60cdf11e78870","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.98f1b54e2.0.tgz","fileCount":36,"integrity":"sha512-74gcBX3s7kRcudw4NFhg/ww2CtxTfDSO4W+MYk4NbYwlFqe4JWrKb4HKmGJMGiJOugDmuoGATvhmZY3Q7b9vDA==","signatures":[{"sig":"MEQCIHfJnFk++uUbAXdK3dROoP3G22KE1lD3GI2wElgpE4f0AiAPG8e3hCjz6U/i8QJV0tx0y+/3SP1kxlcx8dSJHr2XTg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUdJxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJCg/8CMWeU86/RLt18lWomxIDrb/j/IYWcrLy15VT1j271fpMzf8R\r\nmag3fbIl/azdfRaoQ1gNFUrkKeUK/xU7tGkCn0KdZBgHpakOmlgCFH5eAtOa\r\nJEtBxMC0urGn1GNCZn5bR6LvFd/WWMUN/K2mz6OqoSBAYZv4QHFCq64MBdBV\r\nwfkRvPeE1YFj/edYnno+W71CmV9fHzQP8yH0VuoIofh+qLwNAZDwzXuzT5+9\r\nR28rjFU9CKhkJl7ijmvgJJix9Am0QPVucc6r3ZCW6HIpfndb+t4fqbJIHMQ+\r\n2jnVijbt0z+36AINg2jwYq5cZgK/R1d309Q9Fyl7sOq5jKej0JDCjwEH1FMb\r\n8OacRXDdCnFRXnT1v+0A+oujjT50UHVYGzMYbZErq1qswEM4hp6NWhSA+ArF\r\nWKNdMkaQbgmQpQ3SUACGVG35wFZS6yMqE3LUbyWgMmTDQsk3zd3AzOA2iCqb\r\nirNo3TiguLT7HV0A/uzz1vK+YasTdL1UJIvfGDfVC5p3hZbmHd/MULpDEBM4\r\nC8TuM4zu19il2LyHZUuf5qnBAaqBC5IitRVBYn2zmybKRf5HKFSJtPqdnFGK\r\n8vPY0DnHea51/nAaLb7vl4fk53OVhkpUkHYQN8IOaShG2xViHjgPYbvAED24\r\nHad7ZLnYL+kXqQt9ZZR3vqnV5+cZBUkMTH8=\r\n=MsUO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"aaf0a191532b3357cda509746499ff62e3aaa47a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.98f1b54e2.0","@material/rtl":"15.0.0-canary.98f1b54e2.0","@material/base":"15.0.0-canary.98f1b54e2.0","@material/shape":"15.0.0-canary.98f1b54e2.0","@material/theme":"15.0.0-canary.98f1b54e2.0","@material/button":"15.0.0-canary.98f1b54e2.0","@material/tokens":"15.0.0-canary.98f1b54e2.0","@material/animation":"15.0.0-canary.98f1b54e2.0","@material/elevation":"15.0.0-canary.98f1b54e2.0","@material/typography":"15.0.0-canary.98f1b54e2.0","@material/feature-targeting":"15.0.0-canary.98f1b54e2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.98f1b54e2.0_1666306673035_0.4471589429369569","host":"s3://npm-registry-packages"}},"15.0.0-canary.e74b7ba7e.0":{"name":"@material/tooltip","version":"15.0.0-canary.e74b7ba7e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e74b7ba7e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bdf69908b12bbc8210981152802f9e47c82e2507","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e74b7ba7e.0.tgz","fileCount":36,"integrity":"sha512-wtbPzzz1tnso1beJXYmGKRnRJo5p7mJ5vc8OhlvlpzsaozM3daB8XZ2iRiSOXEFQri/NS7amCHr9WBjvtcd6cQ==","signatures":[{"sig":"MEUCIQCZk63KJlhIJW7PJORFDypC+5W/60AZQ1MdPS52b7UHdQIgZ/VcNtaNvLPOPKdwYpbQnEg0Ew3SGGnuiAuno8lCCDQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUtGwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/sA//b3VSGeqfUN8eCjBEdaP7tg+en65la0Vq/18DClpT71N7yC45\r\npJ6fVdWHJVyW+uXqkRo9d0WAzBfk+mnAXEYs76PuYcEgN9Yvhyi4WAWEMlPJ\r\nxnhzrxIlcQ9XD7Vd4L3+6XqfmdQE+ga/HVCXsV6ZJ5bTP//hctWjg0v7GXXo\r\nGv40ryVdwtdjRR4W91Ib/5zHqA4PKp2Lwfu1nGm+pDhZHX+PSwaXzSOEzg00\r\nQfCK4Ms2VFkqJ72VCL4viacXDDh6/F5U9unmOaLPs/Rcv+EC6Isa3f34+365\r\nqj8543u6u4oBKR0ELybpJj9pBPuniwsIpj2i0b1MZ+7BHuywHueZNxMNudIy\r\nw2Nbbah/kNzmZUmbAxUkNPdcx4VkB9itzZDKsOSmcg2nrhsFjBqXlxC5IXpC\r\nKlHxlbSlwWfaj/SH0mggMALfNLCMIxU2/jCRNk2/9TamkjBcxMYhVL3LN36j\r\nizcnitmVvcRxpal0hb2BTu3Z2geXMuK1zTzs06hxsLDcz6U5cP4O240Q+0ve\r\nTYv2/wnjidYDQTLS0vbGobzG8cQkJiYBP0LGqD15XGcziPdYvnuyQNhULbYc\r\n04BiSSfAMGm6+nPE6jB89NYMSg08p/N7RtSAZcx8Rf8bttpR0YPIS4YTJgB4\r\n1eFfGLsI12lRqZ0D/X2xpK4KLQlO0z1FYxA=\r\n=JDm4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e30e36776ed9bc98d53938cfb5e48bf5d2cc67c4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.e74b7ba7e.0","@material/rtl":"15.0.0-canary.e74b7ba7e.0","@material/base":"15.0.0-canary.e74b7ba7e.0","@material/shape":"15.0.0-canary.e74b7ba7e.0","@material/theme":"15.0.0-canary.e74b7ba7e.0","@material/button":"15.0.0-canary.e74b7ba7e.0","@material/tokens":"15.0.0-canary.e74b7ba7e.0","@material/animation":"15.0.0-canary.e74b7ba7e.0","@material/elevation":"15.0.0-canary.e74b7ba7e.0","@material/typography":"15.0.0-canary.e74b7ba7e.0","@material/feature-targeting":"15.0.0-canary.e74b7ba7e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e74b7ba7e.0_1666372016314_0.31304249119915495","host":"s3://npm-registry-packages"}},"15.0.0-canary.ab55c07d2.0":{"name":"@material/tooltip","version":"15.0.0-canary.ab55c07d2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ab55c07d2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"065f25aebfb245ffa0ccf164c693c272a795331c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ab55c07d2.0.tgz","fileCount":36,"integrity":"sha512-y7ar6Ng1h5L86fyvcrApUtuNKEmKjdZy1lJSDZ8E33v09OgmotQ8DzI8qP3j9O/slY53hCdIyPti20HvJ0r1zA==","signatures":[{"sig":"MEUCIQDRTptuSK++2tS8TwrNyHuLD2k8DM/N0P+ucwFyztmSHQIgUvHArk2mc1h0nIzQGHd052ABkxqp7woEmUfIy6+VwvA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVDRhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0NBAAk4ZTgvgTTULiT2MLtoo30TxN/riVeTtFruPYQq+SodhSvqXo\r\nD6aCvzvOgZW7uzfOR9pIyiW97q1omWomyMN9bofbyjsIrmvkyWtB1wKz5K7a\r\nYhoxVs3WQzutKrd2KjbGOYhoBB0lrPVmcvp18GgFDTJB4dHIef8YIRIk4twV\r\nKkdXr71K6TQPEb49SS1HUIB3K/3ebhjCuGWA4j1Mpv5ljyp6IkG2nuBriIM4\r\nKMOhWStqUEYhrnsJ2vXdCK0H4SVtGWzQNXRwo93nqtq56T8GqY4pIBkIJGGY\r\nDjUCYE0s/n1hcI5kzMK3Pk3mCmC1OxGHDnlaWg9MOmhvd6/V3j+ph3Bv7Uym\r\nJeseJxxDY+H14HNdYj/A9q+RlmJv16HNn+sNt3YCc5A/mupeiWuFN4DZ9ptD\r\n7B3kp2XszWCbp3Nyh+XP1GCXRHXQ6/dN+Txr9QgpwF306ljMxHMnpXg5ylcd\r\ndLawzwAgkgq5g7ITamYFRS2SvNmrgqUQ7ot282FGwPiVuSCF4KKUjkDoH7QL\r\nSd7yoBLEhF8O2WurqxtVs2VfUCVPA2kJY5nacf9E483Rx0bQu1GQIAy/hwhD\r\nks/EiOvPJQy1FQqUukaM+xqmLMjWtYDfxoCSQzCl9Nvv9orYVX0zO9Y39VvO\r\nESmoCRtsJbAn99worOCBkb68cCtIBrJE96A=\r\n=bsbf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7fb32c724b7903a8060cb457aca1f150a15590dd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ab55c07d2.0","@material/rtl":"15.0.0-canary.ab55c07d2.0","@material/base":"15.0.0-canary.ab55c07d2.0","@material/shape":"15.0.0-canary.ab55c07d2.0","@material/theme":"15.0.0-canary.ab55c07d2.0","@material/button":"15.0.0-canary.ab55c07d2.0","@material/tokens":"15.0.0-canary.ab55c07d2.0","@material/animation":"15.0.0-canary.ab55c07d2.0","@material/elevation":"15.0.0-canary.ab55c07d2.0","@material/typography":"15.0.0-canary.ab55c07d2.0","@material/feature-targeting":"15.0.0-canary.ab55c07d2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ab55c07d2.0_1666462817179_0.32997060635482933","host":"s3://npm-registry-packages"}},"15.0.0-canary.fc539db34.0":{"name":"@material/tooltip","version":"15.0.0-canary.fc539db34.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.fc539db34.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ae6dc35b682574a9493291aaa11ac45cf7d922a1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.fc539db34.0.tgz","fileCount":36,"integrity":"sha512-IiikS2rHw2tbbpN8rzDXdXwPM0lHzTYK1yragnkX3fCOdELCna6ueq1ClqpxzngX1Ugm098EIvELIicFZ+pp6g==","signatures":[{"sig":"MEUCIF4w77/wk8vRh3CisOnYfyKix5YaaSmsbmm13uY7Y9I3AiEAq8XDYFTDlKyOubC8Ci/r2G/rHS93FBNAbYBd1gNqxs4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVuDCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqe0A/+LnFKgrstqI7k90tHiKfxgnrdRZlwcRWyMImwYhxfo4HmplVj\r\nDyU4Jr6P19e+aI6dFwpI8npO/WCUZxH1WFP9dbraDqgc/qOPx1OvnXY6QTiy\r\nOBVqadbIPSsvrPQKEyIYXMLdLagZ3JLZaQlGNDpjiPqSmhIZtpBia6zl9MNq\r\nWfdC5oIgfR8eJuCKJXFSDK0/p/Hc0sea1ATCLxmQB10n9K6ooWcBrDYVrLQe\r\nIAMfnJGyUc0qtjWFsByu4+aaNc1P4kppR48Dy9LwA9YAiRZuyzW/54I01pg5\r\nWugKwmd4//CjaLqLt4/YDgJErM3+v002B5L8mrZjRsw5eRfucqe7vfcF9dyf\r\nm2OFRW41/+g2PwvuXg8FT4KNPzmbF2ifpXkG6DT0YlQkhIJFamWtD7Mj5aLi\r\nT1u8JGqBrdAciZ7TVvQpsEjb4yTzkiJOkPgmeBUN4QA+6rS8Z6tYUlnjIZkv\r\nd9x0PdCY9G797dCuQykvRgVI2aL2UlHUgj5SiUfVLwOQ22GWRjF6AVArdjq9\r\nn8v758MMVLSBPdX3pe+lYUnYafljPIwmjeMKe9du93UQfm1lHMLL68vWyu5+\r\n8jtB56PewjnAl+QsHTcMuB1gA7dChjQD80oTWzHcYfSUpNSKJcpXUIrVMMlk\r\nfycPpxqHLEtFm1yorrbkmCBLgJOxDhQF9wo=\r\n=Pxts\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"18c679c73aa42d66117f8f1a88ab7cbde6f2a201","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.fc539db34.0","@material/rtl":"15.0.0-canary.fc539db34.0","@material/base":"15.0.0-canary.fc539db34.0","@material/shape":"15.0.0-canary.fc539db34.0","@material/theme":"15.0.0-canary.fc539db34.0","@material/button":"15.0.0-canary.fc539db34.0","@material/tokens":"15.0.0-canary.fc539db34.0","@material/animation":"15.0.0-canary.fc539db34.0","@material/elevation":"15.0.0-canary.fc539db34.0","@material/typography":"15.0.0-canary.fc539db34.0","@material/feature-targeting":"15.0.0-canary.fc539db34.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.fc539db34.0_1666638018301_0.7567303222209392","host":"s3://npm-registry-packages"}},"15.0.0-canary.e340b04c5.0":{"name":"@material/tooltip","version":"15.0.0-canary.e340b04c5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e340b04c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6edd9825eab578e53309cba1e7ac4b2708a3576b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e340b04c5.0.tgz","fileCount":36,"integrity":"sha512-c5mE5pua8gWwXd7cviBWZB+dpYDt/iJHsFzNM5w36VY/if7FThUC9TnsNi+cyuYXSEiIiO/ZgLLtJglMuxL9gQ==","signatures":[{"sig":"MEQCIHAvtOErUImTiFOxJcV3DK7TjiRXuFEqHydFFhcsJPa/AiA43n1+Hq3Nh5xe4RmClnshX7b6Wyk9UlwNFIuARoXJDg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWHVEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoncw/8CZXue3AKXUXFwcFHyV7SyWIDjqukrH/Pw2nVRYikOHwXVvjk\r\npJm5ndPtQsmZbcIZOxoNY+0uX91mw1YVJg+gzjra/Ui4sTBLrOfFGl0Qncxa\r\ndC7c7wdmAsR3g8q4oowfxsTV5LztUg/gJCrY7bTf9NBCcJXC39UZL2GP4ZB/\r\nz/OumuRruSzCRWmTufD6275f8g09r5P6Y64eiHbPzxXzueiV1JlGCTd7i3SU\r\nePiP82a5nfZ1bwAxxkCVwdVmTjnyEsVeE7vWdtHv1XzJABIz7QFXcZqWHhkO\r\nxxIH9IKX2LN6N8j5eODnpZ5H7ewYstvHNasJ8pMYVffMQVhzMpJjaeEIiJSc\r\nL/9vpnWa3uYDuFTX7z+L1dNDa3HVyYW30cHFeoRonkpqOoR8JguR/Wmw7E/G\r\nxkx4RbzxJynON3bahSlDAnrYrT+0V2SFs6hzl6xYbfAAA6FFPbNMDr75o2D3\r\nHDAH0Y00lLmFv+QCRJLxyBEz+mjY8nem10m5cXQ7DC92iTcO/GEJ/x3/q5Eu\r\nmez7M+V1XmLMN4weoOLbX9WGhH0WwyCFz4P0VuRHISnnnZEM1iTOkgVn49ik\r\n5rDkjSudmqbZ8pQlZvtzRgMzUQgbZToghFB5FpG0Qx0crhh20ytvlpXkdvjN\r\n8ysrtwxslQ7XFE9pqj+pDUeyblfXb3cSylw=\r\n=wGim\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f3e39db57f42dc19c08bf6e97cd6918a3ce32dcc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.e340b04c5.0","@material/rtl":"15.0.0-canary.e340b04c5.0","@material/base":"15.0.0-canary.e340b04c5.0","@material/shape":"15.0.0-canary.e340b04c5.0","@material/theme":"15.0.0-canary.e340b04c5.0","@material/button":"15.0.0-canary.e340b04c5.0","@material/tokens":"15.0.0-canary.e340b04c5.0","@material/animation":"15.0.0-canary.e340b04c5.0","@material/elevation":"15.0.0-canary.e340b04c5.0","@material/typography":"15.0.0-canary.e340b04c5.0","@material/feature-targeting":"15.0.0-canary.e340b04c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e340b04c5.0_1666741571762_0.38427333335258895","host":"s3://npm-registry-packages"}},"15.0.0-canary.2c1a8f8fd.0":{"name":"@material/tooltip","version":"15.0.0-canary.2c1a8f8fd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2c1a8f8fd.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9c039f921cef4e0f8ff4afea9ec6e44eb504d70b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2c1a8f8fd.0.tgz","fileCount":36,"integrity":"sha512-pRZaMdBgHLSpPEx8eu9ZlrXhJsnjnZvwMQby77vzmRDhG6b7MqKl8Tt83n04Qq/Ch+RW1tni4MQaQuMQzCazPQ==","signatures":[{"sig":"MEQCIDnhH13LgOwz9FsqlPTd7bZQkvfKKEC70ev8WIr5io5CAiANZNoJr4WqzleSYcucmbVN39b0AeC1OhcSwn4JKGd4PQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWW8DACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmroqRAAmXiNs8AXheJQAhCbN8ifowsR5Q5btrg84fmIvQxHq9JOSe/6\r\nywl7/UOzZFlSI2HGYJaMRUVO4/YJrKCWKi/cRrMwalVgzhK4+WPUTPu32Tbm\r\nZeSeOPbHrPQGQJwkISY3Sa1rf3mJktIw6mixkS2uiJewuuvQcunC64UpZ3y+\r\n2JpT/2Jp1JU6vl76u8LBRwNHGSOhNaHdhDiJatRa+d9ilB/hEPt5MkM5vic1\r\nhiQaj/jBsxLRW0un/jxzR8YdHDQhoROr6FoQtLUFSJ8eIi+zz1epgbnokQ+4\r\n7Hxu+1Ino4n9gAI7T6aER4mCCR9H6mop5vIjY/FK0ZrbWyLrCX5XQxI+dfEI\r\nB5Eq0F2rGrtW+PhE7WTXrl/dHz7VVhZwUKWgVgh7KN6h5/U++K05AazY9SRT\r\nsm6Yimnuztx63KLAxKKtX4P3geWModniljeE92UZQFkkxCHs/wQQbW2Svy7x\r\nkhynad24ueBgQcBoHVItjL8P5YaaizsEVWCKOiitYUiA94MNQG2w40vqRP8G\r\nbevhNmyU6j/QZVxbsye2yY0Fy7VgW3aZBpi1lY0YxJW4JXIhanwwwmEYMElT\r\nnpPhjn0/APQQwJ311YvqRkj3mdhjoah/WBfCY4t58NU43yQzd/TyAPLjEeA0\r\ntu/AY1UarExD1HLV9AyLP+3C4R4PJHmGmSg=\r\n=cK9R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"dbee023b5e37423b8695520d95f2d00d884bfd5a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.2c1a8f8fd.0","@material/rtl":"15.0.0-canary.2c1a8f8fd.0","@material/base":"15.0.0-canary.2c1a8f8fd.0","@material/shape":"15.0.0-canary.2c1a8f8fd.0","@material/theme":"15.0.0-canary.2c1a8f8fd.0","@material/button":"15.0.0-canary.2c1a8f8fd.0","@material/tokens":"15.0.0-canary.2c1a8f8fd.0","@material/animation":"15.0.0-canary.2c1a8f8fd.0","@material/elevation":"15.0.0-canary.2c1a8f8fd.0","@material/typography":"15.0.0-canary.2c1a8f8fd.0","@material/feature-targeting":"15.0.0-canary.2c1a8f8fd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2c1a8f8fd.0_1666805507744_0.6851591947400331","host":"s3://npm-registry-packages"}},"15.0.0-canary.ecfee946f.0":{"name":"@material/tooltip","version":"15.0.0-canary.ecfee946f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ecfee946f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce0e97fa3a0dc4f9045b59d25554d749dcf1431c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ecfee946f.0.tgz","fileCount":36,"integrity":"sha512-AUp5R7RRCY6uryhNbgIx8ayBraWcXw66RHDz7SnFqqEZKT8nj3S9yAMJwGiePhw/CyCghB0yc4mYJreL+fP9qQ==","signatures":[{"sig":"MEQCIDr8G1XsvxwnJFRh/EEMoEXhcZnNGSU0jrV2zeBfeNCRAiB2rCdeaNYgpYB2KteoVYp1WfswJlPqIQ7oPW7T7cYCJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWZWhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLGhAAhlTEgQJvzhMEdM+7q7z03Og1BwicSY6Z/fxdExYGdudSHWvl\r\nbWh98Ri7taYajm7pZwA7lwU22I6bg5KTcAGu8b7ca8C45gf9qPmoAy5c+IPh\r\nLV7fA3e2o9xvu4rpIg0utap80G0Ss0lPzK+iMKOKyHn67TzWLM6wiLzQkAfd\r\noV0VIWGRvYcDC3zkN7ZZR/C5kYIOprUyeQT7ah8i7TCj+vnnARieJ6tKpMjv\r\njj+Jvq+/JnpNPlf2In5NKRcj93+ubgkexWE+QTVL680i0teyQgxde6cJwHuZ\r\n60RJ5oIm/2EfDWLtuso+M4j+qAZDUX74p1/QkY7KsFVE6omox4UcYO3g5tyl\r\nPgGcCXdZfIA19+LxbjGcbuoizMj7JLYtx48jXbt1RohNohAwX8h5WupxU1g9\r\nKsoMHRJwiT44/Xsmwu4mNVw/sLGfIMUARGG0qtV8svZZlxb3XjUoAZUDCe1C\r\nSmGfAStkuWHncej4gsVsb33omxPB3IjPN0sRl5aPWroU8ZiVr/t1b7TvXDG+\r\nf4Qpi8A2qrOOvizqoT62i6Mt73v+uBTm0tfAf6vTC47w4lhWrXE6Xtbh6QP6\r\nc5JTZfK7Sbss2peYOZDtYU8J45F4iggRj9KyRSHwK19hy+gyZiLZ4ggRDU5U\r\noEGluujRtI02Nqj+J+QUgKqe10RJDFcEDFA=\r\n=XR+A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"dbe05d725a401275de1e88f9d5bd6cd2079a0047","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ecfee946f.0","@material/rtl":"15.0.0-canary.ecfee946f.0","@material/base":"15.0.0-canary.ecfee946f.0","@material/shape":"15.0.0-canary.ecfee946f.0","@material/theme":"15.0.0-canary.ecfee946f.0","@material/button":"15.0.0-canary.ecfee946f.0","@material/tokens":"15.0.0-canary.ecfee946f.0","@material/animation":"15.0.0-canary.ecfee946f.0","@material/elevation":"15.0.0-canary.ecfee946f.0","@material/typography":"15.0.0-canary.ecfee946f.0","@material/feature-targeting":"15.0.0-canary.ecfee946f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ecfee946f.0_1666815393012_0.1726613899849858","host":"s3://npm-registry-packages"}},"15.0.0-canary.73ca9dbb0.0":{"name":"@material/tooltip","version":"15.0.0-canary.73ca9dbb0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.73ca9dbb0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"46b5cb3dfd4d14c2351846e2350a9886cdf5ba86","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.73ca9dbb0.0.tgz","fileCount":36,"integrity":"sha512-BGRqTpYSWcITfN5m1ZGA37KR3qU27H5wVMkuePZrNw+KnXopcxSwi64rJdWMUjjh42iMMql5RYphB9sxS6LK1Q==","signatures":[{"sig":"MEYCIQD240CPvj2LPuPGY/IBJNKK2T/wHYaHaqSeIDq5ZANtpQIhANC99wQre/0TxunAHSDjR+qdCZzPRBPRDaUYT/29y7VM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYAbzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZgxAAhmiwEebxoxvUTLbABrGzzkezW6IDMgrpLPMDxFByW+RG8BY3\r\nwpBEY6NdLsTikSZwCZfNe4aHCtoS23htcPtlCTJ9AZ7HrUrraNk4ij7qjVRX\r\nA/tW8vyTD0C3/RnacrYUG+MZWFPDTjtDijfJQ6nA/3LbBEVxUsGI6Ufb0ojk\r\n7ELFr2m8CDS8BpmOe9eB3vCofac02A9fl6axxSWV8IgeclmJBQh9dG1Cz0HS\r\nQjKC+34+iVl7w/1/ppPvhF3eAE9EWhbBCUHMCsLydo+K2TXUlikWeBjZDG0k\r\nh31m+d+jvYMau3X+KoD1kkxcqxf+uRKjHcPMq5PuaAJBBoeqA880iBjUqsKa\r\nJ7pmK3o7GhL85Buw75kT2Li/45Vrs+ffHN+g+tk9OjGtarO7y/KfVsBzFh+f\r\n68maguh+JZRnul8eqerqTa392/8w7QG94/9pY6FkBxUMK/zmZt1ii2mE7HVH\r\n9po6XaehOnpDEKWq+pZ/7eccASBc+ig+N+OvZX2JuxzIlZyCJyAXjT+0THqu\r\nx3vvU21olvNO8VC0eSwLvND5kFPcc6Eelw8aIMp+l8C+Cq6hn2QkpLyMw753\r\ncxZSOMty3r1i5MZtuqOEHTtyk2EDnwTgkp9Ok2Vx0W+A1TQcM7NOoWQhIvEL\r\nvNpigeWtUwaRYFMbePd/4DevWk3Xlk1rLrQ=\r\n=mIWQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3b1ecde6148e6e8d98c4b0c8a4dd2ba56e95586a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.73ca9dbb0.0","@material/rtl":"15.0.0-canary.73ca9dbb0.0","@material/base":"15.0.0-canary.73ca9dbb0.0","@material/shape":"15.0.0-canary.73ca9dbb0.0","@material/theme":"15.0.0-canary.73ca9dbb0.0","@material/button":"15.0.0-canary.73ca9dbb0.0","@material/tokens":"15.0.0-canary.73ca9dbb0.0","@material/animation":"15.0.0-canary.73ca9dbb0.0","@material/elevation":"15.0.0-canary.73ca9dbb0.0","@material/typography":"15.0.0-canary.73ca9dbb0.0","@material/feature-targeting":"15.0.0-canary.73ca9dbb0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.73ca9dbb0.0_1667237618755_0.9375009980802591","host":"s3://npm-registry-packages"}},"15.0.0-canary.357f2e5f1.0":{"name":"@material/tooltip","version":"15.0.0-canary.357f2e5f1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.357f2e5f1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8f9700e923d4dde604ef13e1b5e4243328e80d52","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.357f2e5f1.0.tgz","fileCount":36,"integrity":"sha512-V2C2Zyhq/FN2wPF4nuYev1sthxBtpLqnwYnnUZNB3DgJPORLIP/SFwpzbgv2VQYgb/Vx20kDFYJjwYycJWGLBg==","signatures":[{"sig":"MEQCIBidQrWUWrXDdZy/Icv2+1mNIApBqXhz+ByCYUg7+j6lAiBfH8poqOI0IfNC1+n0VkjIOzDCBOlhZniLHAPxROxtlg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYBkBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtqQ/5AfwN0U9VqrxH2nLKCrcFRTLvi9bT74tzXDixqpAFUVYtwtGH\r\nWn9SDbGHZIaVvVz1Db6TFiWCh7w1LlYlIFI/wKaYuQKsJewubjt3M6OLfrLF\r\nS5BjhTONaZSXi2nG/f3AZY/+jAZp5H0nHKvJjhCmQvotcr9sbABqrJFi2A0D\r\n9WtzS2SFNw1CjLOEJu3vEI6ww+Fl3GQUa/WV0pD6t5GpBME160zxxtYGjNqc\r\nSLWFWCIqP/iyzzHQ4bmVVQacx8SxcAe7APatsTZ+1jOzBznLUreF9fnA2R1b\r\nSdUsHYrk31pWsuSqfRA5eJDtJsAOrbG6J5FUNXCljVeRlWxx8IyN3k7DmweM\r\nqsJ1fnlxafhiSyAEbfHF6M7t57NLFiDsLWwYniWQFv85xW2LnBjPKYsydL7d\r\n/eFZJJyidQrS3Jn8vVT6sUbn06ktFiLpkPhwOFXqGc/WadSHM2ZQMZiYHgqy\r\nL18XSK8BytqJy6bxotTMiV6yaJsL2tzuX0DmSwf32LrOsQo4KWqnjyb7HEKz\r\nFKJAA56z05AnlNtlpYiKngQmT9ayF1R1Jy3gGD5eM6Q2zKg1rWXRVEj0Y/aB\r\ntemTuMJv+8ZNhYSdHfWf7cRlVC7khJowh7CjJuj/YNkHFlZCdJP8RGcJnBeR\r\ntUQ1ZxBBZVc+C8F25SwRXv0oSrQf4PMXl9c=\r\n=x28X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7f8af87642d395b497ff80efe06544dd459b947f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.357f2e5f1.0","@material/rtl":"15.0.0-canary.357f2e5f1.0","@material/base":"15.0.0-canary.357f2e5f1.0","@material/shape":"15.0.0-canary.357f2e5f1.0","@material/theme":"15.0.0-canary.357f2e5f1.0","@material/button":"15.0.0-canary.357f2e5f1.0","@material/tokens":"15.0.0-canary.357f2e5f1.0","@material/animation":"15.0.0-canary.357f2e5f1.0","@material/elevation":"15.0.0-canary.357f2e5f1.0","@material/typography":"15.0.0-canary.357f2e5f1.0","@material/feature-targeting":"15.0.0-canary.357f2e5f1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.357f2e5f1.0_1667242241451_0.01695416008175865","host":"s3://npm-registry-packages"}},"15.0.0-canary.eb103d4b5.0":{"name":"@material/tooltip","version":"15.0.0-canary.eb103d4b5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.eb103d4b5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a4e46f6cca74e8d8175017cb58e468c3826a7497","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.eb103d4b5.0.tgz","fileCount":36,"integrity":"sha512-on22FJGBz8LUZN2v+VdgicVaJ41wGkEfFJrlxSRop9tGDQq/lixexd4SXiWqF/auk3yCgUw6B9X0Ddqsea7MzA==","signatures":[{"sig":"MEUCIEIQq/GtaQdsHXbPEkB2pW1xNzAV+w9nTFPQWWVIVOszAiEApW3sTWVJrqH1UXKp7KHxp4VeWl+gXpeJdkSQXLQJxiA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYCiwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo65xAAo/wkyjnfhRhVCDOiFSO0IiuCuuUL7LbiOvnVAu4qYka40MNT\r\nyC1Shb+dI2Q5NQEsQv1nUmGdPdAa4XrHJ6qJGbx+YVNwCzD+AiwrP6srr6lO\r\nsP2w10fBZ9pXhZtVsh+lSyFCUdSmh/96sm5x3iouvlowS259Ia95WSOvEZvQ\r\n4z9pcTm2CNJobyaV/4INAhC7C4Ahtnbm4rkW3/AJciSr9luIHEIlR1W2qjIN\r\nCcpx/vAfA0CytvumLoXP4XrbHhjW+LS1SHCRB2t61mTYp1QuXOmb/9KAQhgr\r\n9mt4g4zK+QoJWHvROTw/MZuV6F4M6KK3+V+afs7yRtiEwmTeVSKDdeogol7n\r\n1aXXNcWKuHaXgDGVF5uND9kdEyS3LYeWRRhOmJANqm/Vu94AnyIqQcHxD/Gi\r\ncp/fh0Spd5yKzbu0gpv3ps4gnGz1dDnRGP9TNe0kfOvh8lOPZK2AI1DW/6mY\r\n4KNweunNQwVq6ls9oVB/Wfrao9SPxZG2mNvVShT4r9VoyIn6/pUHkUbX8cO5\r\nnMhSIlwJgJ6fzJCmE/a+D68MEDQFtvrZyIPkQiMoPChAtq6RgrZp89bWvpjK\r\n8AkvpqI5EDKOHYVG+yt9QYeVXWOqB5v4uh4fLX0ND0JVz93O9INGEovBCybW\r\nKBNzBwscM5eUqQjnk1XZXVxQ23CV5hUz5P8=\r\n=ueKR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6fd82c2abdb8567ca00c6847142375ca8ac18b90","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.eb103d4b5.0","@material/rtl":"15.0.0-canary.eb103d4b5.0","@material/base":"15.0.0-canary.eb103d4b5.0","@material/shape":"15.0.0-canary.eb103d4b5.0","@material/theme":"15.0.0-canary.eb103d4b5.0","@material/button":"15.0.0-canary.eb103d4b5.0","@material/tokens":"15.0.0-canary.eb103d4b5.0","@material/animation":"15.0.0-canary.eb103d4b5.0","@material/elevation":"15.0.0-canary.eb103d4b5.0","@material/typography":"15.0.0-canary.eb103d4b5.0","@material/feature-targeting":"15.0.0-canary.eb103d4b5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.eb103d4b5.0_1667246256715_0.4987858518469157","host":"s3://npm-registry-packages"}},"15.0.0-canary.af5f01223.0":{"name":"@material/tooltip","version":"15.0.0-canary.af5f01223.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.af5f01223.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9a409f12b00481e7ff43853b125fee237d592799","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.af5f01223.0.tgz","fileCount":36,"integrity":"sha512-GIxjKqosHVDvtairkX4iYufYoEFaTlkEqtUa4WnIXcAaY5pONHUfO4uzZyYfVR2pWqgZKsG6xFm+3dchWMRjVA==","signatures":[{"sig":"MEUCIC3Qu/ZNqi97Gl/EBnG77vgYXbgiT7PMU5TVkG28QYGdAiEAy9S1HwK2syPcs2cYSIpEFJ76AzFVt2dxiRjtAgR7t6Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYWeJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8xg//ePmkGPJyqg9Yw8wG3Q0qPjUisql6iKr8avLZ6RnSCVMWbu/p\r\noBcEXHhMdhANaUf+aP4VlEH57jdwWAilNnMorXTYwQ1kg8XUaS7DYOLdwEIP\r\nWVX65eXCOu0L+QOIcKRuoSspTFt/WrzzNDI4O+BTinQ55nvWtWUPl+LLO3OS\r\nP8N2tlpFwtNBx3iWtNWJ1Vj+AXUjaDcykzck6Z4d9uPucnr27uDMv+fh9l8q\r\nGv7pVKBzXNi4ZzB1+UrPH2S81Mc1uhv4G3D1c8um9h6HGGdV6/752os6NkaI\r\nSViRpS//bFnX5yL4qnbq0tFhJ/kDjzo+6D34C/rsxfjSaUPo2bvChNqq1Xzq\r\nasFy0iGwwchp6rqo5bIXtI8hyaXwP+5wBERzVUWlmeaiO5U4rdZ1RAAx2FgQ\r\nmJSK/jYc+zHAnXb0+HJTocFKogBmPNrDgAvylB9zEG8H9JvaVOFD2xzQA1Y/\r\ncJzPL2y5xug0fiec1FFY0pB37sZqr+3RQk6HoXG2w9RsNDXE0W1gRW1vz5Vv\r\nvikGPK6u7mqCEtJSyJoPYdh4jAfzDj3OcxuykTg8mTQ1KITbAzzxtxbEgvKn\r\nP261PxpYFZKnJN0DUZzDtMJu2gg9QIvMjLsaCRYK6OWtu22Knmj4y4OQvKCH\r\nwR++ugHx1+SGVjLPd93Z4ZVkuxDl/tClV/E=\r\n=yePi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cc7d8ea77d18e30bad947332164ac02701e1ed9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.af5f01223.0","@material/rtl":"15.0.0-canary.af5f01223.0","@material/base":"15.0.0-canary.af5f01223.0","@material/shape":"15.0.0-canary.af5f01223.0","@material/theme":"15.0.0-canary.af5f01223.0","@material/button":"15.0.0-canary.af5f01223.0","@material/tokens":"15.0.0-canary.af5f01223.0","@material/animation":"15.0.0-canary.af5f01223.0","@material/elevation":"15.0.0-canary.af5f01223.0","@material/typography":"15.0.0-canary.af5f01223.0","@material/feature-targeting":"15.0.0-canary.af5f01223.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.af5f01223.0_1667327881195_0.5671164954927788","host":"s3://npm-registry-packages"}},"15.0.0-canary.58733ef41.0":{"name":"@material/tooltip","version":"15.0.0-canary.58733ef41.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.58733ef41.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce618a7ed2404ce9f7656f6b411766248154437f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.58733ef41.0.tgz","fileCount":36,"integrity":"sha512-8X2EnWsjZoagZAnjoKd/zjck9vsggpqctM8hlzmgGjajAKjI8YO/XSr5xjA5XYmOLAKK6jqx5VoiBgPURuuNQQ==","signatures":[{"sig":"MEQCIE42oPT6Qs4QHW4IDYYOvjXjn6foy7yZTHeb31qaIZ7cAiBUy7StiBKqmQDqoJlmvW85DoK0lWAOeTuQqmPIqVR0lA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYrLrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNRA/9Fxk5NsW1ety6qKn2zd5tzNfv0UfZ9YCVgXOCOy/QJFu2xEqn\r\n18XucVirnBrJpT/MWQzfP5Kdl3VEPXEhScmtlvW7Q5BDqA8l3qeL8covJuX/\r\noZEOvG9J8sG5mKlhfKLuiOXpulxOKGpBSQ/x4d2HJBQj2wgpUuCO418/IDfh\r\ndCSDY4uvkjiDnn+OdGfaVs9LT5DwQoBEpjxRAE0wbKcOVy4Ptl0XHRfl/Bzb\r\nM7O5bgbi5/FDSnBNpq/OOs9e/Se1PAYxa6eESfOARik0zppAbpLwLRStwHw7\r\nd11SxToBLJZhMkLR1Gzetlj60TF+en679btdWKrR36pT9KXdAl71/qSTW8zc\r\nrYTPaIiXxbVqD2MhUmz4Auovqa9U3CFTWOxH0oJRkNjIiD8R/2TB/l77nqQZ\r\nNdupqH9facwqvqyWBYJtA+V0zVpbBPpusM/z7tWplEobXwJAgPBPOOWyRUMa\r\nrPLOFAQUzsul82nAbUh1IyYjAssKsg7vixBLTpbBY98gAuo2IhFP9Z/G2XI1\r\notcM82WdnY7X3t00PfrQFOv72t4dBz5ixGIYqr6cU5bJBKVJ3N9pwvfWT23M\r\ny5hGcFLCePIUXhoKmcNNfdqB1nh8jcaLbtHvhPCWf72oreLbT26p9JxoIvfF\r\nftu0+QIKww3cnk2ZHfp0HPL63tgEHXsUa08=\r\n=yC+s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7754bbdf66b8fd61976d3dbbe04b991d9dbc0caa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.58733ef41.0","@material/rtl":"15.0.0-canary.58733ef41.0","@material/base":"15.0.0-canary.58733ef41.0","@material/shape":"15.0.0-canary.58733ef41.0","@material/theme":"15.0.0-canary.58733ef41.0","@material/button":"15.0.0-canary.58733ef41.0","@material/tokens":"15.0.0-canary.58733ef41.0","@material/animation":"15.0.0-canary.58733ef41.0","@material/elevation":"15.0.0-canary.58733ef41.0","@material/typography":"15.0.0-canary.58733ef41.0","@material/feature-targeting":"15.0.0-canary.58733ef41.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.58733ef41.0_1667412715165_0.03911810830542817","host":"s3://npm-registry-packages"}},"15.0.0-canary.909b48215.0":{"name":"@material/tooltip","version":"15.0.0-canary.909b48215.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.909b48215.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3b5e77f535e27ebfbf200538d8ef789830fd6a73","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.909b48215.0.tgz","fileCount":36,"integrity":"sha512-8D3901Y67UqxI4LXmZqQVWwMlwJE3Ef4GIR6QGx2MmOEXhGu/e2C6hNuw2cj+SUaNy2nEwt+/HsoExBtwrCGKA==","signatures":[{"sig":"MEUCIDoDA2ltWxmgRZdL4+uYZWswOTvJxa+pg4gUnWH2qZXsAiEAuVu0p6Cq3GbLr2tRO2InclzNGr2ssC8Y140hQoE7ssY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYz7jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolnA//Vj6CTTKzFpxBtu4tkWjHGpy9v50LgoLqen9dme2W1Q8Fil6Y\r\nyz1B4v4kqCrZKgJ+bzATqv2aXZqweh6iG/hU/72pekE9eyu43KbzKPbZkgyn\r\nuXFea7DjQuVeyDtF7JbRz67orCKTgP2wo4BNJf01l4kJ7uvBKYhoAi0B/M4W\r\nGbcTNN5gZdhdEB9tiEMCf73TFDxEL50kmxfOPHQcMNxqTvOpuXuUyvf7LRog\r\nALDTnS4hDGYa7Z2HfWqNavyk8rXi+/5o2VgmONAznunXu9GdVESqEwhV5MY9\r\nO64XQDt8flmzjJ8x1c6A5yM26Slqw0RnMqDDMZLBqZN133Omp4+6eZXXEbpk\r\n6LGprD8C9jDWcK70crRSf4uRbO+70jmwv8MSdsD3KiKI7j5BcigzvKZNLTBk\r\nzz4SOGfu69JlwkX1OGRTywmpW0m3Mhhw+57DiYZ4tWySwDlkcfvcaFbojkQG\r\nA3tTEUFby13bf1kCePg2ITagSq9Z1w7KIBE7nGSwzYiGF6X1GuqLBjMW1Ha6\r\nFJbfGP24e3ov4BVi7DMx0RvJ12mIA/FmB3xLVFaG0M44qicOnMcr/PoQOuCM\r\nGhA5uHw2ojnQ/gmQ0IXSkTeAPkE1FSG3SD1E49MiH1WwGI+oE5m1GzLRGAJM\r\nyxjbck85kXtedCX+v91/aXbQDetaag71KJU=\r\n=yt2l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"68d372ae12d017bf28fa2ad3c86cad4f70609116","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.909b48215.0","@material/rtl":"15.0.0-canary.909b48215.0","@material/base":"15.0.0-canary.909b48215.0","@material/shape":"15.0.0-canary.909b48215.0","@material/theme":"15.0.0-canary.909b48215.0","@material/button":"15.0.0-canary.909b48215.0","@material/tokens":"15.0.0-canary.909b48215.0","@material/animation":"15.0.0-canary.909b48215.0","@material/elevation":"15.0.0-canary.909b48215.0","@material/typography":"15.0.0-canary.909b48215.0","@material/feature-targeting":"15.0.0-canary.909b48215.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.909b48215.0_1667448546827_0.41870949796997836","host":"s3://npm-registry-packages"}},"15.0.0-canary.7f17127d5.0":{"name":"@material/tooltip","version":"15.0.0-canary.7f17127d5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7f17127d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"30d391daa2ec87eb0e10bd913a7b757b5f994a86","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7f17127d5.0.tgz","fileCount":36,"integrity":"sha512-ipmIzK7aLw3oEbolwNF2SFrdKNflGGZaPRS15q4Ba1czRMjETJ6I6/HnbCl4xPUjmbRNkmOrSN9xKyenBCkoIQ==","signatures":[{"sig":"MEYCIQDrggwDaGY8e+EM+jYBmTCDEgVl6T6ryLzXJMn4XFRH5wIhAIgmxvLEzAHtMqVPMR8X59knTdOV4CWk8lfBJLMZHGEQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZAZnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqocw/9EfYC0LgVlhaf6FA2PwkGe3ydYRGywNJ9qAGjAN2bYEAAWVt6\r\n+E1UNLvqr6V1QVP5WX484HyPqNVzd4+NazFBMP5Yw2FStQPYURgvPwvIcmNX\r\nIUMI2Grv09RNTncF0FidKMvObRBHvPqZRnbKh4ThMD1ymEhl/4miolejzCGu\r\nCOPuMkZLbcXOXRDtxWrD/sJYhRMP+YBInRbElqBs5PM2r1TZsfe0l66XG2F7\r\nCOjh0q6VI5b+pqLFLXEtZm7TFsWWuYpmwqHwLGkeCwE6Ebc3uMMjzALxbFLV\r\nnGDqOSNe9T7gEc4HOaYpYHsjv9t0RkbJvxFino6vB9lf6U4rF4eHwygPBuxY\r\nW8lPKh4K83xEWL932hIaE07/xIBBdWdXDx8kkgsVTnVg6+A6pknd/P2ZCKKd\r\n/GXzWk6ejq3hIS6EOFpoYto8I8+zA2/3g97GfJLaX6gzupFvdaLyuJMOfWJv\r\ns42a754SrbE9SSjhrRbHVpf7uAd2tNnLGtN1KxJEA8NS1WNQmk6gTfBnAi/b\r\npLjmkdN1LJGKxTBjC+jSBq7U2uUzsfh03YGNAWUH15RpukTjrGit5NsziSoJ\r\nAOZKJjS6k7WqPXcH9Q0OHyiKdwQmj544/kMUQRhmh6zU0MBLgvH77ysyvBkF\r\nA8yhnIgs2RgnC23CTFn+moRnN4/zOop5JFE=\r\n=rOL2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"26e22af93057c0fa00e7fa9eb104abdc96131eec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7f17127d5.0","@material/rtl":"15.0.0-canary.7f17127d5.0","@material/base":"15.0.0-canary.7f17127d5.0","@material/shape":"15.0.0-canary.7f17127d5.0","@material/theme":"15.0.0-canary.7f17127d5.0","@material/button":"15.0.0-canary.7f17127d5.0","@material/tokens":"15.0.0-canary.7f17127d5.0","@material/animation":"15.0.0-canary.7f17127d5.0","@material/elevation":"15.0.0-canary.7f17127d5.0","@material/typography":"15.0.0-canary.7f17127d5.0","@material/feature-targeting":"15.0.0-canary.7f17127d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7f17127d5.0_1667499622794_0.46946441225926105","host":"s3://npm-registry-packages"}},"15.0.0-canary.da95e2a05.0":{"name":"@material/tooltip","version":"15.0.0-canary.da95e2a05.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.da95e2a05.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e2f3c02aa0e68940bd9c264c71602561c7a6145e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.da95e2a05.0.tgz","fileCount":36,"integrity":"sha512-ouScC4u1hR+jubPkXvjGD8t01ncje6R/NM38NhC2+H6O3efJfASLfS8YGs1mDKMGVfWK2IOLgkbFD6agJOBnQA==","signatures":[{"sig":"MEUCIQCqKiWe4jJ4tN9pr8kEjW1fTnViO5S6uO1dcvvyrCSV4AIgWuM2HfJxNQb3mkr0ABZ4DNlHDE/Dw9io+yOfsRVZ5lk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZUUhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolzQ/9Ezv033mutPM80R1c8ZAZEoPrw5sbp7iZGjuNNQLYHO9RhYVT\r\nARVEpJzoYaM+xNr4J2jcXWYcd/Fj7A7BXLuNmmcbbbQoRS7oXTFGQodE/syT\r\nYw0WA2piZoEl3+X7ZElB+mk10OB6Bs1CpU/O6RGexcxHzo5hNav9ATH9Ex/m\r\nQ019N1HQZyaFCVJ8iYlDrvluEg6/FAcR2eWT03VcCIcUg1EwWvonEOyYxomO\r\ntyevwC4NyaMIUXBYFtO8fYax12vpky9Ehk0USIRw7deCDbylp/p/Q/VW3N17\r\n1f5dbtwH7GUep5+Hjlu/g4Yq22UWUH+/Iw5GHPUU7+2gq5ZpVMokB4YTJIzu\r\nVpCh0gwbMIBn3tWyg+i99BXImzhFH+hdFuOFe9MBFFnJLO/SCpT9VGzCSo1m\r\nUyER0WsH/owkoQe2C52uv+sU+16wab3CrCv+beczVGxOoyBJ3WIDTOUqlC6G\r\nwtwnYODDaR1Q+MdHjYPWoMNQN3D+Lr1/EXmBQw+Onx/paDElukNaGJiAXEio\r\nM94JH4HBKBGCy81OugrBr5cKHLvILFscCpzshq8v79KwRFup2IfaGDI2grg2\r\nygjAoXeda10Lig9+9Ka0VreXS/j8ECYlLyiM9e8j8rQkbbVIuiFHKBY2yQLk\r\ndlRh5LVxD/PJeAB3uaQxt9ERjJiDAcLqYZY=\r\n=ac0Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"eb47dc6e824d05fe1a33c55066101c99ce1fe241","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.da95e2a05.0","@material/rtl":"15.0.0-canary.da95e2a05.0","@material/base":"15.0.0-canary.da95e2a05.0","@material/shape":"15.0.0-canary.da95e2a05.0","@material/theme":"15.0.0-canary.da95e2a05.0","@material/button":"15.0.0-canary.da95e2a05.0","@material/tokens":"15.0.0-canary.da95e2a05.0","@material/animation":"15.0.0-canary.da95e2a05.0","@material/elevation":"15.0.0-canary.da95e2a05.0","@material/typography":"15.0.0-canary.da95e2a05.0","@material/feature-targeting":"15.0.0-canary.da95e2a05.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.da95e2a05.0_1667581216980_0.9457156274215595","host":"s3://npm-registry-packages"}},"15.0.0-canary.4832e2750.0":{"name":"@material/tooltip","version":"15.0.0-canary.4832e2750.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4832e2750.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"aa68557cb381d3a66d89bfb21644cb3b4d59c9eb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4832e2750.0.tgz","fileCount":36,"integrity":"sha512-EuOy+dk73gIf2xhSVPz6bqpicdq8XHKQ81P0QIy/Kgb8Tg1AGIlb6UibSOLczRQl4J5xmG9cvFvT6Y6UlYSKcQ==","signatures":[{"sig":"MEYCIQCeFZPJHkmbW0+5+to3riEcCLrnGByOVR7B4Q0WlJZL2gIhAPzOnDyBHfIaGIGDQ4vKtGJirz3DWy1oVy8iUiDzAg0d","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZXznACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrq6Q/5AXss22cRBtLOsZ4ft40PUu8nY9yfIu/2ysD3pFwh4c0AOwnb\r\narwnO3SOMFIu+QRgInJAtZgjcZ19VJHrvqM/faaOs/jNcV5bkjv7BEQwx/8h\r\nm/zfFFwWtXvQWQ9PqP+N+lEzHawXyBSVZZKHiVt4SCoKNlM0DFuWVQfRnKjD\r\nsnf8ZpsvfLVPmK98NUlMbe4OCYuKm2Ff/Ommlookzy/jabMXlNf7DPCLEHTa\r\nPoqfjUMxUQCNmpSjMG+8lm1kM3jpQ+5Ww/b7jBkL/71eEnEpht2Z3JjwCAbT\r\nQMtyGcmqZ3npIZ/wbA8JcNor3WvE2zYUv/0KO0a51ye8aGNw0bEC3lT3IAQe\r\nO48iQ6HtC5wW1kLVd5poTCBrdyppDWy16vjea3KlQhieyUvu9jpnRTYKpjB2\r\nfHi6IUEDgk5nZBi7b932oiF7kSA8QqQyWJnd061yD2HuRUcmao/1BI6YufAE\r\nqI/L5RF0JdrwGV8SgirJWxKaps9sbBUt1pY+4A6CL8LqlmCO1DqI4FoQtHqG\r\n6wLcdgiEwBsH0wedgXFSOFI0+7s+uSW2KBN2Y4xxI9Q3Z2tFEpJ7PjMFGpfv\r\nLsw++lKRUiclCn5p4A4B7LR+VFNQsxxs3R1GY3QqvjKfwzrjphxST8sbKN87\r\n2roFT+yxPoiBBhx8ZhsJ4uSIRDu7X6JTQmI=\r\n=8Zrd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"258def578bdd5ff3b52dbbfbe6f06e14b2b74045","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.4832e2750.0","@material/rtl":"15.0.0-canary.4832e2750.0","@material/base":"15.0.0-canary.4832e2750.0","@material/shape":"15.0.0-canary.4832e2750.0","@material/theme":"15.0.0-canary.4832e2750.0","@material/button":"15.0.0-canary.4832e2750.0","@material/tokens":"15.0.0-canary.4832e2750.0","@material/animation":"15.0.0-canary.4832e2750.0","@material/elevation":"15.0.0-canary.4832e2750.0","@material/typography":"15.0.0-canary.4832e2750.0","@material/feature-targeting":"15.0.0-canary.4832e2750.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4832e2750.0_1667595495672_0.7766615751136756","host":"s3://npm-registry-packages"}},"15.0.0-canary.215506426.0":{"name":"@material/tooltip","version":"15.0.0-canary.215506426.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.215506426.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f500f35b4c0c495031ce5aa70ebcd6aa7fcef808","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.215506426.0.tgz","fileCount":36,"integrity":"sha512-9/cZrvjHWouuQNSSFAUL21/KkZlDum1Fl3ucbLwIpXauHztA9jxkPMuCBfnhB+YBaRMY9efhWrrg6nimEXtPoQ==","signatures":[{"sig":"MEYCIQCMqzIEMIAtINmm6notelWZh65KHFg+V254ZkdP9daawAIhAOrXp0aPvdy1yelh2lre68Sdz8Eh4tG43rRdq3DBi1Zw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1177301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZbc/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmzhAAlw1GHFRiHU9dwbIkDkFBPc3EPJYxOf5ovVLo6wxY+DLpryVk\r\n1iw2dp/zpVKNBMbYc12I0BkflGfVUsMXZ0eqeiY7WGddzlQLNFV4YmHnUCbj\r\nJcwi4t2q5KddiWWL8i2HCHpFEZcV9UoL7WeiFi90d5kIK1Y0cPgqAL4XZ24Y\r\nvAH9wNfsFKEU4Jqi4G/lgmQ6R7ZnAxZSqBiYLFinqAOqJUkHFwFsNbbvwiIm\r\nCkkCJlNCeBFL1ff01KE4irJU7K7hRZnSCCu6K+3Pn5e4JPDKxGt5ofc9FD4/\r\nbVZwub6XPu2iFS8WuXvLUBPIwa9qnaheuoWQuoN3F598l+YUfjNVUE08tt6p\r\nybd3zYck8J7VA/wh3OY9EpC/HCd2OswScWvZuc16G6pzb9UGZ/nb/0hjrJ2l\r\ncyxWTOT34Wrma+TAeCy+/m6esXCGxn7L2BFOQV2bCM8rj8qaU8srCrEJFehW\r\nboqukQLoZBbs4EwmHGZzJ+bgNCNtI+vDSBsrFRAGgDLFKpGUaFVOYoFFcSTl\r\nU1Q56bo0ec4ZT1itmg6dTWDcjjDTojkYi+0Ip9p2sfecDoxKzdaL+LN1mE5Y\r\nQQ9S0Kknb40sutsIDIo0QX5M45mt+R7/VUszCXHkar49tHXJsOzARv3OSEAz\r\nHZtF+pQJy3sWrvioOWlHgtuN7LFoj+D5+YE=\r\n=5BOf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c7da5104ce280eebfc1b0cab2279b8acb906babd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.215506426.0","@material/rtl":"15.0.0-canary.215506426.0","@material/base":"15.0.0-canary.215506426.0","@material/shape":"15.0.0-canary.215506426.0","@material/theme":"15.0.0-canary.215506426.0","@material/button":"15.0.0-canary.215506426.0","@material/tokens":"15.0.0-canary.215506426.0","@material/animation":"15.0.0-canary.215506426.0","@material/elevation":"15.0.0-canary.215506426.0","@material/typography":"15.0.0-canary.215506426.0","@material/feature-targeting":"15.0.0-canary.215506426.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.215506426.0_1667610431460_0.5342312932880768","host":"s3://npm-registry-packages"}},"15.0.0-canary.4cf917476.0":{"name":"@material/tooltip","version":"15.0.0-canary.4cf917476.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4cf917476.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"64b0e8301f148b6f73f994d3d750c3d8cb93ea16","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4cf917476.0.tgz","fileCount":36,"integrity":"sha512-1KBvXaOnBx7YFjYgHYhQf0ARB/YbKoU9eh+n0U0c/wY5T9pItbnBIvBsCjtjYRzyPh/TlErTn9RTcJOzSgg+3A==","signatures":[{"sig":"MEQCIFHAAF18Aehwi6p9YCvNsHlk6YJ9zkfrdZm5CFcw/qzMAiA6r16rr164QRPlkU24Fci6cTE6lDPx53F852CppwhDmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1180641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZqXbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+yxAAoZVo6LYVHKYYicqWl5yZ5LVGWsjfZeJldysOkthTHpwnDvh9\r\nEF37RYjKib51AWwWn/qEGaGcd35I4lbIuq98psKENtgqF+eWLm+7cbGSkkzT\r\nRCwL/zno33C/SB8WhfqnMNisAJSO3JWDaDLQWh6LYD1eUb3PsJeHn/F5UP7W\r\niUb2nn/KrCo1xqHUb6HV7+JtifKSzW+5btplovntulQHHbSFSMoefYpMOxZp\r\nNpttJPH8E0W4JodAZ2l+UFqJJhB+o9fcvwa7bSb5gd7VXFpuBxTL57s1OFSe\r\ni7BajYJ4URrEBh4Oflj/NobFkXwn39ezBTAuTbilNJ5T+OdkVa0uBemuFjfv\r\nBbPC2GmiedKw9CzLyKiC4GvFKpwKenEDeVjq/rJ4ep+M8SaWt5nu6pSfL8ew\r\nGt30d2KuG5V+H2yDs6qqZbFsPH1DaKWF8J6nICaRaAGU9ggdva4/L7Rver6N\r\noHq/RROC1/IL9Co9ogrxKHlH5cQNREJDlAs6S0KT3Q7fZuSMG1IxUO8/psqA\r\nC4AtvE+GlsJDAI4T1P+4fIaWVP2Ryx1o98TYmMPUsV8xMGdMJIgCDe5UnbdE\r\n/67ofjZTCT7AJyJ9aJjiprRV7FCfkzXYVDWdmUMfyIQV4DorT7aE/kkt+D8N\r\nZn8DsubCAOQdrNdj9MvKM1TO6SZNK5b+nkU=\r\n=7BFz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c7ef38a54cc085b34eea4d38f143f3b65dc649e2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.4cf917476.0","@material/rtl":"15.0.0-canary.4cf917476.0","@material/base":"15.0.0-canary.4cf917476.0","@material/shape":"15.0.0-canary.4cf917476.0","@material/theme":"15.0.0-canary.4cf917476.0","@material/button":"15.0.0-canary.4cf917476.0","@material/tokens":"15.0.0-canary.4cf917476.0","@material/animation":"15.0.0-canary.4cf917476.0","@material/elevation":"15.0.0-canary.4cf917476.0","@material/typography":"15.0.0-canary.4cf917476.0","@material/feature-targeting":"15.0.0-canary.4cf917476.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4cf917476.0_1667671515146_0.03095415530584633","host":"s3://npm-registry-packages"}},"15.0.0-canary.eef14bd32.0":{"name":"@material/tooltip","version":"15.0.0-canary.eef14bd32.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.eef14bd32.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"850e98f2e3c6b1a427c22fdda6e1d23a19837520","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.eef14bd32.0.tgz","fileCount":36,"integrity":"sha512-IGGKxd/xj82EJ07jOWvKo9GRcig4vaIohB1MFzAEmiwGIR1kO5kgGkxuD7H8GXEIyNb2I4U0JYurK5Cx+POiaA==","signatures":[{"sig":"MEYCIQChj/Uam3YsBl3vOS0EyA8u8pQD89w942lEPWr5OZp0QwIhAN+TwP+g2soUW9/P/JvGJIRwVIM2F36Gwro9+DoUjzUl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1180641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZ+4XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrphA//aP40oJeSWLGYsS5Zcm09FuvYMyFMmxILlIGeEzq2V+ogM+dI\r\nxhF2O0cbNOXDJAsYtZTxatapr3DBNFjBKvXqojlpM+JdZimsiKzd/jVjSNjo\r\nP6qGB0nhA3+ebNPqoEVkpNf6d3PCiELln9KjXSd1J7MCQ3L5B3wL3g3z1SYG\r\nhrfAeUzPcHWF2dWEKwoz7RmjRK/YzzHxMrm7ZS9osULimX1iWP6sfDAgtZ+u\r\nLR0tKTXbukknueRh7YfpMFHm2MHgzX25ZJzfXtwzDO2I0oB1wftByz11UHd8\r\nehGlyRZ7WpdCyu7Z7BfnhKI7RQW/3dr0Kf6BG5+f69gW3s7ut4ezSfKy5YKA\r\napS8PQ+RjLKuf8pr6qiauDV3il4V/d+AAE8GJ0mXr8QopyPaZUovvRvQ1i1t\r\ncbpiINQGQDWOKV5/YVZRJU8PF8LtXKnXXZ2ISkcWpw5V4/hH94Um83DbhiQG\r\nxBiNuO8CUNb5q5JchJtC2dwgpZ0lWqQJS5GIvWZqyfzb2ESWMPURxVK7Vpdy\r\nJ68d+ThDshHAkdyYn/XpNYzagwVXItBTkeFaXNl9WHWK9a6FD1mTob7bvlhX\r\n/xLvT8xkFim9rQRh6N6qKwdIhlWvimdclGj3uX5sQscV/jr1vnV6uvAqJIFU\r\nBVhUZlfS3hPeTouD2K002PTAsLr+ZWpEvUo=\r\n=1bah\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"40acb6cbe1201f5ef758bfb96da3145ae3c4c1a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.eef14bd32.0","@material/rtl":"15.0.0-canary.eef14bd32.0","@material/base":"15.0.0-canary.eef14bd32.0","@material/shape":"15.0.0-canary.eef14bd32.0","@material/theme":"15.0.0-canary.eef14bd32.0","@material/button":"15.0.0-canary.eef14bd32.0","@material/tokens":"15.0.0-canary.eef14bd32.0","@material/animation":"15.0.0-canary.eef14bd32.0","@material/elevation":"15.0.0-canary.eef14bd32.0","@material/typography":"15.0.0-canary.eef14bd32.0","@material/feature-targeting":"15.0.0-canary.eef14bd32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.eef14bd32.0_1667755543222_0.19793990012382268","host":"s3://npm-registry-packages"}},"15.0.0-canary.6faa29fe9.0":{"name":"@material/tooltip","version":"15.0.0-canary.6faa29fe9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6faa29fe9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c50ab67d212d4d9b118d9ae9118bfceda76c9a5a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6faa29fe9.0.tgz","fileCount":36,"integrity":"sha512-5E4XkNI52o8snKp1crd5hRD1LY/FBEujzsH37RafRiQZ73zONbwXYcDd/Doh6tMb4BouAYdcQSG/yuwqOHqr8A==","signatures":[{"sig":"MEUCIHDeIC080UY+4DSa/8JiUQDu3JXidboUcUzCX+AndROxAiEAjgMPxwmWbaTe8miyf/qF6C8FDMe/S5yit2fLXBvBhxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1179906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaHgaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4IxAAht8U4bip3hlIdoPyblj8/Hyq1CqV9aofxsPEMfMwF2nwDJcj\r\nJifIFR9E7hiKzAheRSTFPG1BJhAz1HGd0qs39G8HBDTydabCa1dgabx5hPF2\r\nly8hp4s+xyX6DIC/odkLe6OTsqIDAheLLL8Kees8ccXy+uqxOs1Zhnn8L2qn\r\nTjfbhIMiURSc+1XI8RYylV0lTEwd90wFS7Xrrz3zim6y0IArbd21H6kIENK2\r\njQZjNChLeNhhm0uzYoh7XcRCDlfd/4rF54AWECl/JlzfD3AtzgvcZk8J1hDi\r\n/XwiS+h8bwWYHbEnKwqpNsao/dvj9IGG6uE4SE9fE5RUKE/jiUGu+XnXf2Mm\r\naNQCrYQMu2OoN/J7nS0k5RHKd/qCKMdLkg0T1dBHq3fUi/NFovSV9mqN22q1\r\nbC51oUSGKdtydqofssInSvSimfSZTv0u0wS3kOlaYLnky3qF3ExDKvaAg6KQ\r\nmGrdyr7jIIh7XcOllAGe+vEgPNeFeBhPi8BuVyXATeZG1e4NowjA2YQhmiV2\r\nVzs7iXtaUam7o4RbemvhVjR0iYw5+gXEis3jjstXIaK7oUy7/YKHf8OcOHaZ\r\n1SM88afRrFQrW2rCh4xEaDvyvrbgHjwVDVJct5ZocawmbplJ5ot5n9PH/CRJ\r\nPlxUrB17LWcsysrD998FLyYVXWEJfWT6TNs=\r\n=iDvG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1403858386443f73c0593105b5654b6ad8596a9a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6faa29fe9.0","@material/rtl":"15.0.0-canary.6faa29fe9.0","@material/base":"15.0.0-canary.6faa29fe9.0","@material/shape":"15.0.0-canary.6faa29fe9.0","@material/theme":"15.0.0-canary.6faa29fe9.0","@material/button":"15.0.0-canary.6faa29fe9.0","@material/tokens":"15.0.0-canary.6faa29fe9.0","@material/animation":"15.0.0-canary.6faa29fe9.0","@material/elevation":"15.0.0-canary.6faa29fe9.0","@material/typography":"15.0.0-canary.6faa29fe9.0","@material/feature-targeting":"15.0.0-canary.6faa29fe9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6faa29fe9.0_1667790873861_0.2562368151255938","host":"s3://npm-registry-packages"}},"15.0.0-canary.9af09b967.0":{"name":"@material/tooltip","version":"15.0.0-canary.9af09b967.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.9af09b967.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"753f693c4158e95f31a210d6474b2854282e8a9d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.9af09b967.0.tgz","fileCount":36,"integrity":"sha512-H5hBXfun/gegMfBdzOAA7PgGaqEYxA+IbGcxVwHPsFpYi5s58OAvaEd4kMOsnvyUAIBLsqjM/grfPvv7IqAPEg==","signatures":[{"sig":"MEYCIQCLveBX9eyvyzEby9tQsRPho61GXj6CIaV9W6dtM8GVbQIhAJOfyScHDLF1LvRXma8xpBSq6Jb3NHkNEA2VjXSySKCZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaU5wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUJw/9FuFcLIWwxmZfazqCNEbf8rpNwEoLvbIzxgVUak08HcpZrlI5\r\nKZyfnrcdie6c2m32uK4s6gnCsfnOr5ISMz4pCDdcd0MzT5+VUWvfypzc8u2b\r\nZG9YCw4FlTBEFFblkokp26n1NJgboQ3XAvlSJdjMzSgyanxcPah6/fWeQ5Yh\r\nAsEi9Mtp41Fa0pxlKv5f4RyEJTepRt1Wl0/LHtZ5RR1R2cWlp0vH0dFJcRgF\r\n1XgloLYDHEfmX79ZD72a0vxGZa55kyBCEsCx1oP+ebM248yI/xiG0gPjL2Vc\r\nwCvPrYTuSiDMsNlBrQka2PKvuq0RhQBWzmk3yYM/rF+ryTC/Y7nWOeaeVpwv\r\nwpoRHd7eJ5sBBPwrCvVCqPLkR6WYWCjVJvbBY+AQvBHd/tm/rng4KZEYRdS7\r\nAnLy7QFoW+NnFUtSfJkGZb5uibzdoc1+3tvofb2lWRymgTfKgUlwTGA8nCWD\r\nyBCCmHnBUDuVFj98dX11npqyEu4s7qvOTMvoLMHeFFDSA8yXugZ3/vhTjjlt\r\nEZDGDg9/yuGk8ofGAQ5Wzftolmmub/qAx+DIL2qBrAgrOjOqBFkSxcvcvrq6\r\nx8O6PvFDCzRAX8Ge79BVQ5e6p/ndQrnLrEPiIngteBOedWHh/3KV0ivmgJwI\r\nv6Cfqrlc0yoRNHJHowuVM9O/k8W8ZgaJ7KU=\r\n=+Y7F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"745e702463a22f4c5de6e94b3527530a9bdcc9d9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.9af09b967.0","@material/rtl":"15.0.0-canary.9af09b967.0","@material/base":"15.0.0-canary.9af09b967.0","@material/shape":"15.0.0-canary.9af09b967.0","@material/theme":"15.0.0-canary.9af09b967.0","@material/button":"15.0.0-canary.9af09b967.0","@material/tokens":"15.0.0-canary.9af09b967.0","@material/animation":"15.0.0-canary.9af09b967.0","@material/elevation":"15.0.0-canary.9af09b967.0","@material/typography":"15.0.0-canary.9af09b967.0","@material/feature-targeting":"15.0.0-canary.9af09b967.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.9af09b967.0_1667845744216_0.22105713749618805","host":"s3://npm-registry-packages"}},"15.0.0-canary.0f54fbb93.0":{"name":"@material/tooltip","version":"15.0.0-canary.0f54fbb93.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0f54fbb93.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e4b45ddee3e84ef56b1d6003d8b9a02606c3303","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0f54fbb93.0.tgz","fileCount":36,"integrity":"sha512-XYCYxaVbYzdxZCAY/hOp2HorhS5tWS7kbbISegtq2Cf0zv85bdT5EyZ/BjQ6y9QS/zln3GEC3Es+KYXSbH8phA==","signatures":[{"sig":"MEUCIQDVNk0zhcmvg+hCHv2W0cy8IVXj+cgrw0koQyiMzVQMIQIgEMEli72kE0qK0jg7nZtrOEfGD/SZUD8UefuALLapr2Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjatDXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBzA//XTteZGHkoSTo4tJPlOGOUWLc+lcocgDnKdazWmr4WKZSiUIo\r\n9jEvR4f25g4E06ROPVhyjACymMPgvUindb9oT0L8cRmz84+GdthMMsqCnWLh\r\nk5cA0hKT98HnzE1JbrowjFFd199seQS1Qq7TijTG1jmH3IiQIyNuH1ssk1MR\r\n8OqoiNXV2I36lTatOWu1rt+jRIfKDQRgkmjmHK+i93Osh2iHqWn5g4xsN8am\r\nuJYMNCK/t15poxyVD6ET5HpOXDZLDT0xWrPP01CVx5C1pzTL16HxKhuLzdeV\r\n5Ovj1URlatWmY5SwsUok6zXm3UhOqPloROKK+p8zAq8swAOZBwOWJFL/o1ow\r\n8HjKuDjVqeAtkCJOHZdUZEHyuyNMNNx1QBVvCiuPA7wdbOuP48VeRWCbfIsO\r\neaILHRMKbP6fHPFq/v0sZBSIuglPlUpy/rCnfbw7kEvgM2DS7v/kMDrAH6Tb\r\n277JeWoq3vY1bblsHBk5TJ2NqEW1FGSd6BW6be3GKnIbRCNzQXlOoaNVfZmM\r\nO8dkIJ+qOUJ9UDBf8HhLAExoDJmOulsUyqYwHg4NFLrZLsgMgjke8m9Ht/4h\r\nHOkzbCb+Tu/DcWxqk0RUcKv8zkpPW2FKc/Z4gCxzQdktmxmrttBrkrMZUN3j\r\nZY8oOMoFRs90Ps0Nda++eME7uS5pokCEJIw=\r\n=6lu8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5d2d1814fad8065dd869bd95c156c04ad45926f7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.0f54fbb93.0","@material/rtl":"15.0.0-canary.0f54fbb93.0","@material/base":"15.0.0-canary.0f54fbb93.0","@material/shape":"15.0.0-canary.0f54fbb93.0","@material/theme":"15.0.0-canary.0f54fbb93.0","@material/button":"15.0.0-canary.0f54fbb93.0","@material/tokens":"15.0.0-canary.0f54fbb93.0","@material/animation":"15.0.0-canary.0f54fbb93.0","@material/elevation":"15.0.0-canary.0f54fbb93.0","@material/typography":"15.0.0-canary.0f54fbb93.0","@material/feature-targeting":"15.0.0-canary.0f54fbb93.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0f54fbb93.0_1667944662969_0.7421316668562534","host":"s3://npm-registry-packages"}},"15.0.0-canary.a8d47f9fe.0":{"name":"@material/tooltip","version":"15.0.0-canary.a8d47f9fe.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a8d47f9fe.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4b11e68098a9dd72c5c7d8a4e5e2508a77e957e5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a8d47f9fe.0.tgz","fileCount":36,"integrity":"sha512-thCo1Qb2BLUn4NkcQ2oCw+Dz91quYx9LNhxF9Al0scM7I5JGgsBP0M9Xdg+CxttZ59MPUho61X6f4qPZTQzcxA==","signatures":[{"sig":"MEUCIQCVP2HYmI1PCGWvWbQJsLOr3fl4YI6h4/ODM4G6rCUadAIgM7/6vyrhlx4hp4zxl72V3mvQ/LfjUhFizXrY80HLxxM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjaypBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1EA/9ECA5g2hgSAlk/ZhBKrSDKIXh6T/73ohzsQ9JHb1YxhwtYz7I\r\nmqlJoMPRf2PWwMyrLGD8z99EkGH/rDrtPBN24//3F5P0hQjcOHWJPqK3zZ1Q\r\n3nOizTnNUyNx+3RFCz4QjS/B/E08YmORARzWY6wGgL5mSwqUVRZb+TJ6g+8M\r\nS1xleizPg7ponQcLnT4ExU6v8USe6mjxd+BJY2vhhnags0/hRC/wUe7VYyAR\r\nAEU4g9qWmN96f0M8cMJ0zAT1Rz4zjn5gfLOdjax4Gcxxn1h1W6cWd1rcc2Ba\r\nSyN5YaqQ3+V2woPm8y+rXHtUeKSHNTSFn01BRru2RWgwHjFrVRBNDS+nOP0J\r\nRKhRWeoSHDmuK/7VYJ+Mp+O5m/wZFdCs/mmjaycxE9Bi9wBD8pZlVKwFYKaL\r\n2yvxF64QAupvrLz5PMRj2Km+G3PUsUCkdLETbyml+n9uyTtbvpdNZBsRaNo8\r\n43gpn87ZgDJ/dnvtKVjdfw9ncyXGZgH9SHhLRYGhOMBG/2YmO/NAMQ91kNya\r\nHTQmACKN9/i6ZXfcXlnldIsD4+SzvlejjtUnrKbXEviWw13dg/Mu5Xm9yavV\r\nLptfo4RojK5ZRF+2Zze7QYhUqeRKrsAg7pleh/vJ62kY5CD6MAN5OUpf8wxi\r\nKrLckRTTxivuY4pPr2Ais2pkbDAyi9GI7Hw=\r\n=yux9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"37662af94525622cb00ae2dd17f31f6a93b4eed8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a8d47f9fe.0","@material/rtl":"15.0.0-canary.a8d47f9fe.0","@material/base":"15.0.0-canary.a8d47f9fe.0","@material/shape":"15.0.0-canary.a8d47f9fe.0","@material/theme":"15.0.0-canary.a8d47f9fe.0","@material/button":"15.0.0-canary.a8d47f9fe.0","@material/tokens":"15.0.0-canary.a8d47f9fe.0","@material/animation":"15.0.0-canary.a8d47f9fe.0","@material/elevation":"15.0.0-canary.a8d47f9fe.0","@material/typography":"15.0.0-canary.a8d47f9fe.0","@material/feature-targeting":"15.0.0-canary.a8d47f9fe.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a8d47f9fe.0_1667967553508_0.7125906222183132","host":"s3://npm-registry-packages"}},"15.0.0-canary.66a1e75e6.0":{"name":"@material/tooltip","version":"15.0.0-canary.66a1e75e6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.66a1e75e6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5a7f0270c2c85d83935b4877fff72cebc1372072","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.66a1e75e6.0.tgz","fileCount":36,"integrity":"sha512-CWy4Nl8FKfprzjGxO0acp/x9xV3maCDuzrrgXVZIGW/xUYe3G8pLlMNDRiM09Fe7FjnoconioQ4HtZgx0iCJpg==","signatures":[{"sig":"MEQCIGRtbaY+/skwJcmE+ET5X/Vh9gO6ciPZnCsjO3DUy4RhAiBnqemGTkmFAG7w2UUwsGdRdtjzu3sD82LRELmea+2uIQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja3SrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppLQ//TlGW3/cosvvkT3xmqI5RsTqD9r/vGUHNwCC13+YvTwUwYUhu\r\nyg5N73jStC8oSwTOMcc8/BsK83CT/HNqtOFCSrXEvjE2QQa4hGcVy4AWEJ7L\r\n5BeCf9HuYdECXZaQC3EOLR3AwrLMpVoTqbno24Lva8QufE4CCMw8+kWwy5b/\r\n833nhArOLgiD+oQ3gFcDfQYUUtF6aS0SowfGKc2dsNeBnV3zWRLCqc6VJQ90\r\nX/YMWIhjiZ2wtdM9no3KA7Roprs+3JJ5MQcunHMcb8S+mnYQXjQ+8ZSFcK86\r\ndKSkCxD2YUtdWQZ0/rZCuWZnX1UZfxTYQEW3+tLkZO13dZgEEI/ibYYrsPcE\r\nX9GOyBQ1aF3R/vMPO8cpEeTWWn9c4ef3HgI24Pvnw30QU4kgoIvAIbk4RXkr\r\nPNT/fRFSfOjOw1hhhRVYXYXriQDmklptN8SJh8pGzeDQ2PHLj5DG5k4GA7Sk\r\ngFf2zPCAxtl6u8y9QLfm3UicI6CSWuzOND1iCkIFAN4569ZkXMRsAs0exr0a\r\n1dOQU4lJ90dKqoUyqGmn8cBTRlq04zL0xUnMviaujTN9f/mQlwldSLWJk2AC\r\nbB0eF8HF0PpS3eR2vMfV/HQ+xszp0KQx2+aeFM25WFmEkloIqfeE0bTObRII\r\nTdred2JHZuBChtBW/nHt7+JZudgxhOrBOeA=\r\n=GE54\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8ed0cca778858904bcff29669c6dca407f25ef98","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.66a1e75e6.0","@material/rtl":"15.0.0-canary.66a1e75e6.0","@material/base":"15.0.0-canary.66a1e75e6.0","@material/shape":"15.0.0-canary.66a1e75e6.0","@material/theme":"15.0.0-canary.66a1e75e6.0","@material/button":"15.0.0-canary.66a1e75e6.0","@material/tokens":"15.0.0-canary.66a1e75e6.0","@material/animation":"15.0.0-canary.66a1e75e6.0","@material/elevation":"15.0.0-canary.66a1e75e6.0","@material/typography":"15.0.0-canary.66a1e75e6.0","@material/feature-targeting":"15.0.0-canary.66a1e75e6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.66a1e75e6.0_1667986602973_0.35009673399054275","host":"s3://npm-registry-packages"}},"15.0.0-canary.5e5c2afc0.0":{"name":"@material/tooltip","version":"15.0.0-canary.5e5c2afc0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.5e5c2afc0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1224eae41a643cd1d2d2eda0c984a733022af5a3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.5e5c2afc0.0.tgz","fileCount":36,"integrity":"sha512-oFKIZ/rLYO0n0UJdoPeRdmeJmd1Isf/5BVz8Sh3hJSHSrGXQXei3R30MSURwRAgqxOPWNLEROwFxL4T/XiFhAw==","signatures":[{"sig":"MEUCIQDaIVlDtQRSNQamXQ7tiAxRq9IwknmpSRToKHPH2J26ZAIgN7SE7Vasgkn5HI6Jl1wZCannNWQ3IJ9fDDR3qtLP5As=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja5TyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrM/A/+PKv7Bb5SPenQdHJ7fX1VC1auj9TrcpOfM00odvoCRyWvX4oF\r\niFZE7IGvank22fWs2PcysDEaDZ6WSZ92WzitDzT4hhj7OBkczclC8oir6bGX\r\nvDP9/JNz/dhsy2v8UCzrh4ps7DC4uJ4ztG1IF4ApeB+9uyxoGOYf6p9dvudl\r\nlfKRyr6VJA+Bct91PxeDeUS2L5ltAA6viLRR0zr0LsQH86j5w7bYPBYkLf/x\r\njTGqJFFk9uVuTLB8hKoauREOL+87kXkz/AGmi7NDjvRqIX5pMGRYqPEfkeQ+\r\nX704VdkMF7YzILDYIg19fAkGFOCjR37tnNMncmhooiwH11UBOZIr4uuINMRn\r\nH2zLwzHWR5pj6/f11PVjG4obEs1Jh3vJpyCt48snBThxu4Cj9B8UBacVuXkc\r\nDMUw9iNThSRhIyAnnraBp5kv17Hq61earAIgM3BchRuX8k+NlGoIaLWl+tno\r\nCb0pci7u+l8qptd7AupUSAGVIRf2HjAPyrEmnF3QgjfH4XjuII8fud/ezSkl\r\nUfe59TV8CvARBN3I14dOVHYG+5RoEXqiXT86RVr35S3FvZq8n1RaM8fvTdfU\r\n5Dq0Yor3geru/J+7UEHa3ywK4eK/cPBcNZ4IJ3EbnuDt4WLzQVrtTOxTvwbQ\r\n+0MGZzsXeQlm7BtH5v5sMRuGYbjtjw9u9AM=\r\n=OdQp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f14204a01be3c79ff286a8287a0ab731c371492c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.5e5c2afc0.0","@material/rtl":"15.0.0-canary.5e5c2afc0.0","@material/base":"15.0.0-canary.5e5c2afc0.0","@material/shape":"15.0.0-canary.5e5c2afc0.0","@material/theme":"15.0.0-canary.5e5c2afc0.0","@material/button":"15.0.0-canary.5e5c2afc0.0","@material/tokens":"15.0.0-canary.5e5c2afc0.0","@material/animation":"15.0.0-canary.5e5c2afc0.0","@material/elevation":"15.0.0-canary.5e5c2afc0.0","@material/typography":"15.0.0-canary.5e5c2afc0.0","@material/feature-targeting":"15.0.0-canary.5e5c2afc0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.5e5c2afc0.0_1667994866290_0.6001801614095486","host":"s3://npm-registry-packages"}},"15.0.0-canary.3e3f43359.0":{"name":"@material/tooltip","version":"15.0.0-canary.3e3f43359.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.3e3f43359.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"af594786d2443b28c41f8281adf4981235184937","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.3e3f43359.0.tgz","fileCount":36,"integrity":"sha512-Asf+zXdlojfrvwyFFkRNWF1TecJ7MEOXA21Bh6Gd9LAkGHqE/p3CDXr1cKUv1ICuLWSdrP0Kyby/LV1ZW6Y8AQ==","signatures":[{"sig":"MEUCIB2nC7gjNXv/RR0aLMahmzx4P+JLx/J5m9Th4/JIRtvOAiEA+iseEJ1EaquhBwH2E11hVCPg6HDkX3BYPozJFr/5uyE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbAe0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqbTw/+IGoSF1u+XfOmVlwbakAM8dwfCL87icO8rJa1jfWwla7usru9\r\nlktQS/0FsuQ4bg79GkWKp4OooFZqhHtQlW8bwT3Cn4ny0r6eaIncwu9+IzOZ\r\nNku2OcXSsRDTvO2O9i6tC5uvam1BKb67LCHIHAr6BBP7TkMaD2U5LWFhVF2q\r\nKlbEaVKm0peX/mu725uO5MmHP2LQEz3pzyVjX93zw42klfYSRi4DjfHwfVzS\r\nVmAX5Gm4yeA8mv/CDz9YCbNf+ejtl5OeoUP5t6No6iguStvKNiOnr2j3EHna\r\nRwDpz1xY0PrWjKwPMOw8PfH+HxuP/Qae6IFvPt/YsHBtgu5apyo9FZSzTSZb\r\nFTtLmtViyNDF0nVupuLaInNU8PkpKTZQOoL1Vw4/yW6LX24jnwAs6qOwJUAl\r\nXdd/NnnurmvyOOdYb8zLRF8B/KHPUK415eqZMULWdVsC8JHk3IV4GR4mYkKb\r\nCfmr6tf2RAz7pren7s9GeUml+ZZZBo4oHCupaR9RLzRhz8EtbOvtegfrcPgX\r\nntflg5N5UuYtwTjGh3I34BvKS29XhvXd2ePPHxef8w/MEAePu2x1ejcSU0kb\r\n06r92d+eXR5z4/1YV1JSruuUhYthr5poS05/Qj8GxHVOblmVd79yV0NP0NxW\r\nU9ucvTDx7URJknVYKYcIdHtY8YoGKUFCCms=\r\n=IZIR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"722326ecc6026aea1f22d8b4e1c9901bc13141e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.3e3f43359.0","@material/rtl":"15.0.0-canary.3e3f43359.0","@material/base":"15.0.0-canary.3e3f43359.0","@material/shape":"15.0.0-canary.3e3f43359.0","@material/theme":"15.0.0-canary.3e3f43359.0","@material/button":"15.0.0-canary.3e3f43359.0","@material/tokens":"15.0.0-canary.3e3f43359.0","@material/animation":"15.0.0-canary.3e3f43359.0","@material/elevation":"15.0.0-canary.3e3f43359.0","@material/typography":"15.0.0-canary.3e3f43359.0","@material/feature-targeting":"15.0.0-canary.3e3f43359.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.3e3f43359.0_1668024243903_0.3045264240859944","host":"s3://npm-registry-packages"}},"15.0.0-canary.3f667fac6.0":{"name":"@material/tooltip","version":"15.0.0-canary.3f667fac6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.3f667fac6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"64e77f6a7e59a5ef06aff9a0684a1c280f473e84","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.3f667fac6.0.tgz","fileCount":36,"integrity":"sha512-qBKLIcQqQTSAX7uDLBXk8yvrosZpc8iMScVTiWE4bmchoEx07JlWZvAZVdXY0V/X0OtrH24u1hLOPDx6tbUTIg==","signatures":[{"sig":"MEUCIQDKtb9F5i5BmZhhpb55LdQ65oa7uQGNZMH2f6sboPiFzgIgcDMYsaWN1Lfinjs30nS8z7nXKqt7lP3jrfa+0vzwLJM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbCSYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHLA//eY/Bf950VS138XuAoFE/jl7ZttaywRlxmI4i3huG0rTA1Poe\r\nAglWGWsmcr6z7+mVLQGe5krqr6hwg+hhjrBfh33fUrZ8rwri/cg0eZ9J4uol\r\n6gtwMkvA81kIBaPbuMnrGxbVLseSfSvb/loUnM++jSfl3e7jVKHnkTbmKK1T\r\nzHxs6BZerGSNGi6Z85UP1LqDjiB5qOz6/Pdl2Cr4tieeQvgBvf/mKLeT52OX\r\n3P6s+18RCbAoMf9nVXw/SNNfW2AwLvHsB6ahvmrxUOhGuUZBZWX47QXBr2sq\r\nHwDUFae4zcOp5Ij0vcGOjHHAaWzjgbcs+cEZd+TvxLvZ1oujIISD3M9bzgGQ\r\ngNX7TSRac6ShsdScDA+KzJCe5SzTai8r6bj7/cD9v9fTeH8lEZnfOu1I2dYj\r\n+/PQAwlLDqcPikYPGc5QPR2d7Ed0kBptIcYukl1CQXkmV2FOrUUm5dfV+VIb\r\nIqwEqt5B/baDqKzvCeEoLd6xaSf6xTHOe2y/WHNrYQD8RUXDKLEx4dLKI75L\r\nWtvERaU4WDr/vRu6B3u+PFJNhtecfyArNYAeXewblm2dKJEHflQgYku6yhjG\r\nPt5vmLgkR5CWzRzCOZ8DGZAJ+2VlYvT/NfxKW5YBzii4n7BTJUOw5myBWs0f\r\nduCnil+1TYLTsaCUfss7AEknIswv9mNN8qQ=\r\n=1GX3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0980467335d47e19b4ec72e32644ba0a08bc0c34","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.3f667fac6.0","@material/rtl":"15.0.0-canary.3f667fac6.0","@material/base":"15.0.0-canary.3f667fac6.0","@material/shape":"15.0.0-canary.3f667fac6.0","@material/theme":"15.0.0-canary.3f667fac6.0","@material/button":"15.0.0-canary.3f667fac6.0","@material/tokens":"15.0.0-canary.3f667fac6.0","@material/animation":"15.0.0-canary.3f667fac6.0","@material/elevation":"15.0.0-canary.3f667fac6.0","@material/typography":"15.0.0-canary.3f667fac6.0","@material/feature-targeting":"15.0.0-canary.3f667fac6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.3f667fac6.0_1668031640563_0.13841022736566755","host":"s3://npm-registry-packages"}},"15.0.0-canary.faa28c1c5.0":{"name":"@material/tooltip","version":"15.0.0-canary.faa28c1c5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.faa28c1c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"24437346a714d4a8eb2ee9ebff7b02a6a8df3009","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.faa28c1c5.0.tgz","fileCount":36,"integrity":"sha512-uNnTCwarI6jpev6A0p4EsnXXMHAZ9Dx5QVdV5poQc8jWv4pNHFTXRRB7rzvVWCtPpigG8lhZCUTCcJXQuPqlAQ==","signatures":[{"sig":"MEYCIQDKJjWBbHSolR2HXYuyyH2KYnqgDL6HxunmD3eJxQoMnQIhANsa1TiqpOtpKhqpdFyi6T2dMWjDdc19P5wwcok4YtdU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbnovACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqqNA//WryXLFl4knexXJn9xXTIRjDPHNUOVt6syJI8ep2SvTNEX688\r\nVXu30iukkvnj9jFRt6rEniL2snrgP27bldjNKWOsCZziOcDKINVoaJ6+egki\r\n08ZsMI7rewQDaC1PdJbBjGb0Khq7N3j9RbGE4BFSRebVDFTrZJQFeMX9Wjvc\r\ndy4Aq5yaOoJbPs21blgY0c2+SoIV4GwSSpx0g0u55JboZD4eGtHZrTqAhw1P\r\ncZFdD6n8tZN2HuBaiAZ1bkqQYaZOCgzZBMSJCs9y2vEDnqIgW2tAN8w6oW/m\r\nJNSCrLi8mXOnxUGa22638H+JR0ehtlf385tv8JDu8SNR5XW/3rL9gW1HrcSb\r\nZVSBZqxT07XWj3lJNo6EJrAYcMA2YgHMi9iOfpyAJhpzRHD2J8GSHV0cP18u\r\nuJVn1Wn1SSHDAE8kdg2zXMwzRxixVLNczmrtwvn8RWWmB4amE+6SIz9vj1H/\r\nb5joT7/k+wjFijD812kIxWfssuYE6uIdetxG+QLKlMF899k3ADpHDjhquqMy\r\nkhOHiWECvjQmvkNuWnDMsD3Ez8V5/4DcKVBAWICb4ORqFlDyGiaTUu03de/x\r\nM8zAKWl2BhNgVXywXlQpKbacemeO68WNLPkjU+EOKCBMD78Py5djH6KESrYp\r\njHVqJHH9bR0SforXbdpDslnpp00lro3h8+Q=\r\n=BDU8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d36350ee1c0fb11d053acc0cd521939199fd696f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.faa28c1c5.0","@material/rtl":"15.0.0-canary.faa28c1c5.0","@material/base":"15.0.0-canary.faa28c1c5.0","@material/shape":"15.0.0-canary.faa28c1c5.0","@material/theme":"15.0.0-canary.faa28c1c5.0","@material/button":"15.0.0-canary.faa28c1c5.0","@material/tokens":"15.0.0-canary.faa28c1c5.0","@material/animation":"15.0.0-canary.faa28c1c5.0","@material/elevation":"15.0.0-canary.faa28c1c5.0","@material/typography":"15.0.0-canary.faa28c1c5.0","@material/feature-targeting":"15.0.0-canary.faa28c1c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.faa28c1c5.0_1668184623064_0.006005187075615259","host":"s3://npm-registry-packages"}},"15.0.0-canary.a868c7866.0":{"name":"@material/tooltip","version":"15.0.0-canary.a868c7866.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a868c7866.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3753820a46f274cf5269ca02a6fec1d188832037","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a868c7866.0.tgz","fileCount":36,"integrity":"sha512-J7stP0vbu+KPE+rKitL7pHhd/WtFPO4vnEyDni2QDmSVp8rEWspSwggWihK26ZTZ87JmZCB+u1WgOcJmhqaYdw==","signatures":[{"sig":"MEQCIAPHmFg35zOMa9w9fW1MDT4h3JhG15Hh5BLcl7qXogSzAiBc/GPuOui+B/nw1BwSftdZpxaN22PMs8f/jeY67ShmFg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbnpgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZQw/7BRJ2g78WmZuZcXAHgkdCz4qYluOsxw9mTPFRp3vb0UGL38HX\r\neQNhvU6i6q+NZk2o1kYtcEX8ToreVzngEBF5tiz+Ed74P+PiRTtrz0qj2e4j\r\nALVupJLxsoqQP4SyHJrMkdbZgFsJfRVVJKcYSPin8AfoxeEw+L0zYxZjzf+o\r\nJi7Ofkx9V6nXp0Lc6wr2RUv/AJTRq/EV/8r695pnlvV95PoTHRwO8wgEUsLl\r\nvabi+obzm8VCSWnhqFmhDVvQL4UrRqCBG1pOdnDYm3IWOCHbHb9QRqAAD2IN\r\ngN88vgITbK8qmmssz3NhNkEc0oXHjmvYhytY/JEFGt3RkSb55iEia4AkuZnP\r\ndgvtrZ2UZ4lEXSSJ0yLqWjoAQT1zKuj76l4tUX1LmGky8YFoYZTvJlTx2dT7\r\niBdVYfAEqFWaahZ58uq+qaDxgR4c8//qTctYuH3awoFD4loukW9jwsqoScBL\r\nbM0QZfBmVGAmbMd70sa/xpNg9HEWnmLwNI1zCBHA2+aKkDuGN0O77JPSqh22\r\nwjYzhkg1XdNhme04PpzX3Obhkh6bVw0uPRVU30qUI2qMF0nezAjCdOZHegda\r\nTb+FHuGuGDiC+jrUQYTAprbG9iRbEuNQ/cMLDEmSHVUn0bxCFD2LqsGg9lpr\r\n/f5/1OuL2a7IqEkz2z95e410+0kWiSOgliQ=\r\n=/SG9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d35416d7d3365898437e980f43ade48e60904e85","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a868c7866.0","@material/rtl":"15.0.0-canary.a868c7866.0","@material/base":"15.0.0-canary.a868c7866.0","@material/shape":"15.0.0-canary.a868c7866.0","@material/theme":"15.0.0-canary.a868c7866.0","@material/button":"15.0.0-canary.a868c7866.0","@material/tokens":"15.0.0-canary.a868c7866.0","@material/animation":"15.0.0-canary.a868c7866.0","@material/elevation":"15.0.0-canary.a868c7866.0","@material/typography":"15.0.0-canary.a868c7866.0","@material/feature-targeting":"15.0.0-canary.a868c7866.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a868c7866.0_1668184672552_0.4628594741487806","host":"s3://npm-registry-packages"}},"15.0.0-canary.602fe8efa.0":{"name":"@material/tooltip","version":"15.0.0-canary.602fe8efa.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.602fe8efa.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"61a690f81074d63088098d340b376ab72c7c3eb6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.602fe8efa.0.tgz","fileCount":36,"integrity":"sha512-u5X7NVQzPqawt4kPTPTkfX9TiuPHNHHI9WelB9vx2R710kjglNdnaQiT8qL0sVLXgPmvrDs3gyw4p8X5A/Bonw==","signatures":[{"sig":"MEYCIQCxyvOq4sBetkH9UnOvwJkI6m3WOrcD2e37Tu1v6ygxHwIhAKnGV4Z4/zLMMqZedtVNSLrUwbzpaWf9+rc0yivy4qMa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjboKdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/9g/+O5PX9z260pRircw49qJ8rJzMd+4Q6EETSo2gKiFGcusgGXD4\r\nsWgakkezTYGhO2hZ8lAhm1Rrw2gT83w/jPegGKF3Mmjc1etGC0I+5onU1cXH\r\nMviPbLqUfxzimzUjwDP7FJQ+zmd1Kcv99NiBBIwRnOLbwRG0j7yJ1DR4QY8n\r\nFt3VPgF9PpbKQZE0kcZmdURE/xp+Q8GYid0F+kUHt1JD8gl6SJlrN00jjaNW\r\nbO8fqY4/9wZCk/meSC+NWYfKa/1FSTTjjYIeEeLNilZjI9HtMzDn5UIEHLui\r\nm2JEFkVhq20sPMkwmYGoDVhBB/AUC1pQklqrvohLywN5D6lq19Fc5C1+DJ7I\r\n9vcHGScihEUdSqHA2gNejZNFn7EK2T7ovyxTyDxUwX77gOtY/GFYhZzuZwLP\r\nBVcjxA7m1QV54Aw0/I7uiSKV88IvlOk/TwPUbF0T4ZG8TgodxgKdiGXQP+qJ\r\nxDNjupSH7qOvLAegzWORYPhH8rzcNs5Op1ccciFOCykSN0rv4DyUZi9DTAHW\r\nz/ZRZKWgfUSBsAU7QrVDUMhqEscWktnqIVQdXRdQz/Anh2Q+OVuno0vdaCBx\r\n1VOPqWzFgNFg2NlIDVwon2JbZ9PjYD2N82s4amRCyU/EckcMcWjQqkyGNVF/\r\npIJvj7HgOI7/yMjXmJBrK8grRprWOCHcI38=\r\n=t+yr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6bdfaf09ca41b2fd7e3db4797bc2f536f8fbbade","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.602fe8efa.0","@material/rtl":"15.0.0-canary.602fe8efa.0","@material/base":"15.0.0-canary.602fe8efa.0","@material/shape":"15.0.0-canary.602fe8efa.0","@material/theme":"15.0.0-canary.602fe8efa.0","@material/button":"15.0.0-canary.602fe8efa.0","@material/tokens":"15.0.0-canary.602fe8efa.0","@material/animation":"15.0.0-canary.602fe8efa.0","@material/elevation":"15.0.0-canary.602fe8efa.0","@material/typography":"15.0.0-canary.602fe8efa.0","@material/feature-targeting":"15.0.0-canary.602fe8efa.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.602fe8efa.0_1668186781000_0.09478585406773066","host":"s3://npm-registry-packages"}},"15.0.0-canary.558c2be62.0":{"name":"@material/tooltip","version":"15.0.0-canary.558c2be62.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.558c2be62.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"12051e7f09fda1ceee2031a6689d248e292270ce","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.558c2be62.0.tgz","fileCount":36,"integrity":"sha512-KK3gK29z8M/1EOBGVIKKoGsD72AnOBdZdOfek4LJsO5hld+syBsz2I7+6BzOIJ6m7S6zJaVxeOWrUbQhQYj3kg==","signatures":[{"sig":"MEQCICzt7svkYdR2aKz2U49mRFGw4F7OIFShLFTZeD/AwcK7AiAXEWP642RdODLrnBNY7AVtlH0PFx+jJvzC91+pnZ5knA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbtDBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouoQ//ZxpS4/vQ5hfzMOwGmt2YEAHZSy/SQ359zrKGdllDKCli5xW+\r\nOx8FJbQCpTlh2THbKOkUq+O7BwXIK7edcUXZSEffJ5+ekZS5EYrmyq7rsUVF\r\nn71ST7RhW65RH3vchPmmCQAgXZHWQhCof7asbf0c8nQSHzJ2Bn9lg8CK9/Yk\r\n/CYEnvUWJiz4k6E2BfXwb7v/vyg0YK71vusBYOmeN1l/F5Z7rOgw2R2vfiUP\r\nQQDH4HrZg25k20uoRK9VDncx/iJ8RJJ+I2sa/sS2smf0Ynh87oxI8CCFHRqn\r\n7Y86biZbaFKygdLTvNWnTnTdp7ZFxD4s5QbbKQ083/Xi5mu/1tA312toe1ER\r\nRTYz/1r6HaI55NQtqIc5KoeUj9uXuvhWh0yxVUtIZZE44P8ZxzYifK9Lmyp3\r\np6Pc7JO8Q7FqU2WAuSeyTYO1JGks5hvp7bvyBzzYJhIyacAknUof3KWa9rM9\r\n6wXImKJcTnyiqoEmNY1Bp588xmZDURcao3irbHywoTqq235Y1VLmbToR92hp\r\ncqn4rpSXI/+Ityoa2m4DfiH/1ZM+vNpLfSiG81nRBWCkjYh7PzqKP10YZY97\r\nzfMlTSBm0PDBDRjMZNLYzbziCFr4LB4pppgIb5dhMeWY/sVAKDM94bmYPUgQ\r\nYV5ZqQcoZYfUHvfIBk8agN9aeoGF8024kf8=\r\n=VsO8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"64666caf2aacf562ab6ab5b701e89f28a9bb5c74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.558c2be62.0","@material/rtl":"15.0.0-canary.558c2be62.0","@material/base":"15.0.0-canary.558c2be62.0","@material/shape":"15.0.0-canary.558c2be62.0","@material/theme":"15.0.0-canary.558c2be62.0","@material/button":"15.0.0-canary.558c2be62.0","@material/tokens":"15.0.0-canary.558c2be62.0","@material/animation":"15.0.0-canary.558c2be62.0","@material/elevation":"15.0.0-canary.558c2be62.0","@material/typography":"15.0.0-canary.558c2be62.0","@material/feature-targeting":"15.0.0-canary.558c2be62.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.558c2be62.0_1668206784973_0.8283839314778036","host":"s3://npm-registry-packages"}},"15.0.0-canary.b5c13a7a8.0":{"name":"@material/tooltip","version":"15.0.0-canary.b5c13a7a8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b5c13a7a8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"02424689f172f0275b4d8e50250460cde77f8f0f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b5c13a7a8.0.tgz","fileCount":36,"integrity":"sha512-8/0M0kiJ6lhyHhtuctHI6rfdlOv8HqMybM3GOzpP62LHaOp19JUD5x1cT4LJlxyusXKB73ZY4T/0kXGD0aPHaQ==","signatures":[{"sig":"MEUCIELPHMu5DXL+Nwz2cBmVwuQx8uNbZIqNLhsa+AnyG5dIAiEA3cV8SlPl3UzyCcoMozuYd7WPHfFId1K4qe+Jp0NC244=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcmXzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmJQ/5AS5TjMRKwlPgrEOeHjbkZCVgmf3jsKK0AuxXM6WcspYgZwe0\r\nGgxeCLzAu0ZGmX8JkJZzJv9Q1BPhqwZo7oukYONWLae+NlZMNf6HQsT7hRtz\r\n8/zd14kCtCP9mx6+3/GfSOeQkngEk2Ubo2Qa4pjLTvWjQHtNNhYwt86CP8Xn\r\njEZd7K2K9EIP2fyC1RNjqP/qE5ZzXAOZZ0hBO/1KPxrNr2jpK++txEP7ubhY\r\n5omYeLF9BDgQUv3mDX22pEewhhX3ak31rToEqlwsVNNIyFtU9SKtQgJse8hm\r\noBLUCmG4u/A86DsihXAkPuL9RphVs1TmCDUApRCkEaZ/fTjMciFrk6fsPdEW\r\naUBjBfLK8yZwjz4Zg8FBm7Ed/7mjOO0SUI005muGtBtPum7VDpvr+wIIehxQ\r\nAjAWCrsTbof++OU1ePEEpHAOs1SOvJchQ5gAa2UQGYakhGBXWhuxXE2Q3Uk9\r\nlyjLGAxJwxGRuu1xNngI+VDzjWDhuAMOnymGGV/Z3JyPu2VWRL11uHDrXht7\r\nBjyEXGrdY13wRluige3TPJ/Q9sxk5ihJuUKTP5BGVrNOQis5+YR8XYWbaDeT\r\nSRv5XbdraqSozbHDLs3DKQzuj3XZQVspDH4pLbdFGQMeg9G0YtJQhRzup8cF\r\nSn3vZzulFuJvKwpnbVJDrWEoF8/ilq6jn24=\r\n=95W0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d7e326425877e3ba53b64755680e3503090a01cc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b5c13a7a8.0","@material/rtl":"15.0.0-canary.b5c13a7a8.0","@material/base":"15.0.0-canary.b5c13a7a8.0","@material/shape":"15.0.0-canary.b5c13a7a8.0","@material/theme":"15.0.0-canary.b5c13a7a8.0","@material/button":"15.0.0-canary.b5c13a7a8.0","@material/tokens":"15.0.0-canary.b5c13a7a8.0","@material/animation":"15.0.0-canary.b5c13a7a8.0","@material/elevation":"15.0.0-canary.b5c13a7a8.0","@material/typography":"15.0.0-canary.b5c13a7a8.0","@material/feature-targeting":"15.0.0-canary.b5c13a7a8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b5c13a7a8.0_1668441587676_0.5303402602503593","host":"s3://npm-registry-packages"}},"15.0.0-canary.a6e1c0702.0":{"name":"@material/tooltip","version":"15.0.0-canary.a6e1c0702.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a6e1c0702.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7491596eb14f1856d1e4da9fbb9ad3467da4deb2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a6e1c0702.0.tgz","fileCount":36,"integrity":"sha512-rKbQzVwpYbIgeQR5RZRipJkCYP0e8Ow96NiXilQuJ01HBSGiliOLCBlHcLWoCqceNBnCdch8XIAcGhuSb+kBNQ==","signatures":[{"sig":"MEYCIQDOJKHxfIXYoarS5kO5DpAX/7TY2nwdr+VLcQdquKoj9gIhAMkYKTDs+v25J0XM0gYbU5GC/cBHjvQnFzHxRIwEi7vD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcnqvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnsBAAmQh+SnB4t8PNQusZq08IspdkPiDGVLWw/YjPAgELfUWYnoUi\r\nssCo0J/NNDAT2+yiGakAPr2LPOfsnEm2rxRcuUKp5pmrJsE7lcfKvQNiL6vJ\r\neou0CE4LDdKTogaHQ50Fb1KOTGVgUR11MeWyUpzFGXd6FOnrKm0uqERdz7yz\r\nb/la3K39Ht/vzsZ5uAosFeXA8de4dl9OjFrLmEV4F0pXzE3QwdWhbDINqNjk\r\nAdztC0zbnr02bdjfOEQ3GYPEgSrFqOCjG74JolXIZWKkrmXXTZ+v/gvGIrIC\r\nBnyxYTBOzpWLTIjYZ5f4vJZLJ9heB9Qm7a+CkueBNdWJmeek+XH5Iuqm/mXk\r\nJCis1DcKbYSggGXRYgWS4nvqPUcFDwGdrisjwaThy/zxmcDgkcKf2eQZSnkk\r\nJL7CTf14ZLi2YDqW3p3Su4JwkmA5cM3S1T5IFJAuJAX/E6ggWNkiGny1sQpw\r\nsWjSqdvmvE96x4om3vLbc40xDjSLE04epLnIp9cSsd/aPrE0zgn1xe3oi1oG\r\nGRt+7n8s//nAlkuYg4UQhltX3Pb1AWKgJQZ+1WTOhuOEiNci/DiVX5YIEYL0\r\nhnjLVNDPcyy/i0jlxfG+3LrK2OfNJih50GSlObIaaU9KaCFCegfZ7GDPhZXK\r\nRnJmTsmi69tFBkJDeqT5Nj2MHMh3pyXvnR8=\r\n=d3gZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3c1ee7333cad68ece747437d4bab1a737d6ea96f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a6e1c0702.0","@material/rtl":"15.0.0-canary.a6e1c0702.0","@material/base":"15.0.0-canary.a6e1c0702.0","@material/shape":"15.0.0-canary.a6e1c0702.0","@material/theme":"15.0.0-canary.a6e1c0702.0","@material/button":"15.0.0-canary.a6e1c0702.0","@material/tokens":"15.0.0-canary.a6e1c0702.0","@material/animation":"15.0.0-canary.a6e1c0702.0","@material/elevation":"15.0.0-canary.a6e1c0702.0","@material/typography":"15.0.0-canary.a6e1c0702.0","@material/feature-targeting":"15.0.0-canary.a6e1c0702.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a6e1c0702.0_1668446894874_0.6382265483265281","host":"s3://npm-registry-packages"}},"15.0.0-canary.b6f8a06de.0":{"name":"@material/tooltip","version":"15.0.0-canary.b6f8a06de.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b6f8a06de.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d2723cfaebcc3e54757d4ddaa1131caf1fa6244a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b6f8a06de.0.tgz","fileCount":36,"integrity":"sha512-OEAcDfP0F6CoRmydg8PSeRecz6dBD6hC2EJBCayfCruXKCVV1VbG41hadEjidK2DL2faUqnP1ehbV0Ho0pShDQ==","signatures":[{"sig":"MEQCIDVtBxot6nydDO3YQtDo03ib70HBMIgLfRHqLxXSObmdAiACfE2js6n9YYlq0kpPuk9v0tkrcmEpQTwTVhZpqvf0qg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc1wDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+dA/+OsRwbIRUvZSiYvAN9QpuIaUvyIU1BkTQhi6mgdtZekTobtow\r\ni+ddvRpuicPb4S9eMmDOCNfiWW4HVvc7Trlvm4oL6WvEMTrs5ztnMEsafXvu\r\n66m7fTXpaPe4dNRL8kK9QlV240MaDBWAHGDSCOm5k6/xUZq6LAQ6ysbXRhQJ\r\n0syIN+rwK50GXqCm1e/kwpGlIuAZ09mTEL8QxdO4iaN0nTFL+9q3XXHsNgMJ\r\np9BQGKwYP1Ex2GT11ofwpd0suNCZmtq+ruNNH06yQNdNemRHu34WPTB9LWps\r\ncFZmrrjbyGDB7tdwkRG6XGqeBn4+AvdUBb7rdfUGFJl/T/DNFHzEPxhPFPbD\r\negYlOML9VawLisy+QmydWW5pDmLYsO20OzMcZWXboOk4vl/PRBUYVlhP1IG4\r\nKyY21X+r7ZQ+dL8i68PzMIZ2Z+tRkNWiOBh5RpcKRzZFVCKz6YefrTuSRgaM\r\nW2ZxLexgu/G2k2IahfkcM8b/q86ardZvVgHzoNMwB7zp5Qti/bC0bnd3XJBP\r\nrAiQnigG45GEqoOIODWvD8OXxxFovEcoeRQpOWEFSDiUYU+Bp9eXsm8jffCf\r\n/P0lfGNytx/gMBlx6Kb2ZJsLCtCELbzDrT9It6XLeONB45X2fOH324AfAEds\r\ncx7vmOAnA/Z8pXagIJBBNSsCz0rBnBipPaA=\r\n=RQxb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"92681882b16f14e6a94df4b1ac983fa86e242640","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b6f8a06de.0","@material/rtl":"15.0.0-canary.b6f8a06de.0","@material/base":"15.0.0-canary.b6f8a06de.0","@material/shape":"15.0.0-canary.b6f8a06de.0","@material/theme":"15.0.0-canary.b6f8a06de.0","@material/button":"15.0.0-canary.b6f8a06de.0","@material/tokens":"15.0.0-canary.b6f8a06de.0","@material/animation":"15.0.0-canary.b6f8a06de.0","@material/elevation":"15.0.0-canary.b6f8a06de.0","@material/typography":"15.0.0-canary.b6f8a06de.0","@material/feature-targeting":"15.0.0-canary.b6f8a06de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b6f8a06de.0_1668504579227_0.05561552064210051","host":"s3://npm-registry-packages"}},"15.0.0-canary.0163f3ba5.0":{"name":"@material/tooltip","version":"15.0.0-canary.0163f3ba5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0163f3ba5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f03e269d5e3afc5aa8ae9d8346307b0ae0038fc2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0163f3ba5.0.tgz","fileCount":36,"integrity":"sha512-19pDGggut3QqvWz5pT32BX/iVvHKxNwGUYYYRtF1AHH+/BqTS2Ll7wmz+p9xNR7xRAPjB69aZc2M2sWfstYLrA==","signatures":[{"sig":"MEUCIQClHptuw1LIgVqjVtYdOKk+nZu6ok9zI9Z1lgOr3DlmVwIgbKigz14CcK4NQKHKuHFuOo+5b9K4ZNkS0hSWJSJYnQg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1182452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc9RqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpM6Q//cLm1VSyiCZ89Pn2wAOkWNtnbIxuKdGoSK5XE6nElN0SdkkT6\r\nzP/D2Wyx7T11g+XMI4uhsaFEUhkNk5HXiMMkHGY7+ireqtt/obRYTUOTx8jj\r\nNtQ9j/LKhwSzvmW027EKdyW0z7QYYrZynyOzPghDir3odo0KrGY2s48TXgtZ\r\neHe05Vas9+CDwUQj4F3heY/Ko0dzSqQuEYKntmTDExucVIVCH7W03DVYNuM8\r\nqY9gQYegoGvbPEd4VKXGEkRWSBsyGAmtx374C3s8QRMqJZ2p7BMnvNxoXx2m\r\nYBipBF/8ArB2SsNpVVuIXerMeHiLZYcQJibCLXYskGZYNK2gP8djIQVvPD+H\r\nhmF856Pi1RdksmdFhwMLdkO//kj5KL8vHucvUI6pkS5lmU3QOxwgHkkE2Qdl\r\nJ9GjD5j0xBoN9DL7sTRkn3x+aKv0wT1sTLKkUTx4+Ui88TETpFmzHkqfg/nc\r\npSPYTPULUjrxun6h0v2S8JQZiGMgLOUQf5STE/kP6RZTIq2XBdsM1p7uUvD0\r\nSpm6v2cMIgy71UFh3b6tkoaBH7+E8wUnXGOn+FyZes3Yb7hXReHCb4r0TIDv\r\nbzphddANX/KIixfIm2vZByvejnO8f0XpSXXG0yxtBi/QCwEszZF1l1cpltw6\r\nhV2CpSWNYQKSkQFer4oePaihYROFpeH23QQ=\r\n=RL3R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4198cde77ba33a68c74eb5e814d92df422f464c8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.0163f3ba5.0","@material/rtl":"15.0.0-canary.0163f3ba5.0","@material/base":"15.0.0-canary.0163f3ba5.0","@material/shape":"15.0.0-canary.0163f3ba5.0","@material/theme":"15.0.0-canary.0163f3ba5.0","@material/button":"15.0.0-canary.0163f3ba5.0","@material/tokens":"15.0.0-canary.0163f3ba5.0","@material/animation":"15.0.0-canary.0163f3ba5.0","@material/elevation":"15.0.0-canary.0163f3ba5.0","@material/typography":"15.0.0-canary.0163f3ba5.0","@material/feature-targeting":"15.0.0-canary.0163f3ba5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0163f3ba5.0_1668535402293_0.8815517102375141","host":"s3://npm-registry-packages"}},"15.0.0-canary.66c5cbb94.0":{"name":"@material/tooltip","version":"15.0.0-canary.66c5cbb94.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.66c5cbb94.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fcba41985b3cc349925f98041aa54a43aa2ae312","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.66c5cbb94.0.tgz","fileCount":36,"integrity":"sha512-Q29okksmFR/KSF2EnI1ZxXSVyAF/eNz/jU52iorn/NAftzg5gtHOc86QJgvnHqgUDwzP3K/YL8fhv7iVGtm5Hw==","signatures":[{"sig":"MEUCIAYLUx09k0GjEqvB0FO/JokSy61ow0FDOxEpgKvXlB4NAiEAyhMr9b2FjyIGhwbsjqpN/tYmyd5XXafkmQKZEKAl2WU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1183088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc+kOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzpA//WTx1qddmkrUC67pKmzB07Kqyps6wGnv0BCdrqzDW+Lv3NaCl\r\nzA3uc/+CyylXQHqlnX3SfFJP81VLQ35OxTtgSM+wYmXAzW3Oz1wWcRlHUion\r\nng2Trppg1qQXx0CkIUw91uMMg1WzJmDzwR+r/JwuY1tqGlpcf0wgwkcbVR9Y\r\nL0Em0bJbII46DjIKtIwEpDbGleqriHECCR/Ij6W+7sffDGCfY0N5QNptyf1g\r\nsuglT/Wyh2aoy/MThSpue8cfglk4NB2pz72LqEJi1i7NZvlQZmOejQHOO6Id\r\nOJDjZTVYml00xucHUM9VLcdJ+7lsWkbd8wrlZLi2PGMVvoBedEtE6+/nnVGF\r\n8xkpLVup+3oaqmFyO2+7Oc9f4svH8RRHmucCnTzao8JIT6Woh7al56Tr6kdO\r\nvbAa5e+jXQKUbVgs+qwQwicfBQnfnn5wyMTGyQ04boEcYo8LoaZmgg+/IXuu\r\nLH3CGQ7NjEGGAPtjKw2bfOz1PkIYmbI0i2gf/Mb0Gf/puJtIGNziQkcXyepV\r\nNL71hyeLnJaBAWMiTQhEOKEzMqtuBH4AjgBeVBc1QZ8R1zOmNunIe9QNJBZ8\r\no9s58cWcy2YdhAUYrI1nxC2JGeSq3pXz8wXf618LbppEolyN5n2F53wawWXa\r\nkNRkgWfJOMW/jKeyEjCQtjXKQ8F+GRRrMnI=\r\n=6pvH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5d01716a4e4556657b2c4ebb469b826660673327","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.66c5cbb94.0","@material/rtl":"15.0.0-canary.66c5cbb94.0","@material/base":"15.0.0-canary.66c5cbb94.0","@material/shape":"15.0.0-canary.66c5cbb94.0","@material/theme":"15.0.0-canary.66c5cbb94.0","@material/button":"15.0.0-canary.66c5cbb94.0","@material/tokens":"15.0.0-canary.66c5cbb94.0","@material/animation":"15.0.0-canary.66c5cbb94.0","@material/elevation":"15.0.0-canary.66c5cbb94.0","@material/typography":"15.0.0-canary.66c5cbb94.0","@material/feature-targeting":"15.0.0-canary.66c5cbb94.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.66c5cbb94.0_1668540686720_0.8709489358453204","host":"s3://npm-registry-packages"}},"15.0.0-canary.b01136063.0":{"name":"@material/tooltip","version":"15.0.0-canary.b01136063.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b01136063.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3665a9767c8da7f1fccea521d716809f44eb6671","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b01136063.0.tgz","fileCount":36,"integrity":"sha512-z3Zsux7t9/x90MvlOl3VwcZWWwmWs+3DS5NRjz6XC23o6/XHJeJnMMUV9IVE8wvnHzrdAuUmA06CX3uTZ2cftw==","signatures":[{"sig":"MEYCIQD3Bt146nARMpMyv3N2TYXsKdhxu/UjW/70sxohZ4umgAIhALQ0IQao69EHTE7zliq2VKTi5tWDx8aKvKoOGzSKsHrN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1183088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdCwEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZAw/8DIki0McNlwunNNU+6gBbB+x1Jlb/OpV9qaYFgKht3bZLvcjh\r\nWM7Se6MXbf2avpy9w8I434Tt2ll2YtWPff0ehJ2kVwItwVGgSo4rdyZy+wOm\r\nmhiMDm6Z1l5c7WVXNHCXNTdcQvAZpC43KexDV1NjPSWFnG2pPjhrI1ct2sBQ\r\nK7kEbjNLTnCCl+YPqDlCIPQnv01foC+7uMoWhwxSid+NEWN10qm3XkCePv/o\r\nxPdAquV6SEG+0ogKkPNd8Kku+vZ+Gu7zJN6ZExzx5WVAfDK+SzvlfU7MMozG\r\nYZqfovtb6APGRMA330kmvVzaGOXbzVOYllNVaMIeRanPen/1XiefgAV8e7+N\r\nPyfIs2NHSgjr0bwa2qFJOpJVhWNJN+jPkucXU/Cw4l9C9S8p9AQOpDBQkJ0v\r\nXHYNAQ28sKoN+IyY5B/k6wlWXAIgmmlX+Foad0Mh6dnL59B/9zh+yQ/xUGr0\r\nGHkFIV+L/c47OBiYY2+hTozTDcJRfmsfnyK2OgqJKxX+7T1MpZwb5JQzViBW\r\ncFMShezeKAr9lC6PxT+zfwmoTcTGHIUGXMiKhrZDJDxrAB0QFi6ieLcc6Lbf\r\n89V5127CWJNfxta+AFw2K0TTn10jZxvak0g5KYGPe0uWvvmNcAQ0ULML9Wjc\r\nFaFN49qf3SY/VIaOvS/ujI90IQ1mZ2c2i+w=\r\n=Rjbh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"125921cea459cbed7dbe3e1c938761a0cc03a263","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b01136063.0","@material/rtl":"15.0.0-canary.b01136063.0","@material/base":"15.0.0-canary.b01136063.0","@material/shape":"15.0.0-canary.b01136063.0","@material/theme":"15.0.0-canary.b01136063.0","@material/button":"15.0.0-canary.b01136063.0","@material/tokens":"15.0.0-canary.b01136063.0","@material/animation":"15.0.0-canary.b01136063.0","@material/elevation":"15.0.0-canary.b01136063.0","@material/typography":"15.0.0-canary.b01136063.0","@material/feature-targeting":"15.0.0-canary.b01136063.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b01136063.0_1668557828212_0.45603099778456757","host":"s3://npm-registry-packages"}},"15.0.0-canary.01da0cabb.0":{"name":"@material/tooltip","version":"15.0.0-canary.01da0cabb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.01da0cabb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"520f84e232bd20c5e6a53da03ea2bd1735927a88","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.01da0cabb.0.tgz","fileCount":36,"integrity":"sha512-SLCQfTfWXqbNxDo/UdB4Bc9qLS4kO0sNZP0dB3/SEiTYuuY7owjFaPN1fAjpLzSgYNrUfiaXliLMiO5HiAyOMQ==","signatures":[{"sig":"MEYCIQCtTv92aaGIw/oaEKIZet6JWVD/4DJA2MPAcdtZ+GqKYQIhAOcVxP1MAREHLrPC4/nFqjBFjH18RmbjGoqX8eqIKGxs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1183088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdKn4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTqxAAk1ZVTorDT8VOL9au0LDMj+Qd21hZfBt+00vWP0JH6zOODHWm\r\n7/kqmDzEIi1w6PxmX7NZbQ4/tdfLnk3hkc4LRfDMjv3SfFjrssYRxLV1Noi6\r\ngUlltDh54PF4snKbH7yLejHl2BFagE6nH/2NVXV+oCPY2SD39ASw8BgcYmCt\r\nCD+xe+n2hCvCCld34dz9641JPQuagGBCqF0E1WUYX82hJ3dPSm3IzkpJIQ74\r\nqvU3jN0jDwJZ7qBAAMfn2lS586PbuzDtt0969Uy6aXBh9t8LxLPmkY6IX4rf\r\n1/5JpjzAiCrGLXp50Y4/U93nK0LdVwxI0NhvL6hlva3HjlSDe7pS+Avsfbro\r\nMu5DNc5wCNzMdtKGfxLorkTKUuTA+FW8w2GLSqJmipZvCtvsCSB/AniuIvU4\r\nW813a0JQJTIqSiBoq/wzMGghjcNoPWgJLi0avTFM2Hr9dJcQ0v4PSoapXiq8\r\nLNd2efWeLIOqEmQS8wEl7tzoBGMozxEDvxe19Taf5yVzCTqn+FEuR2dgJnmR\r\nhBpkSJfXLk7cSRpgOYNf+hAN15OhrTx55X1hlm1lacfEgT2RHbMxIWuc7JZs\r\n03WPAEPJnvRu2Wi5n62Ya+qC75QX1LR1x44eSxhTsvfC1r/XgVq5VJ1Zo06O\r\nLyJ2RttLM1ipy45A1nONJT/pprKoqnKYQKU=\r\n=q3c+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"63a5ccdac9b23a6c70c2bc776e20ab703cd1dbfc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.01da0cabb.0","@material/rtl":"15.0.0-canary.01da0cabb.0","@material/base":"15.0.0-canary.01da0cabb.0","@material/shape":"15.0.0-canary.01da0cabb.0","@material/theme":"15.0.0-canary.01da0cabb.0","@material/button":"15.0.0-canary.01da0cabb.0","@material/tokens":"15.0.0-canary.01da0cabb.0","@material/animation":"15.0.0-canary.01da0cabb.0","@material/elevation":"15.0.0-canary.01da0cabb.0","@material/typography":"15.0.0-canary.01da0cabb.0","@material/feature-targeting":"15.0.0-canary.01da0cabb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.01da0cabb.0_1668590072415_0.5189375673519032","host":"s3://npm-registry-packages"}},"15.0.0-canary.4ac393164.0":{"name":"@material/tooltip","version":"15.0.0-canary.4ac393164.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4ac393164.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8cf8f9d5cbd300dec9ebaf7dce7a1446c14b4239","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4ac393164.0.tgz","fileCount":36,"integrity":"sha512-8WqFOwHWTmmeV7m9cdycDuC3rxl/VJHBzg2JZYVhJuNXYvdfZ1QCeY+gXau+Gbie9YPWl/JRKFYZXqcBhJ8QWw==","signatures":[{"sig":"MEQCIFeKY6xvp4WRVmoOjbZjvLWu3KIxYtuIw4Qn+WWcsOMBAiAR1xjgu9ooN+83riFU3hmxBTNa+2QyabG+Ks8xwS0pJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1183088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdQzzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9oQ//WFszrr6Vw1f0nDia0wjJPJzOSsTJOCCu8F1OE3zLyIi6OQfp\r\nrbyr/D4nj6nt5owT4PQkcpMnt18hYQRb7yCA+Vwv238E+iKHxNYg1BgDyXjE\r\nXBQYAf6SP3Plh6o0AbT/sW3kd1fpDqxPFHmHRqWsMI0VZC5yk2Ai4/tYj7Mw\r\nmaP6fqdGCyOFDdOGCsiN4i9w9ZewRz5rh10eILxU9XjLgoUXHZa//hWM6vKN\r\nOsm6Fh6NIGTTxv7HZRDN/8jM4RpdN1V0hICKwB5CJeoBFjeL50Tp9TUE4SwO\r\n1Aq1XrUWIsYkB8wQTrRzR0ir1WYDIwXf7Wb/SFcHlLRsm4YwVyjwlfM2K9uz\r\n+m1L7o5t6iBPhkBaU9UsSUGkBm9Ee/Jwtza5nw3Jjn8kYPzC6k+/4m4eVhMo\r\nXvjTjzESF8CRYPmJjFK4skp6fMjabfj6LUyp1ze09HekhSECCpHz5vuQNEXj\r\n2DQ4osuXQ8yjLrjq2qsgaQSBA5/8AwhPGzNSYQHrlrqWHp3hYXFmpPeLaKLh\r\nzhzbyEdOk9b67rxzKnWqIDix9De8Rqb0rymHtw72Ie9s5DSmO5vAMbXj42/c\r\naur3lvof0VcNol3aLD/maNYFR/VopYfPxr+E1KHVKeHYRa8CFJU6xq+viaR6\r\nXuiOCwYTX/cHhEClB5IXMB7izll9rHsVqlM=\r\n=KQWi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f14d3444d266ac4c6c92142c377275be3fbc5d0a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.4ac393164.0","@material/rtl":"15.0.0-canary.4ac393164.0","@material/base":"15.0.0-canary.4ac393164.0","@material/shape":"15.0.0-canary.4ac393164.0","@material/theme":"15.0.0-canary.4ac393164.0","@material/button":"15.0.0-canary.4ac393164.0","@material/tokens":"15.0.0-canary.4ac393164.0","@material/animation":"15.0.0-canary.4ac393164.0","@material/elevation":"15.0.0-canary.4ac393164.0","@material/typography":"15.0.0-canary.4ac393164.0","@material/feature-targeting":"15.0.0-canary.4ac393164.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4ac393164.0_1668615411581_0.46813350427024636","host":"s3://npm-registry-packages"}},"15.0.0-canary.6048fb563.0":{"name":"@material/tooltip","version":"15.0.0-canary.6048fb563.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6048fb563.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3d1e98b10cb361e8b163c28fa74490f8f4b92d16","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6048fb563.0.tgz","fileCount":36,"integrity":"sha512-Llfx27KvMt4O+NohGCJkXTTXcLLa2iMeF8ATwaSL8/5axEe2YNF9Dl2dfMIsVeJEA5ocUnLeWIz+s1UJ2/N85Q==","signatures":[{"sig":"MEUCIAFcqCUUgbdiIeKFzQph50NErWxuFWKk/MNqJpet++M/AiEAu4WbUcDsSRN8rHTFBEiVFAPnP0EbdO7VotyIrsRSDoU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1183088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdQ11ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYHA//Yj+E/so92FqeRlukpsvl6G7xnkZvPyChxhjdgV8FMl2HUv6I\r\nQDfKewbkj8+jWsp5nyRjfDzzD+okoN6xPfhDDYuZRQUWDJfWSHIpEQY425ay\r\nVVrobQJScRDes33gDR+dzRSsnBhJzyTs46yJbsoi5pEtyLQhpnL+YZv+r9rv\r\n4Y0pZw1BimHLrTWbRlqTiDe3nhymQKXVxKU4N+eIzE6fdMtnY3Yw5hqt3vNU\r\n5UImLR1CJSX2F7hVUmrSoh5plVxoQg5/Ghk+kXvlH6UO7SiJAEXHbfgebjt5\r\nP8thJtcRxrkT+dUKV6ttcPvgrVvppy/+kWX21cvpMQWgOHunrSvUk8Ft9Trm\r\nmnFsWPtcHqa5iDT2PiMlCqmijY7MqY+JZq2ib/2kg6jCRO1ZtyYJ3jael8uy\r\n0NZpW6O46OlAadPF+PBMAG1YG8bv+49whz2/Tv67xfCAI8c4chbu6EO2wO7q\r\nIt491aBcfy2SHaN19JqQ/iLBP4zc6xwWDUtdeaEmemjk6FyfM45zdAK9Qsa1\r\nz3QroM5KNFpRex3NqClJhSJ3TyB8f/J0RFT1Uvqe2b8MnF7IChcbWiwLB85f\r\nlyJyLxwDNlTER8Nsj9dLSQ0pUtGvIJC/xuJiVNk2W001QYlbUXLtHsJh9J66\r\nTkswDEduzicpNfu3vOrIPxEMlAx8s/63xo8=\r\n=6/Wk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"590020431978794ff2128a91f19756dff9dbc37b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6048fb563.0","@material/rtl":"15.0.0-canary.6048fb563.0","@material/base":"15.0.0-canary.6048fb563.0","@material/shape":"15.0.0-canary.6048fb563.0","@material/theme":"15.0.0-canary.6048fb563.0","@material/button":"15.0.0-canary.6048fb563.0","@material/tokens":"15.0.0-canary.6048fb563.0","@material/animation":"15.0.0-canary.6048fb563.0","@material/elevation":"15.0.0-canary.6048fb563.0","@material/typography":"15.0.0-canary.6048fb563.0","@material/feature-targeting":"15.0.0-canary.6048fb563.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6048fb563.0_1668615540854_0.9375995727801434","host":"s3://npm-registry-packages"}},"15.0.0-canary.f7f56fff7.0":{"name":"@material/tooltip","version":"15.0.0-canary.f7f56fff7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f7f56fff7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5c9fcad81faebf1c09aa94ede4b94a6b46865a20","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f7f56fff7.0.tgz","fileCount":36,"integrity":"sha512-SI5Q/iQZcJdGnCrT/KJ+SiIofwNOKFmIcPPC14e0gIznzmmRaBUdg7JRXXNeHrcDhpb4qknUly3o9mewl9xTXg==","signatures":[{"sig":"MEUCIQCrq+p6p1SQiO0hM1iuw7hSq92+z0ERsQgY37seaH0k1QIgB/lGaNmzmu3zKkrVqkD38KmTvhv8KNfLTPl3Khe7Ico=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1183088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdUCeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAnA//R7luYs0hm0ltu9esxwBOw4CizCuRf+O8kpmbfxh111E3Ce0G\r\nlVn11WXyyGseYvcJs3oAOzPM0uy2+FdqIEM1jV7og5G4YSDau4mLt3zCAj/m\r\nAK0Tqzqapjkd7pxUssdFBxM8kcfrRiUSh6vZ1JaCuxXFy5IH2msU+o0egGhm\r\nC23/evmBix4hdFwhpmlYVnD5tOxfRUpaVwDQmyIr7v1g0sAuSBnZ4sr1+naJ\r\nH2XAw0yWVNXqsVSRWhR+Rl1PfKsGYfNZUQlOOM/f5FzDFdNvJGuZgUGnSvAj\r\nmQJHlxVu6B9pcS94yEphCiNREme+4WyPisvE8zcM8zTYAQM1Ub1tTgmGDp+p\r\nHsrZF0JRD421EwSpaulMFemfKhPXt5SAilpGN84EagLSCAcqmlRq0csJOeuP\r\navE6VcwrmZ2r8ACsyDGjJXB0xEkEm2imofAfgNuXv2hJhdja53tSwPxEQsnw\r\nKGerBTGBvlTP5oMSaZD5Yl1MMQ7qCk0IrZciFrZx0l9mi9yzbRU0dLF/SHGn\r\nDLvEuqZHzcnnRFT1IsD/DWzAzHL1Ukc8AvZxPSOGaUYiGPqYsuV53IIHzcK+\r\n67WTrVrtfu70XH7GOUSyUKvP28l5Yzdjt91EPn9uSN2/XYkqiKvisPK84NSb\r\nrMhEqzwo02+55VziRihSFOIWbMhSHT6j4uU=\r\n=b18H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"bc90613e754d04f738197ec3f3f4602e9b362d8d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.f7f56fff7.0","@material/rtl":"15.0.0-canary.f7f56fff7.0","@material/base":"15.0.0-canary.f7f56fff7.0","@material/shape":"15.0.0-canary.f7f56fff7.0","@material/theme":"15.0.0-canary.f7f56fff7.0","@material/button":"15.0.0-canary.f7f56fff7.0","@material/tokens":"15.0.0-canary.f7f56fff7.0","@material/animation":"15.0.0-canary.f7f56fff7.0","@material/elevation":"15.0.0-canary.f7f56fff7.0","@material/typography":"15.0.0-canary.f7f56fff7.0","@material/feature-targeting":"15.0.0-canary.f7f56fff7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f7f56fff7.0_1668628638068_0.49540557777061145","host":"s3://npm-registry-packages"}},"15.0.0-canary.7c73f6134.0":{"name":"@material/tooltip","version":"15.0.0-canary.7c73f6134.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7c73f6134.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"88629b14e14634a02d810b92cd1e4e3ff6439d64","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7c73f6134.0.tgz","fileCount":36,"integrity":"sha512-xJUJ/rTniV42pA0Ys5DrzY5NqEkuuFjV4nkEOTFFyFBuvXKoxXgqOwBMXphG5kvnPYYai6KLYjuqht8s2P+sxw==","signatures":[{"sig":"MEQCIC3Y0Vom59VRG2qilJLvpLaGLaxFti5kYQ8NOfYjZI/MAiB52lmjieZGzHzD1JAFA4ezWmTt8k+xdppbNFN8IeZQGA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1187883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdUGwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGAw/+L1Zz7i6/3TLeD/aAtkMJerzToklALqX+s5E9GD+T3TBDU7x8\r\n45oBnmDbSkneAmn02BrdXvCRiX+IuSykjGCLEZbwAiU/Pcxtu27pS4mMAAwr\r\n3q3stBJ34ZmI8hGmRqaoRaMh4ASyFeW/ISkuJqa5vQjy4DT4sgFQzEbJ7V7G\r\nwIiMuVjTDxGatBtQIsZUaUo7uhryiiAQvXYtWipA/aG9IRFh6ShvcjhfLjFu\r\nu4CXA+9mWQpa/chHUAvDagL3xlJRaPCe9PEVzL+cMztm1akvFgv+cP7Llg67\r\n4VwjRIZEQ43BQe2FYHxOBKhuGMfTkgLetPEK/3WK7LCuqXjwFgn88u4hWkQI\r\nSUtjZlSlo4oz/qiPiWKa6Y5fXXc/5UeRiULDpIINQxEOcOV1AI88XZhKO8Sf\r\nz5U7iVkwfXu7L7RCQ1mHC9xg/HA4cqK8KVW69traqnFv3ttHXMQSn68b3CPA\r\nbA+PjqKzVC87JxQbfs2tIJMihDWOroNV+pNnL4d4cJ3YAaK/54VmNGlq+A4R\r\ntb6dVKq2i26CS7D67dBIKH5i848XkTI/TocwU1QP5q6FclXWLYzjaOZxYc/K\r\nWASXUw8wswMkvoCfN3s1buQDmxlJ/UEoKYVtpdHJS22SzBl0MLzpFZj2Gp/T\r\nbjyumw6LD3bG/UmI3sqzTdSMB2iH32SqGUs=\r\n=zi8G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"14f53e565ed77defe907254a486b9ecce4b45146","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7c73f6134.0","@material/rtl":"15.0.0-canary.7c73f6134.0","@material/base":"15.0.0-canary.7c73f6134.0","@material/shape":"15.0.0-canary.7c73f6134.0","@material/theme":"15.0.0-canary.7c73f6134.0","@material/button":"15.0.0-canary.7c73f6134.0","@material/tokens":"15.0.0-canary.7c73f6134.0","@material/animation":"15.0.0-canary.7c73f6134.0","@material/elevation":"15.0.0-canary.7c73f6134.0","@material/typography":"15.0.0-canary.7c73f6134.0","@material/feature-targeting":"15.0.0-canary.7c73f6134.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7c73f6134.0_1668628912532_0.8452331448504184","host":"s3://npm-registry-packages"}},"15.0.0-canary.f1e037150.0":{"name":"@material/tooltip","version":"15.0.0-canary.f1e037150.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f1e037150.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8f0c6acf1dc2087e0396efe219ced6e30e9b7411","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f1e037150.0.tgz","fileCount":36,"integrity":"sha512-6sJhUGIaBlphRlpPGSNlXNyeX8C9kjPiZTUbStF8KjraT3oeuwAqTd6qFnwKJuuHRD5QhAmFvAA3ihgWu0OVIw==","signatures":[{"sig":"MEUCIQDCAePwXrx5iwzHTzsu0qEYXFvTw7qhfRRnSDbPOaRWaQIgfHNvqnyJQct0tdUqAnpJREXzJIj1DC7Y8wnRrLuXfRc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1187883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdULRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQKg/7BMQJYavNOU0DNYk3AIgVcpHSyw7LqTWt7LWgfGs3l09uCJhR\r\nv10G37i/QDcKLxRrhlOv6EIqPAj7o2fhVE/xrihfyZrC61Zkx+FsPFbvs6dn\r\n5wp7+mZiyaJ67OXmyLVcujNHNXm6PGT9/AUEdZMppvLNEX8d9Nx5MNKnwfQ4\r\nD9Ec2Xez4LAANUVLP5G2jVTwTmog6WYLpnTnIw86FdhQxGMW28dvZglv9FQH\r\nwsGEzseRjmN/VU3a69TftJPZa1Q35r3YXOMDKcdokZG8neyj1pWfYuvHUGjV\r\nLDJo0g7SID4i8EGosLvYEAUBnF0LSzIo9aFhM6K8kRfEuFK8UW4NUxz/CtEx\r\nOH94tMQqGrDHNvJJZJyATkStkok1q4YpCoqi0ge6cB8Bgn6DXHBdzFP0freo\r\nAm9LSUHU9GT3gAD0tX2dG2w7cBIptNqt8EyYObTVbsCuxq8p7jMVjT1HjZOR\r\nLTGXouoR/PGQigkUIh+crdhgX2jrDdLDhjQ+yV/puA8GI06q/ENmffRWL5rM\r\n2xRo4rWOI/KtWsEJZ1a3uWbRuTAVck76Obimk/LSmBr8NCN95bHro9JVS5cD\r\nZg4ODn9DkTprkxbRV/+UJfq+udcizVomMJ4us3eWR/cK4ir8fCc7PHemMrIT\r\n2DqcosHvOYfWFk52yzNvpy6Wf1VRfExl7wg=\r\n=HOp5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a639195febefa28bbed957ef46942b3da6a4cecb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.f1e037150.0","@material/rtl":"15.0.0-canary.f1e037150.0","@material/base":"15.0.0-canary.f1e037150.0","@material/shape":"15.0.0-canary.f1e037150.0","@material/theme":"15.0.0-canary.f1e037150.0","@material/button":"15.0.0-canary.f1e037150.0","@material/tokens":"15.0.0-canary.f1e037150.0","@material/animation":"15.0.0-canary.f1e037150.0","@material/elevation":"15.0.0-canary.f1e037150.0","@material/typography":"15.0.0-canary.f1e037150.0","@material/feature-targeting":"15.0.0-canary.f1e037150.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f1e037150.0_1668629201515_0.3711185069876346","host":"s3://npm-registry-packages"}},"15.0.0-canary.40b18d043.0":{"name":"@material/tooltip","version":"15.0.0-canary.40b18d043.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.40b18d043.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0fbd0a11603b970f17bea11c4b9cb2948a49dd99","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.40b18d043.0.tgz","fileCount":36,"integrity":"sha512-ODXkQgENh8tGbeUOpGZ4t+c5otUtQPeBSIAWRQK2BAscmzKeRw8UVhLewEXlgY9EWtUQvM3yILrs3ljVHEaZqA==","signatures":[{"sig":"MEYCIQDJw0QnyeHIS/YMXTzK+fDHtXRULv3MIXRD1yfTow+CyAIhALJiAMMUA47IwkbgR6/n27irGGWTcQwE6o1CnI8hRLXA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1187883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdWt0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3IxAAm2wOQ3xv0mRXHQrno4GOyhtmxro7UxHsbQQPPeNrVm2KfZ5D\r\njHOJdzw1c3H9/AzMVXir1Sn1ushsLZYmFyZl6fQZ9l+59ubLMoSPx8eVHNpB\r\nBow3zmhAdjg+7cjM3LyPAuXUihsqWQPk8eCgpHPYxuo9yzMaFFasoppd/i9E\r\n+DhRvB7c0TSO8R9hso1gc798DzVkfBdRyfRVOf5cBgNseC31w0KkdBHcVPpF\r\neFf4gehijoa5wRKnYs9/vTbkVMQnkbUOaXJuToNuvdOzfwqHpWc4OuU+spDV\r\nKqcnIMtVot9nV1rrVd8KksO5O9UN6bg/gcv2PQfneH26Q7l9t1R4RpPD8qZg\r\nbL1Wi63zbZKs295f0xI43LAhqKH0N8lvIydx2WVWbGfOPbRnzYKVMVZYAXT7\r\njfabn/JUc3AVMIDQQwyN5FYIyUspl/c224teOwe6BsT01IZ2og6C9n5ivMEe\r\n4zV7/yCUadd5XYQdrd6p6YaJrmnHaVPRLIKDCu4VCWRrgQSXB/lczwG9d8Oe\r\neqSerHxcyNR3+w/sHQ1jxUJ5hrqm859mYJikAZLA/O48kR9gs4EOIDnpTpEw\r\nAfysYT+LNres5Qgj9BnpQfz/1OCo9v1O0KyzoD/1uNf892OA9zTzG5e57UPa\r\nlFlfkS+Op05oZYgkYdVwuseGdD4VLrL5zaM=\r\n=ziY9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9ccfc97518c89cfcc2b5e776dafe81024d137f31","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.40b18d043.0","@material/rtl":"15.0.0-canary.40b18d043.0","@material/base":"15.0.0-canary.40b18d043.0","@material/shape":"15.0.0-canary.40b18d043.0","@material/theme":"15.0.0-canary.40b18d043.0","@material/button":"15.0.0-canary.40b18d043.0","@material/tokens":"15.0.0-canary.40b18d043.0","@material/animation":"15.0.0-canary.40b18d043.0","@material/elevation":"15.0.0-canary.40b18d043.0","@material/typography":"15.0.0-canary.40b18d043.0","@material/feature-targeting":"15.0.0-canary.40b18d043.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.40b18d043.0_1668639603311_0.21612882581247006","host":"s3://npm-registry-packages"}},"15.0.0-canary.86bde5c06.0":{"name":"@material/tooltip","version":"15.0.0-canary.86bde5c06.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.86bde5c06.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7fa2f657ab5203ab332e0646e199e9b6c2d8a1db","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.86bde5c06.0.tgz","fileCount":36,"integrity":"sha512-Wn6QfgJLOtC7gxnKWl8rR0hmutI8YZphcUyS9LpG2kkI8MmSQ+KD02C3gPYSt6jyj+f8uHHJRvZk/9PdDrAtjQ==","signatures":[{"sig":"MEYCIQDyLbn1EAt6bCN3h8K+6/UlDRlY8BkPtTRDXWjvgC6UUwIhANQRTPsZdiRwuXRD8EJ06PSZvEg3qd3aJeAmNwBu4liK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdW3VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBZQ/9HgXe9t5UhXQaS8l+tXJMXgL9djpd56io8giXaR4TLZIJLqMp\r\nqBDOFH51Xc/4USSphWKqhtOLYHNczxcFXI1exGf7OZJinn6iphlwZJ76ModT\r\ng1J5AzjjpdAzMlZHJKp22rYw0gNyKk9T7hK94okqO7XCJ+XHZDlPWrQzt4D7\r\nBZ1kweMSoKBfKezihWZWyOdt/9HUnbsFPSx9c9a6XHb7CHQLWJqE8/afa7WV\r\nFyffvOzhfB9rWhQPjyYMpspohzgBdIxiNKWL1rtHUr9Mdu7sYv2yEs+VWIgd\r\nscvsGwE3nP9C2pRziChTYAwvJuMnP4Mw8Jkx2F0GZ3f03bigeZQQUhUUNzm8\r\nGWj+cBcaQrVi7pxSX16kX7VGcbyALsZoXR1sTuxBxdj7pO+lf5YAJp2YNgOY\r\nv5Q3pNc/589B33fV9Do4j/cmCCkTX462176LQHrA4cY7Sa61b+VVau7hKvUc\r\nDARDF1B33UGpTHe4HdvebiDqapNi7Y/1nO+/DAnyc7QfQCWImOCkuCHd1bNR\r\nWiZbllGMpY5F5RmAZSvgj0lTCvcIbpLTyHptD7B1ALn4Z/Gcv1hPVjLJUBXW\r\nozDQMdwuXh0mfu5z2qXnZilcQWo+aAybZSTXG6QRzhYKmzZCwRZJdm367P+X\r\nU9lbjzpZSEZBdSLi9VbOFXjtPxHpOMM4vQ4=\r\n=O63V\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b9cd39d4936a1961536e39eb1df855c5164d5840","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.86bde5c06.0","@material/rtl":"15.0.0-canary.86bde5c06.0","@material/base":"15.0.0-canary.86bde5c06.0","@material/shape":"15.0.0-canary.86bde5c06.0","@material/theme":"15.0.0-canary.86bde5c06.0","@material/button":"15.0.0-canary.86bde5c06.0","@material/tokens":"15.0.0-canary.86bde5c06.0","@material/animation":"15.0.0-canary.86bde5c06.0","@material/elevation":"15.0.0-canary.86bde5c06.0","@material/typography":"15.0.0-canary.86bde5c06.0","@material/feature-targeting":"15.0.0-canary.86bde5c06.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.86bde5c06.0_1668640213092_0.27404367832476817","host":"s3://npm-registry-packages"}},"15.0.0-canary.bb7751002.0":{"name":"@material/tooltip","version":"15.0.0-canary.bb7751002.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.bb7751002.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"de7aa21664dc710b9eceea57056dffc1756b9990","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.bb7751002.0.tgz","fileCount":36,"integrity":"sha512-H3vcG0JW6PRHZd/7UIq2lbD685TymVtJICH1mBpVvGoTO1Saj+tVavtDfhQIV8NO0MuH4Ayg0cc/fFtAQAWnng==","signatures":[{"sig":"MEQCIHUj+Z4gYWpWyrDfkjKUzvNCx3caGWKWKCVVrmwtpM9yAiAt70rW2hr99vAToqEXtxGx0J/6JMIejvR1o2ZINE1meQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdXnVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/+Q/8DQLYT7B60fWD2joveVyJzliVdFpm/EEBFzhpUqzUuj/XRtwy\r\njwhvTG15QvS1rrxL8YYyYuJ3iH+mQpb+BxDSGcnehJSV2mu7IBxlWHkYsvwJ\r\nWzaL+n8ayCKxSTdwQ3IGsaaGESwnSLh5WVdbYR5cdNj5Gm11TamL/fcq+408\r\nQ/monx+OR40fTK5GUMNvk3XGyxdTwgGOLJB2xPjjFQk4p3q6gZIjZ1wIpe9y\r\nu0VDPknXfITo2Jjd7TbeEiR+7RnrwHaVtVQ+MK+i2saCsQHKBclMeqqpb3J8\r\nIOXA+6corzbFZ3wnjPyQJ5KbjI5MgZq9CuvAoSZ0ykmOoQeSQCEvA0183dwE\r\nc+rVtK7cP4SwTQ1W13UtAGbxsPPA5gZLW68UAVB3p6ziRN3qZ+J2PBJyrMKw\r\nzDHs8qI+SSqQYqz2EHyokLszv5U3bc4fjHl7NrIqsR54S584GBCyIOFVsp9i\r\nGjMSRkRqIO8K98UFY/wmfRIdhe19rQONyqiwpMsMOUFzGkn1L/z1jZ/Lhxm/\r\n3jp44IBXYB4mPHdmmuf4A1hgAwp/sWV+aXyoJh1sblbRww8rbvzwieiNmDUd\r\nZu0HIFt0D/grvurzPUfdv4lBk8MhIg+9LuTqnkPNUzAbFFgAJndk+DDMhTUO\r\ntiMeUCV/0ZT20w0aWXAG4GR+GMyzu6VfbDc=\r\n=PA58\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f83cadc3a1330a69930926dacdce7fdf10432f98","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.bb7751002.0","@material/rtl":"15.0.0-canary.bb7751002.0","@material/base":"15.0.0-canary.bb7751002.0","@material/shape":"15.0.0-canary.bb7751002.0","@material/theme":"15.0.0-canary.bb7751002.0","@material/button":"15.0.0-canary.bb7751002.0","@material/tokens":"15.0.0-canary.bb7751002.0","@material/animation":"15.0.0-canary.bb7751002.0","@material/elevation":"15.0.0-canary.bb7751002.0","@material/typography":"15.0.0-canary.bb7751002.0","@material/feature-targeting":"15.0.0-canary.bb7751002.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.bb7751002.0_1668643285493_0.5446815659524744","host":"s3://npm-registry-packages"}},"15.0.0-canary.63aca9af6.0":{"name":"@material/tooltip","version":"15.0.0-canary.63aca9af6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.63aca9af6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9d4e06f561371237fb637a4f57816f4e8233947a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.63aca9af6.0.tgz","fileCount":36,"integrity":"sha512-298t9uFcE6XMkozSSoHPduKu6fB6gh4OjvpJBi0O/DgP2Ry20It20aragHxwDdqdGaMF9GccffqLsxXDVVBqgQ==","signatures":[{"sig":"MEYCIQCOAj72V3S83ATrY3+mDzQKdKLzdNUxX0RBB9E6q+mXkgIhALaq65CwOux0+ruURPOjS93rZYyfR4nzLisNRvVVVagk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdoVmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtBQ/+OJkqWm5a+YhFapHl2jqddlGOdbddmDPtdATGEQ+yoVaDpjhH\r\nahHWOEhIn02CLLYsx0aFKs1NNryu2K6HxNTHRNvXQZU7QSzRoQGrF8Tni/IC\r\ndJwOxFeTPVdJ9iBCoI2M/W/5KWiB1t1HOvsB3hKU7P++z/xHItl5kGNJ43cP\r\nltJGUROM9lvvSOZWy5+hBvh06MeRsqHdtQXManNlYKKKDJ9tLv3b+yjWgZvq\r\nFEwUU83hVgJq2e4QZ36Ih0yI7boFLat0+sv1xegpfNt6SrIvXXEWZhmgVov2\r\n7ucGaiv3L7mFY3vbpMjotuCVVtaZj/UsdOgVIqt/y+RTvLO2lotjz/m11NCH\r\nSjKxUrTQxzi36hOhnH9gUv5OsmdibxGRuQ38pFBFdby3Xdr+h2IlvfKRiIQS\r\nzBquH0A4nkcj/P/ToA7Q546GJnPWLx+djIML5QtzfjnwEKmoTJzqgRCXlShn\r\nBfSyllgpXTqbJ+CEU5RXm41zUAWVlFUPYv0oBo7zSqeqaTs5p2tkKvKyOqQ4\r\nvsrgW6Gz+QzBztFlchyuIaO7Dxgw25iV8O2xfVJzzM2LuvTJBKfewFbxQ9iT\r\nXyXCzave6U4iRjC4TXPirLwDdyDtuXfjKymcrhqixks8N2mwlkD3/LCumvvB\r\nY/fiMYScUMm+TSf+9U/L6GsOx0lnmvCBIOg=\r\n=HU9k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c2c841973403116b6a405bb9aad3ae8476bc028f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.63aca9af6.0","@material/rtl":"15.0.0-canary.63aca9af6.0","@material/base":"15.0.0-canary.63aca9af6.0","@material/shape":"15.0.0-canary.63aca9af6.0","@material/theme":"15.0.0-canary.63aca9af6.0","@material/button":"15.0.0-canary.63aca9af6.0","@material/tokens":"15.0.0-canary.63aca9af6.0","@material/animation":"15.0.0-canary.63aca9af6.0","@material/elevation":"15.0.0-canary.63aca9af6.0","@material/typography":"15.0.0-canary.63aca9af6.0","@material/feature-targeting":"15.0.0-canary.63aca9af6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.63aca9af6.0_1668711782712_0.8255124908335603","host":"s3://npm-registry-packages"}},"15.0.0-canary.56482dc2e.0":{"name":"@material/tooltip","version":"15.0.0-canary.56482dc2e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.56482dc2e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d574f8042e2c418519201935819ffe402ba757c3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.56482dc2e.0.tgz","fileCount":36,"integrity":"sha512-dL/EKDFlCVsZhaevTtAMg61bmES5CG60AZnKXisn1+LjYGS0uJibewv0qoNDKwmaM/MpTsJ80s5G7sovMheJKQ==","signatures":[{"sig":"MEUCIQDAa7y0/yrJo8PrcT8TQ652HrLQ4MPvAM3Jr01m4nOnpwIgHGpbOEN7Dhi2l/zRAoEmGe2WuavjxAaQ8CYEzmoXc2U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdq4gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqiHw//TmDLxrBfrp1T9l+NHnpoqG5criyIU1ITUGxcPV4e0MAj9PMw\r\nFlYqbuY8NlhB0W6vzhAHw1gY/6qusgVp6fRIoJpGu3kx81cGCpsk529Hq68m\r\nN7o3kt5CtCn9IugmVqYDhZBz0E4wyUKnSwrAnKspf6Go8GFNFGpo8orMae2L\r\nGFlu0NazASeiI0xcAloqd0T2IdXx9OZfaIutFdYbeAb42jT7/ThdFwaPZLEg\r\nnwwDioNdd4F5YEsj3b3f6bJOqgzsTAXX0plJ+ar9ccxsmZCBHfOqG44/nlnF\r\nTM2NVHB1zRewycvLmiC2HRCjL50Y/9zEhL7zpKJbmiT0OVXp9Mg5ez/kGNAs\r\nhk1T9gSw1/cA9auamw1Shq7Qo5nXgD5yB8CEO7TK+63NgwrWqZ5L7rQMzD9x\r\nPmv6AARajScvYbqU7dC5mvnds6Jn+nqMcx7FcAbtHIXuW3Nl4XfC6Tcep+nY\r\nsyvZHVuky/erdRbV2EWuLt+6l+Fx5uIYP6bdQlaQlI+kYk2cMKBkiL9MPDAk\r\nGz9Yg3VreN0iIyo30RRS/+Gr3p3ajCjSFokzrt+6GNfKjlbC0goCR5djz0y6\r\n/81ijnF1M+G0fv6SI3yaTfTqiKgPHHKdOs/TaPC/SHpd8ErQznBw/YzxxWl5\r\nsLbuZ0dSnsGN21PWGtNrJd3VuErt2cvMD2M=\r\n=6sKC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c65945fd8948c8e5ada035d0f2538dc2ced7a28f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.56482dc2e.0","@material/rtl":"15.0.0-canary.56482dc2e.0","@material/base":"15.0.0-canary.56482dc2e.0","@material/shape":"15.0.0-canary.56482dc2e.0","@material/theme":"15.0.0-canary.56482dc2e.0","@material/button":"15.0.0-canary.56482dc2e.0","@material/tokens":"15.0.0-canary.56482dc2e.0","@material/animation":"15.0.0-canary.56482dc2e.0","@material/elevation":"15.0.0-canary.56482dc2e.0","@material/typography":"15.0.0-canary.56482dc2e.0","@material/feature-targeting":"15.0.0-canary.56482dc2e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.56482dc2e.0_1668722208466_0.13157283731050273","host":"s3://npm-registry-packages"}},"15.0.0-canary.953e689f3.0":{"name":"@material/tooltip","version":"15.0.0-canary.953e689f3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.953e689f3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"19b0f78e284f8c7f826a496f9df224a490992850","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.953e689f3.0.tgz","fileCount":36,"integrity":"sha512-BDRLDxqpWghVTwWa5kjfkcMDz5/pgZ3jOmx49venjEdpulzSMkthUpu/oejRJNMED7nga+cg7NrS0qzNmlaqhQ==","signatures":[{"sig":"MEYCIQD7btLYaHEoHOKHfeg1eZtvyTvfErBMxapHIEq5PHYLMgIhAIjuM5KRzTMLgmhnHqRHp6D5W9/JAqKcMKBFZK+KCAnX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdrBEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0pQ//XbK1Ci5QbhbUrRr8S0MBdMzYTPQ5OelOnswcB2LICRIByMz2\r\n6Nk7XwRJGg6tLq6LBdnWESHdqEZuwTAgYxKoD4f14AGXYt/QJvMV4ueC6I8R\r\n6u7BjBDQw+uUD/VcVxyPP7HyZOKMyKcQvREck2wkzr/4ec1HoGSl4LOKNSt+\r\nUXl97lIUYDIxZszze8jI/ihAPrmRg3PWo5QqM+J/sEpZAA+np35mmerdkFfW\r\nDnMIkRBgTepNcS+WYvHOzwa7wjhsUvjhS+sMq/97H91Nbs/bE1bEzwwGDjKu\r\nYZJ+K6+IXuPq9iMYGMS9kvOtivQH67YQxk47khdIl0KIuvH2W7ayI7ktAjsp\r\nZPYsnvtRnteyw/IXnHPdN3LusGrdqoBqxmJWK6aRm5/AF94x509ly6cdyhoO\r\nhSOgNKFZzDjW8qboOgJDCdIQ8YgtmqbSR2aiKFYJQQtyaxIuONuhfWCURMOi\r\nxfKdHMFxuKORQBZhH3gx+uD4/TjkVDqx50ZeQaz+Nlyhahk6IHaU5Xn0w97f\r\nxStPHPo0E7GUfbjwexfZy+oPDjMc2nYshharL9dTl+/W5Xlp9SUUbXmpeYiQ\r\nx2z6NWq2qoY9DBpOYTrp8d7kzNwYdp2USsPtzxmRNPs8F3HkaE9I/5fVF2Jh\r\nQcnB8k3m36gJwuqerupcy0Mr5IqIaay69I0=\r\n=0e2h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9b9adee0b4f10a2d6d77fc10e9291c3aac8be42c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.953e689f3.0","@material/rtl":"15.0.0-canary.953e689f3.0","@material/base":"15.0.0-canary.953e689f3.0","@material/shape":"15.0.0-canary.953e689f3.0","@material/theme":"15.0.0-canary.953e689f3.0","@material/button":"15.0.0-canary.953e689f3.0","@material/tokens":"15.0.0-canary.953e689f3.0","@material/animation":"15.0.0-canary.953e689f3.0","@material/elevation":"15.0.0-canary.953e689f3.0","@material/typography":"15.0.0-canary.953e689f3.0","@material/feature-targeting":"15.0.0-canary.953e689f3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.953e689f3.0_1668722755922_0.8090729015611846","host":"s3://npm-registry-packages"}},"15.0.0-canary.b5606a793.0":{"name":"@material/tooltip","version":"15.0.0-canary.b5606a793.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b5606a793.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"daaac30c2c0e8f50968f19e9bd56aeb0ac6a42ec","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b5606a793.0.tgz","fileCount":36,"integrity":"sha512-/YkNTE/OpXhMyzWcD/fDqDas6G0ssqLvmdw9Q43ywa8GpHvtaBSY4n9Dp0oT9G32LU16dav48fse+vDEChLkFg==","signatures":[{"sig":"MEQCIBsPI2mYksWgDPReeSTq/BlC5PI4LP/RD4CeC7aPbMeWAiA3IHqiJlCjw7AeU8Zj/yaxYGiujHaqrhaZm0qSMXzyaQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd1zeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIIg/+Mi+PKJtqdCZVbQTxDyBj23pfi/L3s+IXvZKqSvBn4X50IT6M\r\nbv39bnGHAu5Dd6FfuPZ9OhRNq5u0nFUElmjD+vo4tP65I57OXm9yDTkzat3+\r\nUyegXxGMmexNIkwJGRxbXN22UOfDrXDcUp23mc/ApyQ0xXNVgrBglUovlf5F\r\nw7t8mhncSfT7aDX0PoaR0U5tnqsXZ1QGrsXWvZa4Hh0Mxrl2NBACCSq/VxbK\r\n2hD02RTUieEONsuCATwozIlZ66fnIkapX1JN60DF+lbu80vZTtqNrlv7Ejgd\r\nga8YsEEnVX7iOg5B78t5yHC6KLMgS0aeARcD2pTSlT8Wj2YwBr5kLjREigsA\r\nGammi7UseSb5OSFWyjN8gWc4jcjUMIP9Nghs6EsceC6k+g8MJGv3yOtncf4l\r\ngx2Kt7qBr0snApoaAMOJGD//X5Fe1hd3PcFM5TIt7VlXOW5w2uhH88dDUv4f\r\nX8LfKi8eRTUlX7wji244MG/HJrjp089xPgb7q596Eyl+SA0iupovvCBDGc9T\r\nn2oRmncrX0ws4m2fM0LcZGQe1RE9ETmMfkUS8sbeu2uEDwv5QxbitVO+eJoB\r\nrf2of3V+8Vuw0tw5mOk8L8MOHbFkeVrZJp3QqzCmJ0nMBrZnkghe6SoJv+kX\r\nuce1tkSEyv68tQOV3ok59X8NAnC0bSYO/E4=\r\n=NFJK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"681685532cfc9993a6190aedd85bf5cd1b3f80e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b5606a793.0","@material/rtl":"15.0.0-canary.b5606a793.0","@material/base":"15.0.0-canary.b5606a793.0","@material/shape":"15.0.0-canary.b5606a793.0","@material/theme":"15.0.0-canary.b5606a793.0","@material/button":"15.0.0-canary.b5606a793.0","@material/tokens":"15.0.0-canary.b5606a793.0","@material/animation":"15.0.0-canary.b5606a793.0","@material/elevation":"15.0.0-canary.b5606a793.0","@material/typography":"15.0.0-canary.b5606a793.0","@material/feature-targeting":"15.0.0-canary.b5606a793.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b5606a793.0_1668766941896_0.7529734083727988","host":"s3://npm-registry-packages"}},"15.0.0-canary.8c5675942.0":{"name":"@material/tooltip","version":"15.0.0-canary.8c5675942.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.8c5675942.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c17e7fa5e628f562f678cddc98b015bf8e62cba","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.8c5675942.0.tgz","fileCount":36,"integrity":"sha512-DwAbDx3KFNXBUUeVEXdT3cnQwb5cbCpWimEdbAM2dGgFJ5Zu7xt18hZn6GmDb6TqqT5a3hspCuET//bbwe0Sug==","signatures":[{"sig":"MEQCIH6EogXZBL8RGGj44Aa38OD9p2jxX0DoSZdPF1HeleuzAiAM4QO8/prk7kKBKyR4QkQLsMdGUMXiFj5T2ZsuYNqhfQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd6IPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjEw/+NkCESZUs7CTry5Jl3tXe+vLVWEQShbYpauPax6/jB/EZI1LN\r\nhhZO3IRxgwk6yVVpwzaZWfhe1gDZnFj4YsvZlQuWBYwV2GbbfaYe085ZZEGc\r\nzR7LsItZabDHhaNPK4SRVurpcVQAJ/Y33GmeeM+Jzdfz5zNdCMkTLugLcUKi\r\nZBEn81RBWyV9/7T0+vFcfgFCQwIE1EVlZC2YsI5exctoDZLlT46yH6bU8h4/\r\nEdBgr3oB2hQGfIxUkxe63vwlSOVQHvUE/BSsuz0LdIjq1aIUPXKB+wHEQJiH\r\n96qAFUaWA1ABvE/rC9tnVT/9hqF96RMkQpNyZA/7WbgS5fLkbDiflteK0efU\r\noo4QXr+jzUgqlp0Nq+YKfB9uel4rEnJw71BWO7mZucuQ62y/bMsLTdZ3OJQI\r\nYlB7K2m3tT4VBjBB0jga1UIwR7y3qXog7phZHMy3fNHW54Uvt48UiANB7VHL\r\nKqlFnzIHdEwOERO5216YShhgC6v45msXuGG3Y03Ev/MRBz2ASVRZVTrTxZDI\r\n+68uPrElbgAMBNdawgDKv+AMrrteFzrYKtSsgiBuwAbBr1Pn8d8hF7x7r9zV\r\nrcXSzLZGycH+K8HOZtZe77mT97xxJXxP2yhS/JupZvFAFpAb0SK0SbbYbiMk\r\n/pJXsDClbb0BcJLETkm2N/b6G9rvVEIYYgY=\r\n=efEu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"46367ab28a14e7ab75dbddad4b3a00d97443debb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.8c5675942.0","@material/rtl":"15.0.0-canary.8c5675942.0","@material/base":"15.0.0-canary.8c5675942.0","@material/shape":"15.0.0-canary.8c5675942.0","@material/theme":"15.0.0-canary.8c5675942.0","@material/button":"15.0.0-canary.8c5675942.0","@material/tokens":"15.0.0-canary.8c5675942.0","@material/animation":"15.0.0-canary.8c5675942.0","@material/elevation":"15.0.0-canary.8c5675942.0","@material/typography":"15.0.0-canary.8c5675942.0","@material/feature-targeting":"15.0.0-canary.8c5675942.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.8c5675942.0_1668784655485_0.734282286329131","host":"s3://npm-registry-packages"}},"15.0.0-canary.697fbdebd.0":{"name":"@material/tooltip","version":"15.0.0-canary.697fbdebd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.697fbdebd.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"14919a650f97833eab029981b95d3a202ca99b9a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.697fbdebd.0.tgz","fileCount":36,"integrity":"sha512-RwQcOJ2W3YQhF7erRnLAy53i39TpCzOOFqwt+46qm1h2ory6bhTkwEpzCPGRYpfyu31BAJaR/l3tR9p2WFlk6w==","signatures":[{"sig":"MEUCIQCHvD23nDLAsJKSad9z/eXy9oqWrSZhK0Pg+E3Jdq/KkAIgGO1wZhvXe9VFvWaA8rY9LahG76t7ZFlSBkTI8V9bqwk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd7qdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo9zhAAmQOIUBaNSPWlKmeXu0XlAoZuWz8QpikVdRDvKvtgH/U/g/nb\r\nyJ5X2wr0aWwN74mSvtw6l3NdbMaHGdQOneR533FfNfnAFT7lz2KC3hMoJIrZ\r\n3ik7rzl6+9/0ZTaKHPqvdxKOn+e6h8YLbDZgMvbOj46KnpTf/AFSTyharrlr\r\nYH/TW5D7l6BBgmAD7h6tpg3YIn1SGNgQ8Dg6BAojI5jD27BWOIcsg/uUQhee\r\nADNi6CmknSgggEHEsi1h7hSjK9Z4Sq7dJUL7yjPuEuEp259uU+YBew/6OyU/\r\nlAvOvQrhgu3m2hqMDFbqGIo4mRAE4Hxk/NfV4AylrI5IUYAK7CG1jq0TOF0C\r\n57JABws9QGF+TNtWK1dtLWJLRkEUPRRoRH00uAjKt5/1QVPV/+hAVMzooKGi\r\n7nuHDO9+9cuGRTeGVuG+r7vrNYRNY4M8SCJCZQsrVVGeD71mmWgU/8iz1q4y\r\nrGYKt4PN0kL0hZFG1vuT/I7lpyG1r7NOkHT6Z89Z3vwEvGxWwZ5YnFuWRCqw\r\nhNLXm3/SOnJbIlbwQa0kqW8fjTby7sWlx95rw8n9nXR5aiCeZdPGCK1tCzc/\r\nenKh7Wf2ZyvYu38dHNa+u7d7qc08rtRnNz3WqXHw0S47YJBm0pgBZlHQSx+t\r\nECFqPLA5a2PYqJo9ZfH0DUbDiNUlxwfqIGQ=\r\n=vzU6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"633705dd01d68334d80bad5e354eb7e71d9fa30b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.697fbdebd.0","@material/rtl":"15.0.0-canary.697fbdebd.0","@material/base":"15.0.0-canary.697fbdebd.0","@material/shape":"15.0.0-canary.697fbdebd.0","@material/theme":"15.0.0-canary.697fbdebd.0","@material/button":"15.0.0-canary.697fbdebd.0","@material/tokens":"15.0.0-canary.697fbdebd.0","@material/animation":"15.0.0-canary.697fbdebd.0","@material/elevation":"15.0.0-canary.697fbdebd.0","@material/typography":"15.0.0-canary.697fbdebd.0","@material/feature-targeting":"15.0.0-canary.697fbdebd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.697fbdebd.0_1668790941593_0.9669225131330157","host":"s3://npm-registry-packages"}},"15.0.0-canary.d58410453.0":{"name":"@material/tooltip","version":"15.0.0-canary.d58410453.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d58410453.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e8762abd6024904021b9cf55a952925ed4eb052f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d58410453.0.tgz","fileCount":36,"integrity":"sha512-CdrhtJYtQ9tnkSj/frx20z5fwireH9WmsqbDZt/fOS30qnu9ffoJ2noO8g0ZqB26KSdDd0iZPW2b54rg9n6yNA==","signatures":[{"sig":"MEQCIE+5AgkajWt7QgnUka2Vr9OtaTdSgmpmJYZz0pDoY+GmAiAs3ZNCidcYVp0HKYI0g7mYmMKsMLFnUJq2YKLsSbMcDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd9xfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAVBAAhRHqh72Vl95zR71AJ6/cT1SVVvmFH5J8RLaikR7ffctnROB+\r\n4js6zsk2T/8L1HQ6enR6NCAauKzB8SCFfaCoZ07Bh90EqP+XOLNTm8rHBldW\r\nYBEVNb08kRcOP7it3L1P63ZNB5QuvVSg4FmqoOhsvBQCdARpHlmdngrt1aDD\r\nMY9DUSx25TF7GNSngfEP5+0eE+m4wQZfy4mqvMM+cExDq9NKPvOyqXpMG/it\r\nLsUodM6lBeXKevsw7Y4z/fW0SmgIUO3GlLNe52lNxcVnhGzfVqQRMaJXYfkx\r\nsKZQXWRd2c6UFxNzayY9uCySKRxF+psP0sFdQpXQz9NaDf/B4Q69Yi0Joh/C\r\nGsXtWPf6Lq2/RA3MjVzFXFDHwAuAbwsYjxuw3zHIDz0dALgMCgPuhyNYjCWq\r\ncecIU0UPQ6ZHMCab5T7wbyLkLZ6bRmHFoNaJ5OVVt6Wvzu+dOy3sSPQZ33NC\r\nKSaw8qaGQlM7kzAhwIkv8DngFLZF57vtrcfs809DrnnA3QzA5YKaWQFixFyb\r\ndj/kY5ln0TQVNa5piDtzycltZ5oB23M+cRSvHJp4QKHTILIJ7OssnDxFR27l\r\nUrigrD1uWwntHd8hCCIRysGxsHErAvHxruGFP40r5z4fHvcS11b/ZfrYjTZo\r\nD2+mrkBeKlOquxz5Corg+dFUyH9J9wrISQI=\r\n=j54k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"65248afd9a1318b7afdd324f3def6a9c8e67c90b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d58410453.0","@material/rtl":"15.0.0-canary.d58410453.0","@material/base":"15.0.0-canary.d58410453.0","@material/shape":"15.0.0-canary.d58410453.0","@material/theme":"15.0.0-canary.d58410453.0","@material/button":"15.0.0-canary.d58410453.0","@material/tokens":"15.0.0-canary.d58410453.0","@material/animation":"15.0.0-canary.d58410453.0","@material/elevation":"15.0.0-canary.d58410453.0","@material/typography":"15.0.0-canary.d58410453.0","@material/feature-targeting":"15.0.0-canary.d58410453.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d58410453.0_1668799583629_0.2217931145863552","host":"s3://npm-registry-packages"}},"15.0.0-canary.7971d6ad5.0":{"name":"@material/tooltip","version":"15.0.0-canary.7971d6ad5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7971d6ad5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"145f8b8aac15645374999c58a2674d27c61b7daa","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7971d6ad5.0.tgz","fileCount":36,"integrity":"sha512-gidVGZOGmJUNDxm3ZorNZMAFmbeFmJ+6DH2F45hi1iU/GflfyvMfvbG2VvPFGYj84YAKHs799yAjidvk1nSZZg==","signatures":[{"sig":"MEQCIDrv1UZX3KjkgC0bvqAOGWs3aZIW409lhOn7CuxDdw60AiBXlwei7QbDUeyUDLUDdqhLt+BDSPEzVE6GQI7GvQTHqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjeJfhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2qQ/9Fu+BKeyTsFylmIsNhYu3lUbbBvzZL/I10ky3J05bzmQFVSQU\r\nBk58KsoEG8OmclxMf4wmUdGDtbxXQ5cOVrrTEirTrPotWTZqtOmUKeLxLAeu\r\nRurhHzy28OUHw1jlLxsmE3WTZlynO/vg8+z1a0S7n1KEV+R8yI1r4nKwTFfi\r\na/U3RMzlYz3SyugDYLiRnrpw6MCSPp0d0wXHxqvgNhtNe6j92tlaTkNYNEi4\r\ncaJt13obh1NKB0nZDPjWHUTPvKHTtNZ0cEVsozZZbvoYbML6YJUItCXh5BfJ\r\nPFMz6O/pBprVLtU+Y03QxBC5ABGuY77N2cysjyB9eUPbJ9GbdDSuzSO/5tTS\r\nqrMgBzEPrd7kbK57lTR/33vm2ctO7KEUb72OhHulQQyDwLY8i7N0bN+VtOuR\r\nggIa7ckxumnraK1ZsXogbTynNtxJ/+2T83kCzn5LAQ4ENnIwqv8DQQoi39/7\r\nOInxZ0DsLYyUoAfAEVUP7ijuxzoJ4QIi7FZE4bcS72Y49lduPs2gyUEJqtsb\r\nI4OA1AVe309y+1jQGX4QiIgkt+loeVyVUunp1oR7/FxoC4zBUqcqzB4gvnkD\r\naZKuiTydfFro5hGAOdArCQ/81k8uoBNK0GmMzmrA0fzH40GTQgu8LBFp39Up\r\nPbPnH+P79tVi26GJEZ/+Dsba43baKH0Gzsc=\r\n=IAZb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"caa68cd6e7b5cf4d64e037521bea18e312048e69","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7971d6ad5.0","@material/rtl":"15.0.0-canary.7971d6ad5.0","@material/base":"15.0.0-canary.7971d6ad5.0","@material/shape":"15.0.0-canary.7971d6ad5.0","@material/theme":"15.0.0-canary.7971d6ad5.0","@material/button":"15.0.0-canary.7971d6ad5.0","@material/tokens":"15.0.0-canary.7971d6ad5.0","@material/animation":"15.0.0-canary.7971d6ad5.0","@material/elevation":"15.0.0-canary.7971d6ad5.0","@material/typography":"15.0.0-canary.7971d6ad5.0","@material/feature-targeting":"15.0.0-canary.7971d6ad5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7971d6ad5.0_1668847585163_0.13002225276491775","host":"s3://npm-registry-packages"}},"15.0.0-canary.a0ae73b0e.0":{"name":"@material/tooltip","version":"15.0.0-canary.a0ae73b0e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a0ae73b0e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ee353b692aed903ed0dd5d4e4340342f10abc29a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a0ae73b0e.0.tgz","fileCount":36,"integrity":"sha512-RO/sjKPNNK1jJQy5MTaNCWkoIKPfPm0Qhf0CPT1bzB2aT7RmNbjbF2aF9RNibFOdn7sYIwaNMCYtwHQeIVP42Q==","signatures":[{"sig":"MEQCIHcxqsdvsdV/GnmjPO5CZaYfNudpK8CSyk3rilIU+3bsAiAu/9iwbqwsgf7UdOgPhk7oErKwYeN+hbx6nopWQKhBfg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje1kYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrqRAAmcbIKEIhtZVRDPP+L9wM9X374bQE0egoxw98SVHATNws3Rvw\r\n1wS+9vUHwzc9Pab9vw17i9C0nlcBWqpPg8BGgA+OltCT4qSQWfSFONlI0Jcm\r\nWBZEdkGfqaSVFRIXTlf3XfirytAQRvELAEEzOfLFU4eSWIVX4LvJJd+xu45t\r\n7jY675ZJfYvJiBC4y3eI3xb/MxarWxYoEwBrMIDUYizWJkCr6QG57AATAAF2\r\nCQqpVHw2P1bKLXMSKFIai17b8SPigszQ40tiMVGNZcDtMzGfOX1bCAwVsnBd\r\nBEGDfRrPmHJ4x6wT9er16gSWH+Y3gNuW8QPmZ1+a1JVJZA6AaIHy9m5tZxJh\r\nkDulWrp2c8JRD90w0OpLC1KPiTLB5G130Hi50sCzt+RdIagtM/Ori+UhfzBS\r\nsAaldd51l5AmWQ+S0rLZQjKryGO92l/IDeSFmPxcxcD338s7IlDfJsDp49oe\r\nYva6cGLCP/J/IxYVCVoQnJfsLtWzO0DrfAa/ad6Zay1SPX2GXCJ9N2nvv9CS\r\n8Nl9E5tnEOGVfG83EtzekMm/hOwTvPzisDNFEUWs5J2P6mwXfyblJLq2KL21\r\ng+K5vk066zIRnHqbnHSchVfc7OVNbmA7DwsXI49ZVEGu7HVyjC/Z4oOt/jIO\r\nrMaAnLTAiYtczpsMPx87nuYYzylpEqSiTu0=\r\n=2ElW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"92b496120a9385203165ec42657a2edf41099000","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a0ae73b0e.0","@material/rtl":"15.0.0-canary.a0ae73b0e.0","@material/base":"15.0.0-canary.a0ae73b0e.0","@material/shape":"15.0.0-canary.a0ae73b0e.0","@material/theme":"15.0.0-canary.a0ae73b0e.0","@material/button":"15.0.0-canary.a0ae73b0e.0","@material/tokens":"15.0.0-canary.a0ae73b0e.0","@material/animation":"15.0.0-canary.a0ae73b0e.0","@material/elevation":"15.0.0-canary.a0ae73b0e.0","@material/typography":"15.0.0-canary.a0ae73b0e.0","@material/feature-targeting":"15.0.0-canary.a0ae73b0e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a0ae73b0e.0_1669028119772_0.28563212938054394","host":"s3://npm-registry-packages"}},"15.0.0-canary.96f472604.0":{"name":"@material/tooltip","version":"15.0.0-canary.96f472604.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.96f472604.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a1f68057965cf4d13be62718fb26e0a006fb1fdb","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.96f472604.0.tgz","fileCount":36,"integrity":"sha512-eGl64/jGAxZ8B/vNtz4nkUrh+eq863wp85Xh5WqAbm4sUOYMF6Yu2wjP0dw/qil6Y0ZnsVt/yaITlAxb9f3zmQ==","signatures":[{"sig":"MEUCIBuO3OGnnk7qCWiHcG1S+ykkN0NQTC5wr6OvVbhLHNs9AiEAsu9tueGXBIpSOpg9DTE+u2kkIZGPtO7fViFGKalQzb8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje3TsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8WQ/+JjOSP2gB1PMeq+mTVaHl6sxynI2rVtpSU7/4mLsoaU2a/XDV\r\nF2NGwQEqNzFSs8nEJXiodbYhpvH9gjTkyl10VxhCCQmsArUlRzbDvXLf+u2k\r\noDzyYS/n0IBJTTeVBeiNS22yrvfUY7bPkuf73lLUOyupa5qALi3OwpXiV15Y\r\nX/Ds+7BLsDY47LsJT3TpOCLncBPBQwmujhkosN/yYZ6SaBEjXQW4GleXJe1K\r\nnOeG8QlpzsYgL8rRJ9x4KWB2Dh+1f8X+xyAbMrfGR9dyI9iWqYXQY7tYNu1b\r\noEZLF6tPSTeVtmcnW6jlBTV5s0jIwEdT5oH4k2m41S0bUCuQxmVfZAf2dyo/\r\nAF/0Fsk/vatZ8ClBhytHCb/S5wnannT/SIj4wT1Z5zPHkrgesR25xNRhhS21\r\n5iERxys0+ZJy2TgpyFuVVkd7/+PsfhdeEqcgq91UjgVJL4rW6lB6eTVR+zWx\r\nGH5BEOsMb2zyNHV8R2eomL538sMMAQ/sGLFWorex2ve1G+8n1UnzFyeHCcdn\r\nnzg7/MDIVrxWw1Bi5NuHcSzG9S4lQPPALg7odrPADZpLynR2VTwf228Qi0ZS\r\nd6DYh35ErHmXFjB+uEzDt/rKYHy/t7VRB0Y1A3OCOwx9GjPK0XtAC1pUi2Cg\r\n1zczm7shECdqctjPZaEKXG30mDliCA/eN9M=\r\n=OY16\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"28f313542547c982f69fc57b98811983600931fa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.96f472604.0","@material/rtl":"15.0.0-canary.96f472604.0","@material/base":"15.0.0-canary.96f472604.0","@material/shape":"15.0.0-canary.96f472604.0","@material/theme":"15.0.0-canary.96f472604.0","@material/button":"15.0.0-canary.96f472604.0","@material/tokens":"15.0.0-canary.96f472604.0","@material/animation":"15.0.0-canary.96f472604.0","@material/elevation":"15.0.0-canary.96f472604.0","@material/typography":"15.0.0-canary.96f472604.0","@material/feature-targeting":"15.0.0-canary.96f472604.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.96f472604.0_1669035243640_0.5968093744120344","host":"s3://npm-registry-packages"}},"15.0.0-canary.18b8f31e1.0":{"name":"@material/tooltip","version":"15.0.0-canary.18b8f31e1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.18b8f31e1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6fada729a86b4bbd0e117965e74aa94d3b14b3ae","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.18b8f31e1.0.tgz","fileCount":36,"integrity":"sha512-quqJ1l6ajXbEfFiQG1p5X0d1PzF/IeIyhc6xJUXWw3SD391fBkcNTPsJ9BETCgvRpzDQz/TZXS48X1PwAvKNmg==","signatures":[{"sig":"MEUCIGlILVUc9tGgdHLnjDYZ/z5AuhPnuJsLyZwsn+yd8sl8AiEAuepbs05xMTNqMaX0aRljoF7Fxt9237Oh1JCUVbH8uAs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje6FjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpY7g//bRNXRjyoQdA2yoWTw7Cxvzy2CiuZthknYIsYdqn5f4xj5pum\r\nj2t6tTqXwCvP2FiMHX6teDJfTfk7iNpNEB7XJi6yfHW1KpIDCAnXGaes6EUa\r\n8vtB4FfBPf/9KO786RQqqPQXEtTk5NOc52ZsDo+UckbRKQAlqQQqrVs29k9Z\r\n8Z8UyIHIFyysEF29I11Q1mdKL42hvLl0wwN3+Ahww2T8HINpWH1HGYvFIYsh\r\nfZngAuLZHw6WcukF7bdO8+HMgaNoft4q19grOM2S8ASnIW2q4fbWziw/Trjy\r\n4wvTegIK9qwNDzNmwQc08Y7eOmLECGv7exvS3bufNypmOgaFWUyKevCRyj0X\r\nVyhd3sRWCrodVF8attgQad+GoEDF/uUgpMQFtq89xtNKpkZLtG56UN+/09Hq\r\nbuGBAr7gR2IggwcHRh/7J0Zyym//DABq5D6Q0uF+qnSC/HVuq6VXm4PixTgf\r\nJQYbeUfKEc1Uecuj1mes/sQwCavyBg3oVSp+5pRD0XOJ3kKCuo1IVfvQ2FdZ\r\nr1dB70Gdur+8An+T2TxcIRAXLh+6EWKje5tJmI/Qj82oxQNYc/ZeoNIIYgpV\r\n76uBWrLnTxNQGQnC5i7LzGnKmsvILxrIrKRis090dhUCmmaT141dfrzN+MKn\r\n72ZL/8+7xqEXEmNjEMTuryia8uUOhMjhxeg=\r\n=8eH2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"99a6c50dcaf8c9db8b49ca9378d7bcc70fa3d276","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.18b8f31e1.0","@material/rtl":"15.0.0-canary.18b8f31e1.0","@material/base":"15.0.0-canary.18b8f31e1.0","@material/shape":"15.0.0-canary.18b8f31e1.0","@material/theme":"15.0.0-canary.18b8f31e1.0","@material/button":"15.0.0-canary.18b8f31e1.0","@material/tokens":"15.0.0-canary.18b8f31e1.0","@material/animation":"15.0.0-canary.18b8f31e1.0","@material/elevation":"15.0.0-canary.18b8f31e1.0","@material/typography":"15.0.0-canary.18b8f31e1.0","@material/feature-targeting":"15.0.0-canary.18b8f31e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.18b8f31e1.0_1669046627166_0.89729138472162","host":"s3://npm-registry-packages"}},"15.0.0-canary.912f33ce4.0":{"name":"@material/tooltip","version":"15.0.0-canary.912f33ce4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.912f33ce4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5e3490ece21fe31e7f03708cd82b7275a99d84bd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.912f33ce4.0.tgz","fileCount":36,"integrity":"sha512-FHh3OmGp8Q1UXs9DbLJ8NO8OCKZcvSDFWAm6NLK1iTmiy8HarolRN+5tFmzmjFHUBlGo709Kl520TivL9L1CxA==","signatures":[{"sig":"MEUCIEZgw8fWmwDhgHmniwq17yFcnGYvLOg5Sbl7hsh5DO4IAiEAkFwha9mzHZIiDwBinJ8cIjKtuDopiMeeI7RWzVNRmo8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJje7uKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqz9RAAlC/cbxKnwfZYJRn9+LalcUTSJP3dxI5AmWAM0y/SOfsemEH5\r\nevWdEzeeB8qaetrpOcdF0zUXJRgPujrDGLS29iEGURx6jFWXsE7QLT7bV3By\r\nw8feXVoZqrPrHlUW1y3VVGC/x7XqrbhqZ6aK0o0x8/ClOMKbbY+yV2yiFVcY\r\nZIRTCat5s2QWWvExK59/m0LlOgtPdLo0/qgGyiLlB/OPv19dIfbYJS9BtGuh\r\nQFp1c/C2wYWjXHLZWN+uTChCnVKZupZvsl9VKw8sryJpk6fBT+UpBfvZx+re\r\n/MXa2NLTgPpsqBDt0gZwuGZPAcRp6PeoJs7F6+F/o7Mg+9sEpC0gI15zO5ui\r\nvR6u41CQrpG+32gBk09eKlTC4UeGM1N/mO4PU4Zkddr0xhTQtHnQtlOO07lb\r\nk7iToUILoM9NhTXIB4BUcsCxY32m0CkTeyL/GC2QAtLeeR+sjK+lOcZzHrgc\r\nBp2dtFu7WWOB7v7UR+3AxXo7Q6wHA01cGMl3wgDiEBjhGsfVhXO4N/eIEWWZ\r\ns7x0Ro+XV7RV1rWIFcWg6XIY5ilwZiA4kZf9X3GQJxOXOoH6sdSiCI7uL73M\r\ntR9gvLNjQrEhVPyTEiYnjw3wBnWpNkDmpJfVH/RCB3mcjtRb5NBk66eKXmUM\r\n6RoFClv5p/6Q0CnvDlBFq8XYOna+O8jkoP0=\r\n=kseR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cbdf5145fa19b6681004b6c2d5de771b50f5b6f9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.912f33ce4.0","@material/rtl":"15.0.0-canary.912f33ce4.0","@material/base":"15.0.0-canary.912f33ce4.0","@material/shape":"15.0.0-canary.912f33ce4.0","@material/theme":"15.0.0-canary.912f33ce4.0","@material/button":"15.0.0-canary.912f33ce4.0","@material/tokens":"15.0.0-canary.912f33ce4.0","@material/animation":"15.0.0-canary.912f33ce4.0","@material/elevation":"15.0.0-canary.912f33ce4.0","@material/typography":"15.0.0-canary.912f33ce4.0","@material/feature-targeting":"15.0.0-canary.912f33ce4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.912f33ce4.0_1669053322015_0.3652073974037868","host":"s3://npm-registry-packages"}},"15.0.0-canary.1e1b1c369.0":{"name":"@material/tooltip","version":"15.0.0-canary.1e1b1c369.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1e1b1c369.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"07204377caaededd4d745414ddcf9545e8a69a07","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1e1b1c369.0.tgz","fileCount":36,"integrity":"sha512-kgBI2aueKQQLLiv/8Z/XA9nC1aDU+CjYZOecj6Yd1cqg6K1Jz0ptdCWvjCace0fzgh59GR2Pkx++3jaevLXAaQ==","signatures":[{"sig":"MEYCIQC3Tbd+6kUt5rAQVWLPFV+XIfjXiMzQBECqeO5GsaLagQIhAI0ZDyNoSjQGjPPTmsoD+pzs0DRKnsb2Ry88XQED+nnN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfm4tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGchAAoT2zxswvNi5icAsw/q+FSVu/2lCLtoLMhlN+j1HJFzzz/aL0\r\nJof7FAHa3wIAih2rhuGLZrqRSEncSKX4oXrutW6IotXhe03VwYJetz54ebye\r\nvpxjAcdcgKDy5tFnUN0pGeXFnr9nfUT5Jqq8AP5Z7zfFgYmPe1SL5LVrwjsr\r\nsn/E25G3uATWopl/kwzS9zGxMzUjwwiL0oZKQW8qsgWNEH959f/L2eIArC0Y\r\nuQJqCOqa9zu+x5DxTbUPQ+VJaNBgjs86kKXFxqsDBuavf233mO4DxTJWNUeF\r\nUPCKrQHCiTmyT8MFqMVXkCsNLrM2BgUdEMvNV9Ldv1Drr5o1KEBqMfobSDDQ\r\n1kvX7AwyYh3RDr2bsguLcxBnpplu4fxRoJ38RNB2gxvAZceY2QlYMp0GUAW7\r\nknw5s3vz2/dcbFCus+iY3ZERyh0O90KkB01RY5OFrQq4i8KKfO/nFOxSxS2s\r\nTmn6TCPXh6d+XUpatrrHc2bPpNzyBR+L1B6AI5SNWS1YxaTJE3pmhKM6YQ3+\r\nIXGCaiYZ1OGoKrambCbRfH5+fJmCYLy6sV52IAAn6L7ctqPh8A6yR+YZZ3Hf\r\nSeUIluhb2zYgkr4U4uFg7QZBAcfr9QnymRfElA+zfkGVUNZEiQvRHPjUcRbU\r\nVBf3Wtww76QRb9Timi5/5PMso3loJ8td2tk=\r\n=KLP2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b59baa6ec6a8114401e616de0c9d3675a34e4206","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1e1b1c369.0","@material/rtl":"15.0.0-canary.1e1b1c369.0","@material/base":"15.0.0-canary.1e1b1c369.0","@material/shape":"15.0.0-canary.1e1b1c369.0","@material/theme":"15.0.0-canary.1e1b1c369.0","@material/button":"15.0.0-canary.1e1b1c369.0","@material/tokens":"15.0.0-canary.1e1b1c369.0","@material/animation":"15.0.0-canary.1e1b1c369.0","@material/elevation":"15.0.0-canary.1e1b1c369.0","@material/typography":"15.0.0-canary.1e1b1c369.0","@material/feature-targeting":"15.0.0-canary.1e1b1c369.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1e1b1c369.0_1669230125258_0.9198964698153795","host":"s3://npm-registry-packages"}},"15.0.0-canary.a2ec49244.0":{"name":"@material/tooltip","version":"15.0.0-canary.a2ec49244.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a2ec49244.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0f7f945c5eaf1f884089a50fa53b142d689271c7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a2ec49244.0.tgz","fileCount":36,"integrity":"sha512-yIDFLtBPvgwlgrknnxSRtgmr5+9jNAAUguT7NTIhT2CsNuPHKS+miWQrGps5vXorP4LUBWsI5QkynJeoNyDEAQ==","signatures":[{"sig":"MEUCIQDsROxpWrN0pvaMSxRxMOtmn0Uvc/LC5kaUxLTwTjGimgIgLiBXneTPEoV1Z95He9DXvLmQnu+0fLiDzkKszqFYqJA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfnU9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzQhAAhfuKTEvp3xeNOcXIS6KQ8H+pHd1JoyH2U2r2AnSIwrR2fEQS\r\nNMpipbzXdk/IDXKxhDCDPKHTUyKiKxjiDb5LqefWImZP9gHwm0S0pVFsYAMh\r\n2jo6kFyJ/V3FRKhfg8s5vRXqshCos/xGx5XjECopm2n1ADdCr/oajXzq5a9k\r\nl9iI5aXw9+hZgY2bgdK68lCOR5pv0DwfY4vJSvSw/ulyiEzHz6mQWvBUkvSO\r\nqpJWJWlGYvKMzs5vW53hyfWWtaSvZDxEE3GbmuLT32E8epTZyV4YqPIUBBjs\r\nydqCt1e/svo30B8tdfc0ElTX8uV1yPvz7wATn5caKvMV/8GfAQAgKOAQDpHB\r\nSIHlKu990dNgtB0CmlqWIXtFHd5twhJc72NS1mOJMRzFqP+Sn8RYiqgbAl5i\r\nhFcwKI8KXWOO3ooe34OyLR/xgQk5WMH637S9/zxbNM8ch0qIOjrDexOEkU7Z\r\nflWWzQ9lEZoO5d8KZiRa9CQenCbGhrlexuC7wF+9/re/MdoOIPeKQbbQ2iyR\r\nMl5BIqdh6BzsvJKc5UMj2SGXNgHgRHzU21U4cQWRqFWV7yVCbtZbZfJ6it8+\r\nIPbwqBY3bpP3JfNY0owhR+Xj+Kj4pg2pXNWYK1kCaau9/4JL0qazRBTXuNhr\r\nm2XBOSAWlQmnAbSFh2p3SwTeVjWpyjbclJw=\r\n=+86W\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"fc59d471222d0010e05a636e8c3a9a5a9abe2b3e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a2ec49244.0","@material/rtl":"15.0.0-canary.a2ec49244.0","@material/base":"15.0.0-canary.a2ec49244.0","@material/shape":"15.0.0-canary.a2ec49244.0","@material/theme":"15.0.0-canary.a2ec49244.0","@material/button":"15.0.0-canary.a2ec49244.0","@material/tokens":"15.0.0-canary.a2ec49244.0","@material/animation":"15.0.0-canary.a2ec49244.0","@material/elevation":"15.0.0-canary.a2ec49244.0","@material/typography":"15.0.0-canary.a2ec49244.0","@material/feature-targeting":"15.0.0-canary.a2ec49244.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a2ec49244.0_1669231933062_0.6146681538312224","host":"s3://npm-registry-packages"}},"15.0.0-canary.a7458ba0b.0":{"name":"@material/tooltip","version":"15.0.0-canary.a7458ba0b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a7458ba0b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ae9ffb041260c9d0bdea0cbf9cb75d564cf13f83","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a7458ba0b.0.tgz","fileCount":36,"integrity":"sha512-Ed3t0dUUgHxO6j4b+d0mIjEx6sULdQZY8C1eJ3CwPhyKTpF/wEvpmftZkXBlWVyZkjK4gO+ukfU++NyIKDePtA==","signatures":[{"sig":"MEUCIAEdA8DaVRzNFIrgh6CDPf/BJ74dp0wVlFEfgY+ToNVnAiEAwP2814IOt3pVv2/wzVW3xsZ3an6FC0Daj06u3xcB07w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfn/uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqevg/+IIr0G/PTxEiY0oVg13LhyUF49voZYZo7jEpkrMjTYunKDoxh\r\n9FeTtxMiTlLTu8jPRfWqcEJTpJVkmanqg4tpm/f0vZcKe4qQs3ljrOWZ/KbI\r\nZF2WXc7nI5VC2GQLIPu8fzgP+UKFBWuHTqcOky4E1x6b4fXWsW5oZP9+OlT2\r\n4y5TB0uOUnzHdREwGFUFq+/1nd7D++SVBnNhGmPIrw8FxAxpZt6xvOeMFbk+\r\n4wDUNdrMGe6x0axdkQDwkklCKIh+TFopZd6tQ0YVopEAQgwNbMcmQbJ8XvjK\r\ncRJYOeB+sGZky6EirOq7iGiYrVyh2Fzu0OHwTBgzDwuZOZkcIlV/g4sPdnvc\r\n+QNuU3xYcl9EFFPRLk5qf3FczMVfqf1+18lEcNvRjPr1XMX4ph8j5bxxRmQe\r\nTO3/vKoc0L3o0oK3ZbDt5+6EP6e9m0Elh9GEhlGf6tfPAdp/2If0bUl/6H7V\r\nYbpDp299Jm7KQoslpqC5RwXVZjUs1Q64bQHeE3FwwdUNO80QZp38CsSI1uUz\r\n1nEU324Ft+TCwvXwp18csPTV980nEMKqzqC4pMrqGyWQHZwSwikMoS2W8WVq\r\nevf3Gw1muOy6EHuvSNo8orcewJknmrnx74txXU0ugzPcwEZ5pfla70vyXDit\r\nNJpMIzrmlWZSQO5o2bfgVfCwp2MH7YupWOE=\r\n=fYWQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"62e6a15e0784982b77df0a1d824f81d5a15cb6f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a7458ba0b.0","@material/rtl":"15.0.0-canary.a7458ba0b.0","@material/base":"15.0.0-canary.a7458ba0b.0","@material/shape":"15.0.0-canary.a7458ba0b.0","@material/theme":"15.0.0-canary.a7458ba0b.0","@material/button":"15.0.0-canary.a7458ba0b.0","@material/tokens":"15.0.0-canary.a7458ba0b.0","@material/animation":"15.0.0-canary.a7458ba0b.0","@material/elevation":"15.0.0-canary.a7458ba0b.0","@material/typography":"15.0.0-canary.a7458ba0b.0","@material/feature-targeting":"15.0.0-canary.a7458ba0b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a7458ba0b.0_1669234669797_0.8930864844617266","host":"s3://npm-registry-packages"}},"15.0.0-canary.7c35e5036.0":{"name":"@material/tooltip","version":"15.0.0-canary.7c35e5036.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7c35e5036.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a42728d3201290b149639e3f63f682b019b71b44","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7c35e5036.0.tgz","fileCount":36,"integrity":"sha512-otdIbsRhLtTvypLBVXg7gq8S0h1TShx3Fb01wDJnlSJ8yVFCCBp70raJM1lgCq1D7Jjnj+wfzQ6+PmiO9gjreg==","signatures":[{"sig":"MEYCIQCeb6oAqUZBTk39BazXR/I3jdFeNdURq0+VxNdZvgKnfwIhAO4LwS8xSkCcEvK62y+8B/9e1r3IUXNqmIZ0kz+zQbfT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfy4LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorrBAAm90Bufe9hLGGWVTKryEe+slX0+zVME3N41u4fD3IzPx9ZaU9\r\nZ/VsQASPStYHQi0DkMb/d9BlpOqG2Oo6+gHWlysJrwxOMAJoeESmDL5uXHKB\r\nKD7yDqA6cXn7CMBORl+C65QkjYJXyjebltZC5kymLYbfDvY8/cfz7N71Z/9o\r\nSKzonwPSmn/r0CSfim8gMehrZUXxGDyTKPD0bwt35fpj7FCt0VIKxa4/nkcO\r\njbMiH3c6AtOKrNgYt0LypsH2LhrQPafDHs/gxYhd4VdVCFZlfOBlb9npDYf6\r\nBFsP/aBnUNS45qKIMViE1/77jeK6K+fd+yD+UGQ/asU6pItfaOjoKWx7ZhHz\r\nwCOjdH3tGBRi2nQ/b6mVgE7enYKjjVFQHpT+cGpkoaipo8X1pJU/KSodHBDt\r\nbambMSyaA7EX+PWOQlth/inzlUEqFNFJYF4Rkt8LUXE9XXxi+FYhs8ZxYJVw\r\nl8f+Z0zvHlUOpU93mCztdEbK9UZPSJx7Vc68rzRes005Eth5MT5nWY4W9HTT\r\n/F//dndYUwLvzsbluj/YzCEmJuqIkqYdPVyBdGfwyVmJ9kyDlTSz+9wXk+7G\r\nKGDiczUSYJCeCCkhzf2PrZqkg5I0obyyTWY2CeRR2Xk4LsMsRUQk1wU32YvG\r\nG7cgynR/aWp42a+BeTwHf875/XUT5KbYMrQ=\r\n=4KcJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"bb1e9aff747feef28ef92f415776fe33dc1216c2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.20.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7c35e5036.0","@material/rtl":"15.0.0-canary.7c35e5036.0","@material/base":"15.0.0-canary.7c35e5036.0","@material/shape":"15.0.0-canary.7c35e5036.0","@material/theme":"15.0.0-canary.7c35e5036.0","@material/button":"15.0.0-canary.7c35e5036.0","@material/tokens":"15.0.0-canary.7c35e5036.0","@material/animation":"15.0.0-canary.7c35e5036.0","@material/elevation":"15.0.0-canary.7c35e5036.0","@material/typography":"15.0.0-canary.7c35e5036.0","@material/feature-targeting":"15.0.0-canary.7c35e5036.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7c35e5036.0_1669279243493_0.18703812202104042","host":"s3://npm-registry-packages"}},"15.0.0-canary.4356e05c5.0":{"name":"@material/tooltip","version":"15.0.0-canary.4356e05c5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4356e05c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2e0dab56def4d6de3da4200c205448706d7a58c7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4356e05c5.0.tgz","fileCount":36,"integrity":"sha512-f3CvE9TJMixC9gy0Z7T0e/GIYoe8LESC4qNbkQrEnsTl8qX2OhbLk4p7iXIdFIOQZxeh9QtnwMf7pJTEKodxNQ==","signatures":[{"sig":"MEUCIQDjvOnPj+D4gWnqRj4hgVcRg+wpQoKmIj/SP+bA5z350QIgYKCB+8IknthM6bLgeS3VhGB/TE4bJKPlq4YC+YTZEOs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf0AyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrd7BAAi+yH6Ldt7Sw4PCHVfIHerVP4dVtKNdUvcxivmFwIG28X7ltt\r\nQ1ecNsqGJonRq2MkuizEfyBQTtErBScQgckxM2opYGLoDl4TRXJzM6vrQoG6\r\nzuC/ubGzLe7G442Z6YaSCmIpHF+aeLjPTZoxdO5PuuCzpFb2L+8ZIhvkQ5qZ\r\nc6cOwfcPHqipTVnvlVwoPEErqD3q4syEyW+qX74Nj5v+r4UQBku6Eqyd+D+w\r\nkdePW4785f0mnwuuMhw6CYWdqGZ/6ESCeodNPomMeBg19uvLSGksejQrvWKX\r\npLQUSv+UaWKqOExXVNIe2UGV3NrdKx2bMW/0RAV3cTq9uG34b13jTXNhiz4k\r\nCrqTJ9E2FjR6W5+Ef1PZxAX/2XJey6sNLk3B7cQc/Lr76zXDVi6m/AqboZYm\r\nBHsNVJz1RnXgSPqf9zoiNuiCrAz/LWF3VsLbDW8nySm/IReb+vs3DWMwOE6M\r\nSxb0friu5wWlmn+tX4gkeshK01ZirOqLAFpd/0OdSNq+jyRvfT9pcAvlnFfJ\r\n3CzW5Y/HwxxTjUOMjYDzXC977ZIkvL9XMFpozXg0UKr1TzuQpOMUzI24Uz+y\r\nsHfNDtrqwgbTWECVXhBHEVYz1KTGoP0nSHjv/MUP08BXrFXuD0mmUzvWbDIN\r\nZxr+S37/Q/PMQtjgGa0DBTtggMpoenBhp3o=\r\n=StG1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8f21a6abb8b52fe9aa5804b940eac0cd94256fd9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.4356e05c5.0","@material/rtl":"15.0.0-canary.4356e05c5.0","@material/base":"15.0.0-canary.4356e05c5.0","@material/shape":"15.0.0-canary.4356e05c5.0","@material/theme":"15.0.0-canary.4356e05c5.0","@material/button":"15.0.0-canary.4356e05c5.0","@material/tokens":"15.0.0-canary.4356e05c5.0","@material/animation":"15.0.0-canary.4356e05c5.0","@material/elevation":"15.0.0-canary.4356e05c5.0","@material/typography":"15.0.0-canary.4356e05c5.0","@material/feature-targeting":"15.0.0-canary.4356e05c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4356e05c5.0_1669283889831_0.322072231823886","host":"s3://npm-registry-packages"}},"15.0.0-canary.cb605f8af.0":{"name":"@material/tooltip","version":"15.0.0-canary.cb605f8af.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.cb605f8af.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0c650dd3ef4494f2904181764aabf4890f2d38ff","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.cb605f8af.0.tgz","fileCount":36,"integrity":"sha512-ShDsNhlt441EOnoi9Pebd3xVYoajkD7oEIyQZBIoxqdvWJLruWbwZWGnRzE3xSjSIJhRQT1AyFMcSBgMS63a6g==","signatures":[{"sig":"MEQCIDDR1VCm/p4Czk3kOAC+LcRVvXwf+DQTWsqEDC4GHLkqAiBzzsR/OevI+QRKkV1qaybSWP6fahwCbQDoPm591ZBInw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf0SpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6kA//U2AkYtC7bI8JI4Hkzgh1wKVfJNKKa+pirVYdSqPu9IgKZpd8\r\nZh7+swqTTgZlwwOWvOl6WDkFIIWy2JrJkjIl8QW3TNhz5ACSAKIg0Nmm6F53\r\nhQXgxs0e1mUYLShcQNSGjjArzgeZYI+nQw9DkPJLdjQvJ9Gvu6QVyri4erAQ\r\nSJ2yQGTVoF7Tnn8zty4G15ajTrd4rXL8EcfZfkI2MQA6Z/sryyPbXnLmYOGy\r\nIEm2bFmM/eG0TBZwPDb1QNvfFAozBXpjDpTfebHBqAM8QLkWcSSghHfSgMei\r\npYh66DQQuB89phY1t3jfvp4lcSINo/N1rBi0OrcbC4/F8UWRiv+vD1slqH/l\r\n/ZVv+qdwb/He3hqYFTZCUF8oUZJoEkS5sSkjjGJ/KgKa7A3ZW6PM2q2GRbPi\r\nZoQxXvuDFUGXh2d7n2KfPhnVvFgFA6qRlob0MJVZZIoppN6n8T7eRKQM/zFd\r\nx90GqHENKqcCW3+nOLCkWUcjTWmW9poIn4CW6eoIFXS78UW4WIvFr4/jovVP\r\nHgoHTfVSiMCa8oKv51zoqNoor9i/M8bvlEJ+G0mWe83bOlycjalKXyqA71LQ\r\nl4k3NCLOEuWnxmAXV7+gCKUqEwpAILxLTutvme7WQMnHnoyJs/A6/G3+/hLM\r\n/TySKavhVSQKPqr1WIh24wZLPLhKkKhTxg0=\r\n=4BF/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9d617d11bc1506bf595e8a4f05413067775d3880","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.cb605f8af.0","@material/rtl":"15.0.0-canary.cb605f8af.0","@material/base":"15.0.0-canary.cb605f8af.0","@material/shape":"15.0.0-canary.cb605f8af.0","@material/theme":"15.0.0-canary.cb605f8af.0","@material/button":"15.0.0-canary.cb605f8af.0","@material/tokens":"15.0.0-canary.cb605f8af.0","@material/animation":"15.0.0-canary.cb605f8af.0","@material/elevation":"15.0.0-canary.cb605f8af.0","@material/typography":"15.0.0-canary.cb605f8af.0","@material/feature-targeting":"15.0.0-canary.cb605f8af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.cb605f8af.0_1669285033156_0.9669709836972087","host":"s3://npm-registry-packages"}},"15.0.0-canary.05fb07f9f.0":{"name":"@material/tooltip","version":"15.0.0-canary.05fb07f9f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.05fb07f9f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"996c7096033a316a23e8f7a0948301bf0b3a61fe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.05fb07f9f.0.tgz","fileCount":36,"integrity":"sha512-jgtLXHDF7hnL+P38pIjrQpSWyJ1T04BiCT6XZnFa+zob8NeiOAxS6mfd1fmHGQ4gE91ruCStUMB3Gaec+wdzrQ==","signatures":[{"sig":"MEQCICfJFDsHECUaRTX0gpbVgcqaJMFq42wQUCH1GDHEN20+AiAQPffurTC0HolKl3aXmqTxPy+oTaHERco7yrYsFFflxA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf6aVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGvw//UU8yQ2AwzRXeJ1QVwAYoudqOw6AZ71n7PV0uuPun5EVW+jeb\r\nxCx47cnquqge6Sc/EFd25ZyDuEFSOcjCotbcA+DqTm1nZ/LCXiytoqkUIJVm\r\nlzB/jp559uwAYMxUnsWfarw5Vf9494yYZtny04wzPKi4pYN3SPaiVYzd/Wiq\r\ntR/BWJ2eHMowmsytwehqsNhc/pBe3twqKZdjJ4ewnMfLSKxnP2pGrcFTjcZC\r\nIAXQCra/zT2m7SZpoo8AFvXT8sjqyQXqdIcrIq5EB02k67omOsykvI70O0pF\r\np48EhQ2yOQNC84W1lCal/PQuXYODU/uTgOGk+xNT3rhhkYyjtGLqNjYLSCGe\r\nVddvS89hm4zIFC8ndOwlQVNMtAvV55CwX8LIvOvDXrvLCwHm4SACb/KjAW3+\r\nTE/hwQcHt9MNkYcOoWQP5zJguDbAD47sPRdc9XnKww8qKyYQTH8/NdE0kPvd\r\nGJ4QPYZ5r+W8V+WVko6hQM6rH7AwRR6M7+KQ1+rMXKhT2TXXJwV96gz8DyEW\r\nEf2vAqDVkHiCsZM9Zcp6wLe0Kb/3+m+jZFBG3ST1VIbqDibejyAH3wyz6mW4\r\nJyiFox+TSPd8ifNTX3JGhIPvtt1EHhhBooqUalDu4fM08ySHpg7pm7c+nOvh\r\nsixuBQQvXwuIhKRzNlwPtCLTERHlsGQnJpU=\r\n=vBJ2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"fbbdaff1715be513be46d4628f7aff9d8f7e27fe","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.05fb07f9f.0","@material/rtl":"15.0.0-canary.05fb07f9f.0","@material/base":"15.0.0-canary.05fb07f9f.0","@material/shape":"15.0.0-canary.05fb07f9f.0","@material/theme":"15.0.0-canary.05fb07f9f.0","@material/button":"15.0.0-canary.05fb07f9f.0","@material/tokens":"15.0.0-canary.05fb07f9f.0","@material/animation":"15.0.0-canary.05fb07f9f.0","@material/elevation":"15.0.0-canary.05fb07f9f.0","@material/typography":"15.0.0-canary.05fb07f9f.0","@material/feature-targeting":"15.0.0-canary.05fb07f9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.05fb07f9f.0_1669310101223_0.9217053080578452","host":"s3://npm-registry-packages"}},"15.0.0-canary.a911b386b.0":{"name":"@material/tooltip","version":"15.0.0-canary.a911b386b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a911b386b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"628e0f7e89101e861e15cfa27a8ef2aba3bd2224","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a911b386b.0.tgz","fileCount":36,"integrity":"sha512-utDb2pBEKnDa76d1rmYZpOqMysEH44YY+aLM10P4t9BlcNZA6p3f6dO9M7/DrhrJTU3dJ/t92zSPfnR83k54JA==","signatures":[{"sig":"MEQCIG4cwwqz3YNsCuNuzmJSX0Vp65aMdlaxBKG4sGCnVDFzAiAecmRXvGo12IrqpG0XYHlI4F3jvaB6SGsDNKAgfusjeQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhOZoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9LQ//UZfXAAVigOljAdvHHh6LEpIpeDhyRe7ctIlJhWt1j2onA4/F\r\n9X9tXB93VfYW/W6lZMdi27ioYAM1l6nOomNQsKS5rf0SVtZJD8yajtFT5qmi\r\naJxceZUoZZhwUvBrvg+CfZEDduOV6t3JBma3JmN03lUkcv0odKf6+zuxxxfS\r\nZrxhNpKuGmN/NAnLcDv+Ny7QQr9LmXE46JSSbYccxCU20zgwkorJRe2aiAKu\r\nLrUl1X7Ds1kroBFqptd7t6BS0VJX6vZirrpdhOJEud73lFuupEAyb03uNBo3\r\n2Y88iX+ObPA7FLf5asvreFfwegfMSR1I4JFtagTwpw7zWynvO5uWpHMkmGYr\r\nsUGD3B3ly33nYHaYD/emOl85KN8LLKrQMY5NRSobGYE6vYx2SsSVupuC2gnd\r\nIgOZ8hUeV3v+6JGuJezwdqGtoTyEPOdP9U4ILWLuBT6CcIZgRl3Pw0kr1eZs\r\n7webYQ3PaSY1vzM8sbeBlZ4Cf0AMdpeDUBHPzfnFKgW4OsudIolD8BsuHe6/\r\nIkQPrpaSiXVjS5MTopj0Z2dNdarJ12fQHnQ1vJe03ovyHsJINM7hegN3NG3T\r\npFX8heSOlq30qGet/VmXU9gIeBp2PAE3ZZRBEzdLGMs7BASxFEFiu8ttrlgH\r\nvrZuC7uLzT1W8x/g98xKuTKt9q6hHTUoKkM=\r\n=9eI2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2487492bf1103f4c82913b328eb64ca5b71b9f5b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a911b386b.0","@material/rtl":"15.0.0-canary.a911b386b.0","@material/base":"15.0.0-canary.a911b386b.0","@material/shape":"15.0.0-canary.a911b386b.0","@material/theme":"15.0.0-canary.a911b386b.0","@material/button":"15.0.0-canary.a911b386b.0","@material/tokens":"15.0.0-canary.a911b386b.0","@material/animation":"15.0.0-canary.a911b386b.0","@material/elevation":"15.0.0-canary.a911b386b.0","@material/typography":"15.0.0-canary.a911b386b.0","@material/feature-targeting":"15.0.0-canary.a911b386b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a911b386b.0_1669654119827_0.526971790504424","host":"s3://npm-registry-packages"}},"15.0.0-canary.2aa8050b4.0":{"name":"@material/tooltip","version":"15.0.0-canary.2aa8050b4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2aa8050b4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebc288d260dfb0c4edfa4ae6ff8bbfa2ef8775dc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2aa8050b4.0.tgz","fileCount":36,"integrity":"sha512-+jhkeRc5DV+9KpbNUAU+TtFv1hYCc4+Tc2KVCZUKqQpksKS6KA5rHz9Gt4aKOBUV2y7fs9MFArW6dbH5fjTc9g==","signatures":[{"sig":"MEUCIQCCWJogaWE+iyNUKfo6A+DibJwnIMByhEbYJnRwU/S/cQIgJbnMeworfAqTjw+K8jm16S6erKfmDnRTx+RiAMQHjLk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhQhCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQmw/8D2m5GtRmY8TwwsdvyfBvttE3egWsnSDjqXNGg2PHUXgsJRjK\r\nJ3DFQCfGFt2umkbHsKzjTB5OEljqEo1og4xD1dC5hC01nuw8k8UDWukVJOo2\r\nvZaqyNnuQKa+K87URwJdy1+2hRLs+I5A88LYZ8QpUUvGTpxmKS0SBtW+CL+T\r\nnojPDwMgt4rmbuJGBKOID/lxrXRBZUIaS3SmijqUWij+2kPpIG+kEkigG5GW\r\ncuiX+RktbJbecoN8zZZw/BsPqKrTcal22MDg7nMmvm6OQ8CBnasKAkmq2Ct0\r\nD1+RyN100X4nnFGrQNTunz4sw1jrNLoQpM72y7PtWHBJrBLax6D1imiWcn/k\r\nyzqcjGHJl0bOcjxC720GT8VjvLjt7t7cNUm9q0RDuZaQAxGCtSK9BuIRA/Vz\r\nr7tA6OeWugJkEe9VVUx9k30CU2h1QEiiohC5WLXublPXJHO3YfQF8qC3ZuhW\r\nZNkJQeQDrUUKOVFM5mYd3jluu1Gqvswf8pNacoozqkAseePniQks99SKQcOm\r\ncna4GY/nKPKeY77f3v0ngN0U1JrLq5gdgrUwI578Ozp73tfipBYkRB/HEW2P\r\nBaQKvmaeCW21EYQrCYtAk1hAvEmSONM+b8XdGXHrlUDcEkW/HNQiSZ5+pp+q\r\nEk1svjBKb9bXhx2lo/K+kGYA5TK2zt40OVU=\r\n=eJIr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7ea9b47d90d470adeb6f1cbc0c1c98b88392e56b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.2aa8050b4.0","@material/rtl":"15.0.0-canary.2aa8050b4.0","@material/base":"15.0.0-canary.2aa8050b4.0","@material/shape":"15.0.0-canary.2aa8050b4.0","@material/theme":"15.0.0-canary.2aa8050b4.0","@material/button":"15.0.0-canary.2aa8050b4.0","@material/tokens":"15.0.0-canary.2aa8050b4.0","@material/animation":"15.0.0-canary.2aa8050b4.0","@material/elevation":"15.0.0-canary.2aa8050b4.0","@material/typography":"15.0.0-canary.2aa8050b4.0","@material/feature-targeting":"15.0.0-canary.2aa8050b4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2aa8050b4.0_1669662785841_0.6782454036982257","host":"s3://npm-registry-packages"}},"15.0.0-canary.323904a9f.0":{"name":"@material/tooltip","version":"15.0.0-canary.323904a9f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.323904a9f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a6df29dbe217fd5f80398a87a14438ed4d46a275","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.323904a9f.0.tgz","fileCount":36,"integrity":"sha512-ENb+rsyhENQeQpZP7zC5nhpFtbuA8MNMHFFe2nezDbbnotl69HaHL1Q/cfO5U3WkH6KhDoybwGQsAh40Jf1snQ==","signatures":[{"sig":"MEYCIQCPNthCwKUskPASy+lJU0QEYYrw70Uyju5D72VH5OZXIAIhAI3Y/+hxwvDWJKpOAqExeChYlnSkM64U1pvoYGfVuD6+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhibTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGbQ/9HpUgdz50z6Mm0RJ0qtIZawk+hX21oyhMaAoKRL96lqYUv5OO\r\nioGDHHFAIquQ9PJEtjWMfz7MhPDfn2yzNcqNV07xIgSwS03YMmTqPd31/FS7\r\nRtgTcQ1ofqIOltk1qOYG7pVzx9zbL9vT6QYB1rQx0en87T8hR9khpKZnvOSa\r\nIwuO87EfFdHouIw936uxBXFU2/FM80rVLOkN6/ZIEDQi381ZAjjhV9BtdwmJ\r\nF12WBDdniPWEZLJKPenYNF0eqqFE1VKCBxkT47DdFZrjVwgVEQ8s1nsqOBFs\r\nouCNg6KQpefmR9SpN3yaVEoAZT/kSyTa6le/nsxI1bNNUYySwAy5yb8/alFJ\r\nk0ujQ4uKZO+dGqRNHwq+CIpOwgtbDPKZKZe9kzgtizJD/yS90l3M0CPtR+Gu\r\n/xPNR2UXLRqQsbHvER9c+OyP8wuqPK9fbcyfXeTEyaxlpXUTUSqJGerA0bkA\r\nsoFR/2XdDjcPmhtCAJ3FoVqBIaCz81uehUw7VID4PeTAAcneVhMwArj5KEnA\r\nIEftSe3vd3jMWzTnqVJ2G6lI8a3/4Q1488CsTaUIaHYSTqQV7eqL5LhZH1Rj\r\nBCdCWK2W7ARIjYoMVmfSTsneIiYFb+p1oc2MJTms5zfvZPFGO1+sNCQL5gVT\r\nNZcsUuK7OK/5hqXZBP/9gdKXK5OAeoQ8MJI=\r\n=P+MN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a69fa8c7160aaa07d868f5bc365076bdb159bf99","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.323904a9f.0","@material/rtl":"15.0.0-canary.323904a9f.0","@material/base":"15.0.0-canary.323904a9f.0","@material/shape":"15.0.0-canary.323904a9f.0","@material/theme":"15.0.0-canary.323904a9f.0","@material/button":"15.0.0-canary.323904a9f.0","@material/tokens":"15.0.0-canary.323904a9f.0","@material/animation":"15.0.0-canary.323904a9f.0","@material/elevation":"15.0.0-canary.323904a9f.0","@material/typography":"15.0.0-canary.323904a9f.0","@material/feature-targeting":"15.0.0-canary.323904a9f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.323904a9f.0_1669736147337_0.3097083385257282","host":"s3://npm-registry-packages"}},"15.0.0-canary.168a629a4.0":{"name":"@material/tooltip","version":"15.0.0-canary.168a629a4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.168a629a4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8e112b573b7ec6b7102e61980f85213dea629741","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.168a629a4.0.tgz","fileCount":36,"integrity":"sha512-JeAJrh6Lh1HXlb7bMMeIfyEGmTAtlgqOlalgS2oZPW5i030zoRcvzXuVgYqjWsbhGGTiq80V6TcOUuBbLI+RKQ==","signatures":[{"sig":"MEUCIQDGDu53H0pJrz6o/SWhYIedq+NUp3jVUjiicSeeOlyb7gIgd1cOeKXLIuXRFxp8iqG/JFD+L+LijxIAYE0W4HfhVzw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhjhoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbQA//QzvoDpbpqzFyJd1axgMj3ztpzjwI5aOHxQkaHN4w8boKNXXs\r\nRmM/vsPcfg1X0Kd82PaTwTfb5jc/Aga9orwwLDfnTm+fPhnoCkKycFuI2md/\r\nHfxf3KWZe44+GGWx+TR5OZTytBebXfJ4fQKfVF9OBtkXKfX5QsvsFFnr4OUK\r\n+Ot29SQnnk7HI3P6ghtKRhTABgSkivPjV+GJCnxL+dUAdnAtQgcXa5WnBRdX\r\nY0lKxibZVIYbmyoTJggDkhBBFZPsXBg6wwl8rIK9jH89nvHqcles5I72teL0\r\nT+cOS3VDl5zO5JYZOnbZbZnelcZmHkofQlQ6HFveZC9Y5VLvwz5uMY5LUBHf\r\n5UKB4qdnpcw83qtxRiFe5yof6SZ2ta6R8S3aoAgbuCx92qVsiHWORwByeokQ\r\nqKgEMvzuJaAjrKZevmS7YWWsyhuvQNZR6zc3ejR5rrMiC8YnZ6qAyJIs/ecI\r\ng2LaMwm5vF7o2GAzKFa1pog6AdaJRCXKvMeDF13I0aLzCfNtMw57+qxQX2nK\r\n3Azzy0VzkxiZVgkNXspV/oTirqPrpdb2uob5REAvSbf1HXJgvpZCu/aebTa4\r\nCVVhxzfZUv/XGYKX+zmGbkDp1zcy5bcOicoS6vxU61qJZI50qob4QSQynyWl\r\nxQw2p1AyHj/4QsB9wcE6MKhBvJBbz6U6ff0=\r\n=mRuP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3091b344799132cce493f92839da8e544fec7c05","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.168a629a4.0","@material/rtl":"15.0.0-canary.168a629a4.0","@material/base":"15.0.0-canary.168a629a4.0","@material/shape":"15.0.0-canary.168a629a4.0","@material/theme":"15.0.0-canary.168a629a4.0","@material/button":"15.0.0-canary.168a629a4.0","@material/tokens":"15.0.0-canary.168a629a4.0","@material/animation":"15.0.0-canary.168a629a4.0","@material/elevation":"15.0.0-canary.168a629a4.0","@material/typography":"15.0.0-canary.168a629a4.0","@material/feature-targeting":"15.0.0-canary.168a629a4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.168a629a4.0_1669740647925_0.6329426581662698","host":"s3://npm-registry-packages"}},"15.0.0-canary.65c411674.0":{"name":"@material/tooltip","version":"15.0.0-canary.65c411674.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.65c411674.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"329ab895d15da1fe8b0b091e5dce5a5f9cf80173","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.65c411674.0.tgz","fileCount":36,"integrity":"sha512-koizsGM8UIr/CUv/WhnFDEGv7wMZtzoBlUX/itsTRIAXRDbQF3oqkGZbqtgGkblN7SCNZyl9s0g2Mhm3o1gbgA==","signatures":[{"sig":"MEQCIHLyI1TB6T1gm6s8r/rfi4UZmCek38g0oPKau3+OIGndAiAZOXeOfqKfJdLyjX8GI8XKc28G26dqH46br6ukUsNzJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhkP1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+5A/9FEle8T6a/Oke93f4kXbrsaZVrkl0BoFI0AAbRPP+5rC16YSZ\r\nLQjwnZ1AAYevgkn5RWNAYfGUYh56thiOzjkDsRQl6RXeQ+Sx7Kf5lOalGkHR\r\nj5KJc/uNDdP0Zaifm3uIiDPmBtjBRlh7Ry9l0phw8fPLzNtVwGH0yKl/WVt9\r\nna+ko+ePeISDIs2HsJrtWkPKdqf9SUyQRqQFmCs8M9tTgtBxw1eqVjyL3/E6\r\nVOWtZcL2EYdISgVg8yVrYLhGg77V0KqecrZsu9iz2NSkpCDKVqP+Jccd+An+\r\nFuzlDRZZ61xXP81qXUBxxfL30RZ9tFGDn4oG+cJpzymOjenFVXOShdLNJZe+\r\nqe+s2OKgLKatxUDp3S6CQsmkGkhyAE1yYs4liSu0+x5C594+IcyrI8zH5Gkh\r\nhkYrCsb5yMzHut9niM8jL6nFGIac0TCMbf4Xf2vUzof5qqqBixRUPz18QADB\r\nxbqUY3zaGo9DBRbmhrDAzT3Cizm+VC5TUe48I27OiXFx3qBSq35Xg/LZvogR\r\n44FZuhXHix6mQUfbuREIMyTeoz+cjJJQA/qGHLZej/Af2PqpZ2XP5L3j2BRu\r\nfxxCN3O67Tbyyd4PzPr5jIC4lLnOIN904kHCcadardyrHa1QUVnIYlxPX0De\r\n0Bu44GcpT/RirbR4Wulg/ox8OZutQHWUimk=\r\n=Jj4e\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d80879a8c467caf0f52227ec97481bf5b7f2cb16","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.65c411674.0","@material/rtl":"15.0.0-canary.65c411674.0","@material/base":"15.0.0-canary.65c411674.0","@material/shape":"15.0.0-canary.65c411674.0","@material/theme":"15.0.0-canary.65c411674.0","@material/button":"15.0.0-canary.65c411674.0","@material/tokens":"15.0.0-canary.65c411674.0","@material/animation":"15.0.0-canary.65c411674.0","@material/elevation":"15.0.0-canary.65c411674.0","@material/typography":"15.0.0-canary.65c411674.0","@material/feature-targeting":"15.0.0-canary.65c411674.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.65c411674.0_1669743604847_0.7074201423606903","host":"s3://npm-registry-packages"}},"15.0.0-canary.a86d36fd2.0":{"name":"@material/tooltip","version":"15.0.0-canary.a86d36fd2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a86d36fd2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f06ec7d667208d70ee42a3961979910e226cdaf9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a86d36fd2.0.tgz","fileCount":36,"integrity":"sha512-HKLCgLQHTbahupQlEY5vfcP5XiyzFn3LaGHeLOPi+qF/i/iYnakhoNfQeDI12YyXr5aGuOJAUmTpdLHzdSV3qA==","signatures":[{"sig":"MEUCIFeYwKMJI6MVWCHfM1YaggTfFXTCSY0+JU9gI7sHyaNKAiEA6P1VmR8lHBT+QBnr70CzNKCdhN2xHpPU5YuJiVaBW0s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhrzGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUWA//UFLhW6v31VkGsM8I2XZuHNxAJ6NZuLCiRdx93RP167W1Kgxr\r\nxU2p24df45guqrcAnKLw+XIj438qC3DerfEi3Y5yDRVkDtT0Emh+/cCyktf4\r\nah3OYnaF8diiynfsI3B5fYkwgaYzMIY73oMMDeixaSvQqtoL7JK0LAnTqqo7\r\nhOje+U5hJfW/pKuuM94+4WoUFBI/6Ch9k0elS8b72YENtrJGdPZJTOPqhkWP\r\nyibg+vVWftK6hc1WDROXpPmIxgBDXb7mGbKMak6XNwxTvmZVpJF7wUaerdJ/\r\n3utzQ6jeTvue1LWiNb9t7aWshAdEOxTXfXodeSknbZREeE+CtQ9BOy8QxwHV\r\nf9N7CyhI/9t/sw6liSAh7pdQ46PP+nKv8zWeY9c+6oRgfNJpI9VER9i73yPe\r\nKNNsYGfSGbiVXSF30DkQ6ZLZeXS9K5q0KW8ELNNvjg8V3C1Ama6dxzzhB5nW\r\ndyqi2FvtnbSGtMK9Lc6PGaNsiMEQXxP4NFq7zYHDg4PuDbztbYPb/0eHEbvI\r\ndQ1FoEBi6nVPfZ9Lgg+RGci4PwK2UIle2wQyLLQznJ7ZE1TC1gbloAIsj6WQ\r\nGzwPpOFTJUx01Q86+0YoORmFgiYMCBXLSRYwpgtsHlw9UgGAyBFbZn8frJ6A\r\n6YzaxZAVmOKZKP+g9Pr7Q4sQqwtT+RkKqFg=\r\n=zsWf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"85d3ff6d42516ecc839fe336441543c8df62326b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a86d36fd2.0","@material/rtl":"15.0.0-canary.a86d36fd2.0","@material/base":"15.0.0-canary.a86d36fd2.0","@material/shape":"15.0.0-canary.a86d36fd2.0","@material/theme":"15.0.0-canary.a86d36fd2.0","@material/button":"15.0.0-canary.a86d36fd2.0","@material/tokens":"15.0.0-canary.a86d36fd2.0","@material/animation":"15.0.0-canary.a86d36fd2.0","@material/elevation":"15.0.0-canary.a86d36fd2.0","@material/typography":"15.0.0-canary.a86d36fd2.0","@material/feature-targeting":"15.0.0-canary.a86d36fd2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a86d36fd2.0_1669774534697_0.19966297253173027","host":"s3://npm-registry-packages"}},"15.0.0-canary.3a1f46c66.0":{"name":"@material/tooltip","version":"15.0.0-canary.3a1f46c66.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.3a1f46c66.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e595d8c186c9c7ae8f53f8108d14028170263895","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.3a1f46c66.0.tgz","fileCount":36,"integrity":"sha512-aXbzRHbmneIEPMuL3d4b0xSJwHikU2tlNEnQGmymqA/Qv1HkkvuHvSqaoXljwxUwU5Ge0pOD93+jYkXn2kzPfw==","signatures":[{"sig":"MEYCIQDG5AQf2yxwEuceAz16LPO0UvQjbp/F/YfEZTYk/mzxmQIhAPU0v2omZb3nx/ip61LOByVBJwPHVMGN7IXebaQGZg6r","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh0fkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIEg//aarOkxhfCH5pBQ5iDNjISnKL1MmP0knC6gX9woR+gPPWenR7\r\ntyeDCuri9kLpikIs06HLU/xoeCU14lSPQZ3/tP0di521KaNvgtM0lumFDx7H\r\nSGUKT8p6L2HxXuAtcXaeNSlePnEAMJrmj/XvDH5VU6brnnJ1o0Mza7Xwi8pk\r\npuomCpI9G6OPxDGi08eMFlcc83EukFdG2uW9WdLTKpUiMEpH/KqUs3Qk4evo\r\nRBTfeW+ZSxnSi4s2Spa7n77KFs2J2JJhkiMmPsYJx2E/Uyox/Hhbn7jWnw2d\r\nV7nUwxx7sDeBjNMyMoTJf57+y7L+zNDZF+TQ6TdKXwyhozhdsRlTOD/B07RN\r\ncG41N/SB97PsN2UbiVkMnRgYGVO5WC17lJHoPVb3eB1+af2BB+r6VpYoQnTG\r\n6nh0uaxvNgFtOXznZ3Vf4Q+tBCPZj4lYfDc+h/AiH/7n12FJz2PQF3bzdA2F\r\n81MLovC31oxH3kga47nYbvT0VPjrsiZAcyXjs/gN4YcidBJKVTf+lF3UIaux\r\nezdzNTUvPJXffwQjO5E17BFmn8nEW3Hvvx9o/QmY8PAh2ruJ/5u8SksfUcEq\r\nP2lxcRbG+vark0HhZH3Qbz2lfgmxJzGF3PhRYiPZwoUZGK/RX5MNNtQdmZz0\r\nEGwRyOvsaedXv1rIWqwxvAP4fnzrHGwk3NA=\r\n=iVjI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c3f9c47a1b8fbcf554e1fce6da44837b6d412e2f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.3a1f46c66.0","@material/rtl":"15.0.0-canary.3a1f46c66.0","@material/base":"15.0.0-canary.3a1f46c66.0","@material/shape":"15.0.0-canary.3a1f46c66.0","@material/theme":"15.0.0-canary.3a1f46c66.0","@material/button":"15.0.0-canary.3a1f46c66.0","@material/tokens":"15.0.0-canary.3a1f46c66.0","@material/animation":"15.0.0-canary.3a1f46c66.0","@material/elevation":"15.0.0-canary.3a1f46c66.0","@material/typography":"15.0.0-canary.3a1f46c66.0","@material/feature-targeting":"15.0.0-canary.3a1f46c66.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.3a1f46c66.0_1669810148347_0.292990131349097","host":"s3://npm-registry-packages"}},"15.0.0-canary.32d8a9648.0":{"name":"@material/tooltip","version":"15.0.0-canary.32d8a9648.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.32d8a9648.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3c09018e9e57fda511bb43dfbf5e0a2202b54222","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.32d8a9648.0.tgz","fileCount":36,"integrity":"sha512-ESTbw0jf7i+FjMQEQJ0eZpGFWIXP2bp/Bn8P+4hYcRyjVAFUxHduz+XzqDlnekjXoiAj+VhvlF+KEM5sMBVDgQ==","signatures":[{"sig":"MEQCIH3kLZ+uvQxFkVYOln1j8iS4JbxyoSNrQhlWz0RW0OvhAiBXWzx/AwY9lPZrWqCddBxnd3lFTssXW+Dz8hT/m7H1Ag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiOS/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqF/g//R1Tl7A6qf0Ogn4d+m+9Cl3Da4CbMZ/frrrjK0eOEx6ZGR53q\r\n+tOLAve2/v48kq3SleT4X62+3CHiHvYLoosFilNQ6y1ybPYK8OBX47+AVTXy\r\nKCQuEDXyAEIfDuOU1uplatnpCgHVxueZ1zZuhF7it8c+3ZZLiqJtOtvsxg4s\r\nplSWOLxs0+5f85MczItlsBNCXxGQz3lF/mH2txRabJQMVmyQplpZyFzurPUo\r\n1skrTCfTQqd3pENj3BzttJlzPyBbICWUGGoX7lHhWsTzDAMsUs6DW8hcq3s+\r\nt1l1u3JU3veGfVV1CD/pU9p4YEHgbJmTRhBmcmCFULc2XQ9Jh7TeLIirgcbl\r\nPWwRfsDHAJf9GyyUc1bxGWjoJty9UZaLog+ZCXbXZVPU+lzMqYln8v79qwM+\r\nNYRA7cDayyYSmQaQCBbXqXr/+o/CaWLGFpDVcZqEBYq/4BbzSmwphvvDz5rd\r\n1I3/zc6ioYcyk0nRdsK3/jS9inaycwImQzQmT5bX6XiwWoCwg+FjaGr1Aok2\r\nD/UfJXBaU9osoSX5X1nkevGMjUi4C32gh9Oz7qmb+6igFtNvNs6Ze6Bvbrv0\r\nR/1n08p7Wfs8s6X8LSmNrwWuxqPETFkrDg0OtJdde/n3QzJELsFzxOEkxjf6\r\nEpjNFArD73V1cjR19iLiaEPo89UA4NQNmik=\r\n=G8F7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5833a540d2f362be3d86a707323bbeb6cee2c627","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.32d8a9648.0","@material/rtl":"15.0.0-canary.32d8a9648.0","@material/base":"15.0.0-canary.32d8a9648.0","@material/shape":"15.0.0-canary.32d8a9648.0","@material/theme":"15.0.0-canary.32d8a9648.0","@material/button":"15.0.0-canary.32d8a9648.0","@material/tokens":"15.0.0-canary.32d8a9648.0","@material/animation":"15.0.0-canary.32d8a9648.0","@material/elevation":"15.0.0-canary.32d8a9648.0","@material/typography":"15.0.0-canary.32d8a9648.0","@material/feature-targeting":"15.0.0-canary.32d8a9648.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.32d8a9648.0_1669915839330_0.48350152530874246","host":"s3://npm-registry-packages"}},"15.0.0-canary.03618ab70.0":{"name":"@material/tooltip","version":"15.0.0-canary.03618ab70.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.03618ab70.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3e211e9ac514acd112142d6ab0d9474f470e0736","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.03618ab70.0.tgz","fileCount":36,"integrity":"sha512-2fyMgoSbUMtuPbnv0ENU0OF8XWGSOl+ScVygbbFOdgIo+YF6BUWzUAmLgBACOZ8TFbKYNuWL/ievGCqT6n+7pg==","signatures":[{"sig":"MEUCICSwkRW4GTYtC9D9o3uR1bJ9RhapLlR0tslIg12M98MGAiEA4jnI922mx10n0DgmejV+lC6oDl7ce3KwAhEdF3oDNRo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiRTQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8cw//Qe6EN1mMwS2mpf64V22gVGMgQOOcgUrWjgAEmwnsAuRErVy6\r\nhHQLVsayk6Oq+g2PGjRitgrFbE/CrQouX6xNHlj2upEW87uo9DMVbp5aWK/c\r\nK1cvVWbKJ6t2aYX+P7+Dll6YYVAB/eUEWQXRGtTLWzMJq5pfghmJJC4GcDNO\r\nV4nIvdUL0JBJ2m5otfPcaNHC7Yjc+y6m9rMkLm9sKKgH0lSjie1nr2B6/zEf\r\nHMKQ9KrRWQkXvrN0tqdQhk5UcP6GGVcU1oR/5YX4p37dw1vBBAtEtPM4TcQs\r\ns2Z0WQokicuB/1TbAduRECpDRVvK0Om0tSvKaEnqYRra/jN4dnuAOdCjCisT\r\nEjr8CjDECLZiPaIGjC4Cf7zCVpTwzuysSjJD+WDmu7rrzvN2aQYIBoqWJWHx\r\n3NZhXJTl2NzhqqwsJbLGatgam2ghLArb0VGBYb86EM0RnYizzKrs0Lq/kHey\r\nS3ww2l8hM3LseHXVwGBMNAwoN5SON42XTKrrhHdHJ1AjGlBCzjSbwJKH17fZ\r\nYhGNzn6VYcPUZKXKmBB+oofsgGnMhcXCwYD4/Vc22LCMqS2TGBRHCboFwHm6\r\nE2Rnrp5SVKtyAvUl3UutsisfXKKRcAQbX6cBp7SrfB82ZpW/bAwlgWnGrGV2\r\nPJQsFdK7cegwWeGNKkqp2YdlkNQZhOBqhgU=\r\n=LGbX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b7755627c14a2cf095b6ee87d1ad15c14430ebad","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.03618ab70.0","@material/rtl":"15.0.0-canary.03618ab70.0","@material/base":"15.0.0-canary.03618ab70.0","@material/shape":"15.0.0-canary.03618ab70.0","@material/theme":"15.0.0-canary.03618ab70.0","@material/button":"15.0.0-canary.03618ab70.0","@material/tokens":"15.0.0-canary.03618ab70.0","@material/animation":"15.0.0-canary.03618ab70.0","@material/elevation":"15.0.0-canary.03618ab70.0","@material/typography":"15.0.0-canary.03618ab70.0","@material/feature-targeting":"15.0.0-canary.03618ab70.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.03618ab70.0_1669928143951_0.03869264757090285","host":"s3://npm-registry-packages"}},"15.0.0-canary.68aaed940.0":{"name":"@material/tooltip","version":"15.0.0-canary.68aaed940.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.68aaed940.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9533f6a2e5aa3f6cc09a72450d63e6a248364f26","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.68aaed940.0.tgz","fileCount":36,"integrity":"sha512-hJOhS3nmqhzQ3i0XZHDqtGoV895Ru93RBEbxBgUw1WlVMNY64IUUtP1jDyCBu2jok9C/ha4xS8YEjjuGJbMg0Q==","signatures":[{"sig":"MEQCIDQaRCC+HtSu2T9Q4fa7FMSWJt5G6/Y1deUmQr+RRaFUAiAoB+fYgOp0EfKbimYfKfqiia4U7Wc176zofuLtzg/3Kg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiRvSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpI2g//UqWHFzOvEtPFHHt4gsDz/ORAYn+YQ+7prJr2/cTt+KOujNIz\r\n76YBMcGPZcnm2jaqn81xeJJAgWteXtZC2iVcLVjXclzHxKwzg9LdQ2KHWmOl\r\nh5cSOvXvibXZxvH1oma+OurkkrH6Y01iuCUvQ67VZZ7BtDRhz43AnPFlyDxV\r\nQ/uEXdnQOC9LVxeFV30/INmWaiVDoxqwGfAZgo2HcjjI+8oFUKwRLuwc/l13\r\nD56GGhNDaiXbRYx2E9pcmkLgNaDfzlHC/LmVn5D7R8/gO8+OsujtmetTy2co\r\nVk/9j7n8FRbkG9DAlJPdab3CQgtYFZLRQhp/fCNtt7q9coxHUAjCzK/3eCaC\r\nvXcbV8dl4bbCy9GuUV5JRdLoDGxErKuZ040otjKLUmDq/soePRNgc3Iq2caI\r\n4DO7ulo3Ai81T05aFTxIz9spF9URQHaKjPLrTeWGEEj4k+2hHM7Wrcvda/yh\r\nWoUa4hoGiLEJqU+ey0sFyHBbvVIw2mKlJO17gObtO7wZuz8TebciAVekl1Pa\r\nxhUIUIQwZlMIoXl7CaNuYYvv5X7nFJTmcIz/If6mT+n02HY28g7hKzrSxUQd\r\nWFUvIXr17bZAJe8h4VbP6W4MPOmGUKryqaTvXvhF78Nnm0FT8gHJmlnMPjEC\r\nin/FERVaCpFi+patyFeyvrnLupC8KSboO7A=\r\n=hNvu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6092c4f3bcdf41ae7f55d37c6ad51793eb8f040d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.68aaed940.0","@material/rtl":"15.0.0-canary.68aaed940.0","@material/base":"15.0.0-canary.68aaed940.0","@material/shape":"15.0.0-canary.68aaed940.0","@material/theme":"15.0.0-canary.68aaed940.0","@material/button":"15.0.0-canary.68aaed940.0","@material/tokens":"15.0.0-canary.68aaed940.0","@material/animation":"15.0.0-canary.68aaed940.0","@material/elevation":"15.0.0-canary.68aaed940.0","@material/typography":"15.0.0-canary.68aaed940.0","@material/feature-targeting":"15.0.0-canary.68aaed940.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.68aaed940.0_1669929937922_0.3047069939155871","host":"s3://npm-registry-packages"}},"15.0.0-canary.f0a0bbc75.0":{"name":"@material/tooltip","version":"15.0.0-canary.f0a0bbc75.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f0a0bbc75.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2f99d8db2e2493c2175e49d123af6d20505106e2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f0a0bbc75.0.tgz","fileCount":36,"integrity":"sha512-QCJmsalIYRb1r7Qswv7n+as67u2KYGJwWEFvLAUxS8BKHLkUtQknJJpXW79tJgxvg53ogGp/MbO+b46sq+rViw==","signatures":[{"sig":"MEYCIQCqM1SQONkqUeKPybVHSHiVJoyjocrzE0Xr7dS9YTScMwIhAI2GPjwcukXnjWShYgu7j1zgYQR6Kb4rgM0v6CwI0CnQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjib9lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYeQ/7BZmX2uILKwAPyNjnfHVVhtUOmu/qCeqnZxM3zpD67HLPsNQf\r\nvgFaPWrNFR1sXSQc5AWN31yboOmBMEtHUrmfD1//6W9pO0LP8WYwi5QiG9k/\r\nCBAXeN3ojoE7vxnZRUY+ABehMMJFNkNxZgOW12FANqnRpZhQQj3n7H8BnPGR\r\nin67WWnWVYP7hyrRQ4U4apRB+2zkbE6jL3KxAMgRasun3IxHhBWbR9ORF0SL\r\nTlLnXDgVVzJp4xT0NU64ed/dWUCtneAgdz0M71WQeLQ3+jfFmCOQbsdv5RbH\r\ncxziWdzsBlQxos2nEpn1ju9e2AHEEDhR2XD1sCPHa/7NMlR37RwCU85uGuNe\r\nVqKruedKluSA48tSyGL27xG3/Pit6CbvlfXZBUyPG1MB5nSi+kF4JasUjTH5\r\ncJzLYNg6YrCPptlQt8bIXpuvIQOnlf03wXjmr5/tceE87Ofcx55r/kJiLf2n\r\n5mQ/oPELStoOCTnquKO04fZPey++ovo1hlxQJ4BKLQlcpjuuEIV+UZbc/Dp0\r\nqhLqOoARRQs0581tzMdXSM6c23699B27NvoZK9gZZMNcnQtNWUdZlbEIfJcb\r\nV8lsZg9Ib99DMzF7v5qij4P534fy8x9CanB8/6pyrHkXRacxaA5tMaAUxs9Q\r\nx7/rltBjErSdofT8oqwLjCPjYj6LDWYvXnM=\r\n=XwBI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5111125522be9e3847929d9bbaf323f31e9057c9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.f0a0bbc75.0","@material/rtl":"15.0.0-canary.f0a0bbc75.0","@material/base":"15.0.0-canary.f0a0bbc75.0","@material/shape":"15.0.0-canary.f0a0bbc75.0","@material/theme":"15.0.0-canary.f0a0bbc75.0","@material/button":"15.0.0-canary.f0a0bbc75.0","@material/tokens":"15.0.0-canary.f0a0bbc75.0","@material/animation":"15.0.0-canary.f0a0bbc75.0","@material/elevation":"15.0.0-canary.f0a0bbc75.0","@material/typography":"15.0.0-canary.f0a0bbc75.0","@material/feature-targeting":"15.0.0-canary.f0a0bbc75.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f0a0bbc75.0_1669971813552_0.28690677041235557","host":"s3://npm-registry-packages"}},"15.0.0-canary.dd99c8764.0":{"name":"@material/tooltip","version":"15.0.0-canary.dd99c8764.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.dd99c8764.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d865a2c1b66c358cb8f030ed7c6d8adb6d36a3c9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.dd99c8764.0.tgz","fileCount":36,"integrity":"sha512-yPT8aIM3c5/jvEKaXePLpvjNsCH/Uch2S6F+nvKlLU9dsd0BTaA0E6SAaeveA6wt6eWkLg8wUamDCBux+p/atA==","signatures":[{"sig":"MEUCID4o/XH7nCrT1HsM+HQ20afEyAN8TUSKfImGN5bZrbqUAiEAuR1HutPGUi8yQaeEFckswJE1ICuKUXlsnfQcCurDLFg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjigVvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzRQ/+IVcGiQs5MuApgoKH2oZLPxDOA4Zn7E+TDgUaOX8iYpi9FWVz\r\n1MQ01MnkPxy1Y72hsTu2/TFLIR45HQWLctmfnYcapQ8e7R5iYLbJEGXpoTdb\r\ni2Of1xRIpsCXqVRBGrJe57a1+bR5wlI9CvkMQny8sif8jCm7AkbzKjyzscRG\r\n69WLfEQxsnIfdMNgfUNadUHNoV8+x8o1eQqWEBd2bro3LejYdWQudNUNFrpk\r\ntDfMyJCFAV3NAw8AomG5rvUwuI/D7++3pKSNrSWuxVmx1CTrytDa6NGM8jCU\r\nV8rrMu5dHPf8PYLJMO521IzJRtsD18UI/Ld1GNh34RGxtg0sNWd1dmyzsw5Z\r\nbQWONMhMboanZK+Vl/Ktw7tkgyRaA3/o/BSiFXh1b2fi2cCPm+O7J5cyFKCS\r\nHgj02D0un0B2Q9OFa/7vJwRRkYQLCcpmuYCzhD8CTfIW9vTih5rL1YP1E8iz\r\nCXXyEuK0I7DrJ4o8atdleLi18Iimihyn3Q5aff9LV7nVz16Ewx+jQ5EfOTEM\r\nHrxKGO5Oi/1i4fV7sZXigrIcYEVMMed4j5o8p6+sxXMbz8whov09r523dlQj\r\n+FCb+FgVvwSxDpPCZa3iLmg46uzDKDm9kzBk7WEVOwNbFbgBIg0lFFvWlyNL\r\nZkQbX/3CTN6WSiBCGyBPsF64TSdjK12D/8s=\r\n=KR4O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a9ff7973c7dab53b620d5be8d56e0c491cc5e7ed","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.dd99c8764.0","@material/rtl":"15.0.0-canary.dd99c8764.0","@material/base":"15.0.0-canary.dd99c8764.0","@material/shape":"15.0.0-canary.dd99c8764.0","@material/theme":"15.0.0-canary.dd99c8764.0","@material/button":"15.0.0-canary.dd99c8764.0","@material/tokens":"15.0.0-canary.dd99c8764.0","@material/animation":"15.0.0-canary.dd99c8764.0","@material/elevation":"15.0.0-canary.dd99c8764.0","@material/typography":"15.0.0-canary.dd99c8764.0","@material/feature-targeting":"15.0.0-canary.dd99c8764.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.dd99c8764.0_1669989742781_0.24290181534823696","host":"s3://npm-registry-packages"}},"15.0.0-canary.fabdcca3a.0":{"name":"@material/tooltip","version":"15.0.0-canary.fabdcca3a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.fabdcca3a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"71f4994b87381a3319c3d74ac4e0ba0aa31701b3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.fabdcca3a.0.tgz","fileCount":36,"integrity":"sha512-ue9M9icyrmJLZPFSc2Ia5ilTcVe3jscQ9i39f6AeP0lwFF8SdF9a7Tn464tTFknjIRE6MPiV3x7yrW3CfqDpfQ==","signatures":[{"sig":"MEQCIAk0yGqFy/oC0EnnD6IfhHx05GEDTJAfAAHN3AZGPz9vAiB9W5/5rmK2Gzl0JcRswyBANzV/5UZsl0H72VpfoP7Lfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjihTgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrnDg//QBjD4w4bf8iTzHJfkWfOw20TrZYMyAdWZBPVfiaLv78LCu4m\r\nKRweS5dHoBUUWHb6BlBufk2YtgW72hKRVsrgqthn347S5+mnsx58hL5UQgFP\r\nEneIMf9FMMIwL6fxZYSqegvzr1TpObwL/KOMzVMjpkgWzoopODrxrtMjU+xl\r\nU6Jq0U8fSsJkJVpy2n9XqKQl4BhHaPLvSctdnJJBXW4y9QPgH+jkdvMkhWY+\r\nuwZJz6VqLd5YnAOP4Hg/p2jAAbNrol4LOmPuL/YSyERQd+owc9tYTbVb5c8j\r\nxEAOhl/dx18Dv8yvbnc1besUBM0z3DnDUpSi78idbxeUAcskvqVAedOCrnid\r\nAIxwwmIYbH2q4Birgz+bFbsj7N8QYfmEuGrnweBGJucsLyIFpm9LgpNtkzy+\r\na8S+i0xLyJzSZGF9F6pxTs9Pu4hY694w+/LW48Dc/2h7j+7bY647L2DkAgtZ\r\nBX3pdILY3DZ3CczSFtdcEZiC+EJxgts0WA6TxMiTegoPkJxvRU6my+xFo4Lu\r\nIUXhkD3t+b1Gl4O0VqR6eXfOsmaRVbemg3hiRqY8E8zJx5ZK7pg04eCfqqx2\r\ntVk38t9Ej+Cwwac7olSI83nZbU12Jn45U9bAKC4WX8fpkhlYzmam49JzzH3X\r\nkRfWV8rswS1l0TeLx4qeEzxVkst04CUKAc4=\r\n=juNV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"18ea36a1261419acae3218fc917dab4ca111bb9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.fabdcca3a.0","@material/rtl":"15.0.0-canary.fabdcca3a.0","@material/base":"15.0.0-canary.fabdcca3a.0","@material/shape":"15.0.0-canary.fabdcca3a.0","@material/theme":"15.0.0-canary.fabdcca3a.0","@material/button":"15.0.0-canary.fabdcca3a.0","@material/tokens":"15.0.0-canary.fabdcca3a.0","@material/animation":"15.0.0-canary.fabdcca3a.0","@material/elevation":"15.0.0-canary.fabdcca3a.0","@material/typography":"15.0.0-canary.fabdcca3a.0","@material/feature-targeting":"15.0.0-canary.fabdcca3a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.fabdcca3a.0_1669993696515_0.5805487440842361","host":"s3://npm-registry-packages"}},"15.0.0-canary.2d26722d2.0":{"name":"@material/tooltip","version":"15.0.0-canary.2d26722d2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2d26722d2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3dfec5cb6d8e48d1fb989e719328e4f10bf7404d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2d26722d2.0.tgz","fileCount":36,"integrity":"sha512-TulsJ/aBbD6Mpmql+0ykhhXCGYiw47/Yvvh+dcDZho+hARaNX1gFjccTjNQ3UGoK2rkqOtf5btUSpuY5z0HU2Q==","signatures":[{"sig":"MEQCIEuOG3oMVX1xC9+Nbs96BXqI7Wme6PuwiN6BQ4p3elQfAiB43bKMQzofm+TBI7/Aa6Qi4KT8yUlT1InmGE7itCtezA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiieRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmreOw//VujJ82JIx06ynvy0ijGan3+XqG24cIc6H4bH4FAtLNX52kOu\r\n7zGJ69M7gjORfnEARne9VgHrHPWrfK8sIf0MCZ3S/zfvWAufdoJdkR3U8RoA\r\nBZ5gFuv93nemZazpmaY8GCVAHjdo2ooWRm8RpFgEKk7aOt4/K0jQH8K9s6iS\r\nzOaf6Wzlon5cxrA6ebwDVp1Zblhvy1fw3N9spcNMdQ7HYm6w7c7jEhtaNqFg\r\nqvRwbfXpw0+uu41FP9LKbS641o6GG98zZMZRjdt77YVObKIc8ycna0PFlCge\r\n2fQMMcYHkSn3IzFZll2WFUswS2yt0gc5YoUq9Vxly+dc4wlA3O20lm754Y9v\r\nk9zK0XhJJUBNBis+ts3VrWQOD8E/U+mSQu6YwQdVipcqJ65WvyXDGo4bHOLp\r\ny8Pyv5J8QbsHSkOob254XB8lmkiZDfI5LasULwySo3NyI0RVNzvfmy8g4L85\r\n/MokxUdWE0MvgPz6FTaxxUsB51obmLugmciZi6Xlodk4XywqgsziTVpfZea8\r\nFPVl6C3Imq0iEZhAOt5pZX0rI3Ob8oQiK/td4gHC65MGsF/uzY5/uzhd66k8\r\ng0EKo9WQykrKxBt6yTd9is7iCGEz6f8Sf0OUUFiUt/F7rtxIYRtY7gRrOZXw\r\nV4kTn+bDp8TdWR70BY3mGKSIdjQXZ3IlqJU=\r\n=07qG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"76df2659d7f71f74a86512b38245422ca356fe12","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.2d26722d2.0","@material/rtl":"15.0.0-canary.2d26722d2.0","@material/base":"15.0.0-canary.2d26722d2.0","@material/shape":"15.0.0-canary.2d26722d2.0","@material/theme":"15.0.0-canary.2d26722d2.0","@material/button":"15.0.0-canary.2d26722d2.0","@material/tokens":"15.0.0-canary.2d26722d2.0","@material/animation":"15.0.0-canary.2d26722d2.0","@material/elevation":"15.0.0-canary.2d26722d2.0","@material/typography":"15.0.0-canary.2d26722d2.0","@material/feature-targeting":"15.0.0-canary.2d26722d2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2d26722d2.0_1669998480899_0.9477219346883794","host":"s3://npm-registry-packages"}},"15.0.0-canary.eaa0c3a86.0":{"name":"@material/tooltip","version":"15.0.0-canary.eaa0c3a86.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.eaa0c3a86.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"51a6aa9724495d0f66e58358ded39ec898f002d0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.eaa0c3a86.0.tgz","fileCount":36,"integrity":"sha512-uF1L9kl6a+8GT8RnTTu8GN2rgKClixzJSQPv8DSoNlsYSII/wZUMIZQfcFjat76jO+/y4w2hdwJGo6I7grQ66g==","signatures":[{"sig":"MEQCIBPR3TJFI4I1wdmDYk+XwFGqejoufidxMFp/YRs+jdRpAiBPaCJMo/ZGQl/C62L7TBpkfRh9q6MSvzhk9IL1kG891A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjijllACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6AA/9E3JtFW+rvyqho/yqYqCxboSeUdRachS+8QaQbr8ATnJlzJn8\r\nt5non89t6pxSqnxWvvCNbXWGItyTaBfbE2iFNlZxQsNOfP2jB9JQnnrPwhVr\r\nr3DOvVVKbw2ElP3WtSCOBTRl0PwcnMCF4yvXG/WcNF9htmPYIMUM/wAsv6Sw\r\nzCfF1Da10HCyUP9OQwzuMbC/5cAe5JYuuf2Y8MZjW46TZ/MVfjVFxdSokPnf\r\nwC7nf0JmLL3AB9s9xB75i0A55NhUU8TxWlqPOdH/dtBPgALYLk6WeLkPlK2y\r\nsDC94RoxaCdYoP0ocQOl7sZJzBzfRcJNSjLKqofyGxiF2cKJg2eftSxayaS9\r\nDVwJd7O8SIiWMRBE+7HcZvcyygVsILxsnBXDcylH8PS8aJv0hB9mdCzEzeO9\r\nkcSLzyJ/t7uOHS8oDEzFI4cZ7tOPq+Sb7l6PtzUo/pB/0K9bN/kTrap3dBaQ\r\nQs5+n9R9eT2QvruskI4yUBhlsi4ApfFwkvEuZc4dy02gw2Kpu5nv56evFDdN\r\nQQ0sBPjKe17HouKx4OIOqaqo2RMw0Tw4W5xH13qkY24XqyuKLbtyoMGEFg7V\r\n8DYrHB7lceneNEGlSCaQdKTdW4PV7K5Haba8c41chvV9PUZBq2IY4n20IG1x\r\nd4Xz8EDzJQUdaxK8t88pNYu6d6a15kkYA2s=\r\n=SKLX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c54316c7c60bacf8254758124c9235dc48d44064","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.eaa0c3a86.0","@material/rtl":"15.0.0-canary.eaa0c3a86.0","@material/base":"15.0.0-canary.eaa0c3a86.0","@material/shape":"15.0.0-canary.eaa0c3a86.0","@material/theme":"15.0.0-canary.eaa0c3a86.0","@material/button":"15.0.0-canary.eaa0c3a86.0","@material/tokens":"15.0.0-canary.eaa0c3a86.0","@material/animation":"15.0.0-canary.eaa0c3a86.0","@material/elevation":"15.0.0-canary.eaa0c3a86.0","@material/typography":"15.0.0-canary.eaa0c3a86.0","@material/feature-targeting":"15.0.0-canary.eaa0c3a86.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.eaa0c3a86.0_1670003045292_0.7517475950834858","host":"s3://npm-registry-packages"}},"15.0.0-canary.79a613bbd.0":{"name":"@material/tooltip","version":"15.0.0-canary.79a613bbd.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.79a613bbd.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"edbf9137357e6a8ce7268c7f9774e8f79eec05e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.79a613bbd.0.tgz","fileCount":36,"integrity":"sha512-/dDMYcwWL3xqagUat0knyfSZRB9DJ0uwuDdDdCuQYLonhLvveScvV/q0pKzdLqyXPseXDuLKoHrGzwJQ7XGnKQ==","signatures":[{"sig":"MEUCIQCLbzfQ9xlRM1JGBox/3aNOHmCgOfH8mAIARTj5f7ihJwIgRvK7BetAhvdoXxWp1QnHpp0BYRe2AeQv360b715vUqo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjj1FQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprIRAAgiSOT72jmvZVxyxVc7dn7uP+CeodhK4q4szRp+aaI3RwZ3JQ\r\nHsmYEXpn9Q6I8BQhVCSLEEhwkZMlzu6xeaAFy7vIXLHCtDGKkELpiYYFx5p8\r\nar1zXp5h0TB14YdfFDuUQE1MRtMO8vZ0Wx+MUVzjyq5LyPiT7sUq8UWRFBK9\r\no+B5kirwoFk9CX/JT/fhzxoCu9JTbVJdwflP+hUBXLE4iGxmaAqh0OE5pPk7\r\nDzLXiOf/ziDDc96g+uOyeq2+5z+2Xj75R6aazqLpBNwrQ+kaZbwCPvvKQUX7\r\nZRqYEslYmtRdBS9H00LNSDKQTM26gxb7O6kbKFYyjZVAwoHW6fYy6vs9bsjG\r\ngyE9GW/xfWnBtkZMhyUHD5Vi1jHx/DG/A5zgb7I2lDoJqRiR+qOoakEbD9v4\r\nfYp5l2PbdH7pzYztdrjxXFB5iD897BQYE3YlfPQXEYrXIV08dUzAbFUNL2Lo\r\nauiE/XeIB1Rdhn/JISCkQeTiI/NM2BVJEzTkw6aN2k+/WBUlbMkFCuu6gTQK\r\nLEz5Z/hl0JloQnSdlg848toDLasj24Cz8bRxsebYyixJf4vu1yLTTpQW+Eq+\r\nr8k40894f5FF6JtAcpAUt0Rl2FkAyywOThnSas8jMW2OlXjj7OXFGiYaeITe\r\n03xXJVZ7t/jQ41fEefGKVqTcfY/zaPS/UZQ=\r\n=HaIk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"755ec1ef0b2cccdcb0c8b888d199b4748e3ba10a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.79a613bbd.0","@material/rtl":"15.0.0-canary.79a613bbd.0","@material/base":"15.0.0-canary.79a613bbd.0","@material/shape":"15.0.0-canary.79a613bbd.0","@material/theme":"15.0.0-canary.79a613bbd.0","@material/button":"15.0.0-canary.79a613bbd.0","@material/tokens":"15.0.0-canary.79a613bbd.0","@material/animation":"15.0.0-canary.79a613bbd.0","@material/elevation":"15.0.0-canary.79a613bbd.0","@material/typography":"15.0.0-canary.79a613bbd.0","@material/feature-targeting":"15.0.0-canary.79a613bbd.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.79a613bbd.0_1670336848629_0.6735710093705591","host":"s3://npm-registry-packages"}},"15.0.0-canary.c871fe61e.0":{"name":"@material/tooltip","version":"15.0.0-canary.c871fe61e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c871fe61e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bce95d78c768f1ca9c74bb08c1c2c0313debcbd9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c871fe61e.0.tgz","fileCount":36,"integrity":"sha512-lvMFZ9cakcdg2NRE7medOm9JGIrPTx+YOHvMSXC8HMe32sRdpHYBHn07Q6sVEmVgz0nggx8JH6yK5T+LqpBFog==","signatures":[{"sig":"MEQCIHL9wJlRiHmbvg9uzeua1CSz3gpSQ2zeyzy3cT++KabZAiBJDL2WMctab/ExZYILDgcpvO3wAoU+r3XYS8Kj4zJ0Tw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkEZpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/UxAAhzPMKtmrtrBtt0CGIGXDyCtMSSJrbfE1TjYd8GkDaG/HZ1rO\r\nE9xb0UmeZTfpUHk/hBe/RuDIbuKxUHtU58yMLaqm8+4Zz361mUuHXK9/eQEb\r\nqvJX6n+vJeBf40k4kJ04YkwPuMqhplNUav1vi4ikjYoRq+aGLOIe3vxvZalj\r\nJpwQbJ0QZVLvdrKyLprI+oxPhtGN0xsdUAXLLydDLxWmwJkMujTc0Rr995Dt\r\n0rQlSfe2wkyDXXlaGP3Nxq1U/QNnGFJTf3M6YbgajcedNM0ctsEcPows5hhK\r\nHrb22QyLrcGrNeagNfq5pBdd01MrJ9T+Sh87y60sPuW+km5M4fV4hjL/fqf9\r\n01Y8kOopSlCN2yM3hWxRC4X+lwM47DF1axJ1SqhRdYQelal8oVhclJR+k8Wq\r\nmHmWWo/R/TqCGXrWAgKo6XcoHcLP2LI8t2Lb6iZV8Yrh3kaEHks/H76l4kQG\r\nSxcUKcEYWiHj0R3f/pwirE0Zf3dfeVTavK79WLakYVGBpYQVw6Hxg7m478kA\r\nL9jSoYVkvrD2gUYUtdunH1Y6MZ1BhjhJBsY7Xfa5Y31e3Yenbl0HDeyKpME1\r\nASpR5PTm/Ik6BdIFwO+qzZCimQtGepFlpyCNdqc/psMzcIEnuFVaOmuxoEDK\r\nMUHGYmHCVeBWzNKBWxBJRsH8HJflwXl+rxE=\r\n=sJIJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e69be4936d1304c30ff7b83af8488b43c0ad5fef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.c871fe61e.0","@material/rtl":"15.0.0-canary.c871fe61e.0","@material/base":"15.0.0-canary.c871fe61e.0","@material/shape":"15.0.0-canary.c871fe61e.0","@material/theme":"15.0.0-canary.c871fe61e.0","@material/button":"15.0.0-canary.c871fe61e.0","@material/tokens":"15.0.0-canary.c871fe61e.0","@material/animation":"15.0.0-canary.c871fe61e.0","@material/elevation":"15.0.0-canary.c871fe61e.0","@material/typography":"15.0.0-canary.c871fe61e.0","@material/feature-targeting":"15.0.0-canary.c871fe61e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c871fe61e.0_1670399592915_0.7025726108394439","host":"s3://npm-registry-packages"}},"15.0.0-canary.9eaee7936.0":{"name":"@material/tooltip","version":"15.0.0-canary.9eaee7936.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.9eaee7936.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c8f421375aa0880a1e29e2a6b9961b21d5b1874c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.9eaee7936.0.tgz","fileCount":36,"integrity":"sha512-8HCAtkhQ5KHPcXfCfi5MuYoSnp84PolAcfJjg5gZapIp+cz7/50Q/51Hy4m3igYwWlMPuuIdGN3B+NXzYhZnBQ==","signatures":[{"sig":"MEQCIDcCLNhEpfQWedfaDZFoGLuLbvIGaa4a2h6zsjLWsVaAAiAT8blf5LCmqTuTZ92lK3VKdybWgWde3WnUL6RCudWw0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkPHNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpluw/+Kw9jqmM0a8daSuFXVaxh0Fkmc135m+/kqPwW10sex7iEKtPT\r\no6EXdqAq9CjBGbwx6Q45RCOAz8BGgtm6s2vLi8OoulaHq0x8SVs1YBF7BVHv\r\nFKt2XUc3HSfmrTnbDbEVq3cYbTYQkB7ihU/8GN7wU4Dm70aiIUVSMeu8uZ8K\r\n49ufOaALJbkWVuznncUUVMr7TAaAQiDTXj9vAnNkaOlXNgqpS3/lh75VVHUY\r\nS9Ox8U6hQtcs9RvqTxCuLgOliJPhBBLgBh3vmfMiE2DHcMgLR5JLe5aejgCh\r\nHLeFRjg29/yWZ0DwK/9wJFMJXHHWbXIfSLFeOMaDoQqBYn6OhfqXt0qjxbbA\r\nmC1FgBqMZxLvYxCwZTzvRr4Z7dqXq3s1+FlIQGBEo6dvjGMBt/l8Fw6fS5pw\r\nva55pXn37IVMQJ0NUQ8JW6HlTvZGs5qYBEAOasdvzie2w1n/tFbyG01aiQXx\r\n49wAg8Iz9R0CCFVWZgdXkpfoG1Nbz4o795yAMqPGf5uPIC/8wEhW1dxm6b6L\r\n5OeQ2KsK1e0nma0GmgKHTqmK7M5dBo4R4yePdMBCLmzZsgQ1ZTJsJsH3q6/O\r\n0eSsRdgo0jbYaujOOiNMFC7DM1Ed/thdvM50Jet5r05DpgMx5cy9upd/zhN0\r\nQXRtmBkT9peSgigBWgum3GCDNLr6kh/Bheg=\r\n=MQGk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b1b576e68a716d1a80dcdbde7a572c11ca937fef","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.9eaee7936.0","@material/rtl":"15.0.0-canary.9eaee7936.0","@material/base":"15.0.0-canary.9eaee7936.0","@material/shape":"15.0.0-canary.9eaee7936.0","@material/theme":"15.0.0-canary.9eaee7936.0","@material/button":"15.0.0-canary.9eaee7936.0","@material/tokens":"15.0.0-canary.9eaee7936.0","@material/animation":"15.0.0-canary.9eaee7936.0","@material/elevation":"15.0.0-canary.9eaee7936.0","@material/typography":"15.0.0-canary.9eaee7936.0","@material/feature-targeting":"15.0.0-canary.9eaee7936.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.9eaee7936.0_1670443469168_0.8319399146720781","host":"s3://npm-registry-packages"}},"15.0.0-canary.1d37bf601.0":{"name":"@material/tooltip","version":"15.0.0-canary.1d37bf601.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1d37bf601.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"22a9d52e85733bae6b9c8ccb89f1a41dd1e8e53d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1d37bf601.0.tgz","fileCount":36,"integrity":"sha512-pTK5XtrVXnpai7zDXtfA+J0H9VahbApSIKycKQP0jziBJj7LBWY2/SMJJtjTk5XrxC0LYKeq93EHFnqOe4iLbQ==","signatures":[{"sig":"MEYCIQCU3P2SoLmXOwcBYlWDDojCaqRmeLjIRteaH+cQqgybVQIhAP8YvQYrqOZ2wyJbJdImgAnefufXHZUH3IQprYRq9TmX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkPrCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbSQ/+LfCcM25BRO51GsuwYP0wyZQB7dCYtL6gI0O5xgybOBDdap+p\r\nABVIGyBVHAueJTtSdKOcp76aRxTrkjlBQaqiUH1dmyLjB+Nheg9qHAgwOxZ9\r\nd9Zj2saRNkzkNLPu14GeLEgd46ahZgidwWXgXa1XjNry641L7QqZ0hnmmcuE\r\n6NTONX72DZyb1f2PBxOekW1NbHSVKGYSLfGw0t3Tbs0VA3gG+svlGKFA0lXG\r\n7CJIfwJvIbwr3ljkBMMwSpQZudxkg4VIZwROSiCWBpYDs/gpc8bsuD5U42X7\r\n+iWecAXDmZOP2kC+qXhnNbwwKQ+yxCTt/pmIRCVJpPfrykKER5I85Loo+KOQ\r\nBhq88xeM6aWW4jwGcZssc/vMHVkuZdARQe3QU3UwMedxk1mHBMv6p70Imsic\r\nu/wPjul0yc5SNNr0298W3GKPJM/8XfGBJZDQsrh8BnWNczYj/eO3U9AYndhW\r\ncio14g61oABpOeCe+fwdi39/9t8erWwBpgs/NjcFExxtzbDEM8jS3cdSGKyV\r\ntBek4u3YRn/eyg6sKReQskTs/JJw0hHcfw1cOOITaKTtz6d6FFHBqpcyM9E1\r\nzLH++Fj1s6jOLhMePbOB7sdVopTpf4f/6AMOmxtJrkqwIwI+7NutkTEi9qVA\r\nF9OPCfZ5pCbHMdR4jYtORb3wjuQHn3FwkdQ=\r\n=CVws\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"747a03f19fc88f7a2358a382989e729013e06df4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1d37bf601.0","@material/rtl":"15.0.0-canary.1d37bf601.0","@material/base":"15.0.0-canary.1d37bf601.0","@material/shape":"15.0.0-canary.1d37bf601.0","@material/theme":"15.0.0-canary.1d37bf601.0","@material/button":"15.0.0-canary.1d37bf601.0","@material/tokens":"15.0.0-canary.1d37bf601.0","@material/animation":"15.0.0-canary.1d37bf601.0","@material/elevation":"15.0.0-canary.1d37bf601.0","@material/typography":"15.0.0-canary.1d37bf601.0","@material/feature-targeting":"15.0.0-canary.1d37bf601.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1d37bf601.0_1670445761916_0.8692524950263145","host":"s3://npm-registry-packages"}},"15.0.0-canary.a5fe069d5.0":{"name":"@material/tooltip","version":"15.0.0-canary.a5fe069d5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a5fe069d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2d003d726573ef8d84a9bc22f5f0e72ad4727219","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a5fe069d5.0.tgz","fileCount":36,"integrity":"sha512-kBaurDNVMs3sKNn1jz+MRnHpeHmZ4H/wMWQOguZKZGuXYaTP9pzgJoSAabfbSygMPVSk5NIaZNPlnhf2FcGXKg==","signatures":[{"sig":"MEUCIQC5DPTsdKJNUmZIhtUG0m+cvy3Dgirle1LO+l58RBIT7wIgLV4H9lvOZEUdEGlBNXJS3SGB4rofY6FtPXCcHCoMAuM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjk4JfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqkiw/5AWxNccy0c3ThwciPXjbI9ZoC6MrIYefAvgGy2cIE4CAqsQT0\r\n437jeGkKaS2tu1jLu66ayOZFEGm6vmy3uDtnXkse3hhgqqSXeftaS5ACIukh\r\nNHonJstJ2r3csjrLhoZ+NgAGVk75g+7UrmI9jkiym1H3FhTXEK3KHjMeVNHh\r\nhVtMauq1+i6iuBGG0mEL7PMg8TAFRSxKbGjqFtO1cmFQr0/CUQRVR0+HInzl\r\n2yM1imiZCvSIkw60buzB+nmWdnP/9W4XZtx0/3J3KHHgBqtDwowBM7SnevqU\r\nr3hMePBt48yBJgvOMJV0U22nYNqZxaKrCcl5kszLjYiT4Xcr48HhHebwzWY/\r\nIA8LKtMBsMt60AHQiZRB7Y3wUGlPnKVbr7+Am5wp/Jet5EikX1T9s5y8Ys5W\r\nn/1GP1q+1YqyvXHOnbYer+7HdUdIpn9Jz3lFlTd0ZZ+eHLgJAWtdLyWY9UBd\r\n4GVizjPvso9qLGqnowejzUVrY8bVdCEY1EL6IxT9quSqL4OVujVEi6g8F6NV\r\nLp7odhfUchLZD1VggMFSzFXKxm576XoOpQKTfATvEgeRBgrk5hfqER9rQiG7\r\nWTlV3JyMhp5uoKTYraY9KuCTGsegZENpF0FadlfXVYylQbJU0nD45sjO1da6\r\nmf9YXJKZbVDcp1hVPGc4Aokuirj8c00ZFz0=\r\n=qKiv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c41dbe93704a7d03ea10d8f1b4de13fb8c6e19ab","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a5fe069d5.0","@material/rtl":"15.0.0-canary.a5fe069d5.0","@material/base":"15.0.0-canary.a5fe069d5.0","@material/shape":"15.0.0-canary.a5fe069d5.0","@material/theme":"15.0.0-canary.a5fe069d5.0","@material/button":"15.0.0-canary.a5fe069d5.0","@material/tokens":"15.0.0-canary.a5fe069d5.0","@material/animation":"15.0.0-canary.a5fe069d5.0","@material/elevation":"15.0.0-canary.a5fe069d5.0","@material/typography":"15.0.0-canary.a5fe069d5.0","@material/feature-targeting":"15.0.0-canary.a5fe069d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a5fe069d5.0_1670611551543_0.9592931376030196","host":"s3://npm-registry-packages"}},"15.0.0-canary.ce8b5326f.0":{"name":"@material/tooltip","version":"15.0.0-canary.ce8b5326f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ce8b5326f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ed810ab59136f886d27565f65d26afda9b83a28f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ce8b5326f.0.tgz","fileCount":36,"integrity":"sha512-SV8BcvojpBKoF15gMatzxHgXa4EN2jT0+RGDADxXEF5g4Q8YXvt7rOsQzjvz/4A04FHEJ7+lGeIhu6zSDZcuEQ==","signatures":[{"sig":"MEUCIDcuXTbXcWbvg7t2VYBMmjLF0UN0Phn45LhfifOJvQv2AiEAo/9YI+YHFaZWo9edbBwR98z/zhJODlSHSknB8K1s5J4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjk8V7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptAxAAo1Qs9o9+clPziXZKLug5RxUPLZyLTlXD4OfUyeld3nuRuMwh\r\nWuYQAgglr49GXLAMp2X2KpTgElEOt+DwXoy2IAq79CrR86c+zDoP9EVBxVA/\r\n0pW3bWUtQo8w8puR2clebFvH7u7TsAJkBiJKCiYU5xQyT+9VQ7crnCAyajCW\r\nGqO1pNEsIKfnX0tj7l6HYt8+y5urWlFlgI0S4x95dv7pUWoY7Yg0TxHtLBGx\r\nbkBZ24UfCMGfYi8wrNdICGJfWeFncqLhs1d3Zbrgry0W3t85g+Jc0WUs16Ib\r\niiScDzsRf6B7czUaTerLSSy3NHx/68EsV2s+pGti2PyshvQselW7BUZ+Lvkp\r\nXNFsIYck6tzTDSydtW9xeebllLJShLB9RMiRILy5MrHINoTA2hD2ME3Wj8t9\r\n4KAWUa7eHCS/pj20ck5aVgIwLSHofjIy9eQVWPCRwV2GY709UnfdVBEaYtCQ\r\nmnO+8jlXF3f/wUKWLfnLZrsonDAOBUO4RuqrxjRM/pP4Sbv1kPv4QYvU4A0a\r\naDx/sdEY3LT5YMETEiD6VL//pJNdQJH6VA4xqzI8ZR0Xf8FDS3kWepqL75lb\r\nvgknFF0oNwO2bKHAVgXkHnmfSLGVod5aY4GgzcXIQ+DjbOiK7lCqPJGvdH/A\r\nwsf+9A+xRrCjCq8R4ezcpXtDB928+RuogDs=\r\n=GHuN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8ff7f9974a16b8178376e943748356193d364587","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ce8b5326f.0","@material/rtl":"15.0.0-canary.ce8b5326f.0","@material/base":"15.0.0-canary.ce8b5326f.0","@material/shape":"15.0.0-canary.ce8b5326f.0","@material/theme":"15.0.0-canary.ce8b5326f.0","@material/button":"15.0.0-canary.ce8b5326f.0","@material/tokens":"15.0.0-canary.ce8b5326f.0","@material/animation":"15.0.0-canary.ce8b5326f.0","@material/elevation":"15.0.0-canary.ce8b5326f.0","@material/typography":"15.0.0-canary.ce8b5326f.0","@material/feature-targeting":"15.0.0-canary.ce8b5326f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ce8b5326f.0_1670628730758_0.006553082713639302","host":"s3://npm-registry-packages"}},"15.0.0-canary.43f5323bc.0":{"name":"@material/tooltip","version":"15.0.0-canary.43f5323bc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.43f5323bc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"abddbfa3fc88183e6ec4036295a5ed262700a5d1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.43f5323bc.0.tgz","fileCount":36,"integrity":"sha512-kXq77hQ8LZygNGgN4Y2dg30CTsij16r24YjU6WRCEgwVHagKC4eKihpAcd39iqL2417aAe5OZPqoN0X8MQzroQ==","signatures":[{"sig":"MEQCIAanobMmz4sJlJ5Dd+VUxTxXQ70JKqIkxPF8l1bj1GB+AiAViIF/hPSwTSAEfsmhWNNhyf+V056+7nrGd2nQVOBOHw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1188680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl1tRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPCA/+Pcu3aoSYT/8s8ntjJ0xM1Cei9K/kO9Kbv0Mm7i2hYDGIqpuQ\r\nZ12xoPwKsusu2DEb3EJ9l6h5cPgk+lM23fqhN56FDGQvv8VbvI5Ola3lO/JM\r\nImwkZyYAfjjQN9SYs5NnPPZPVA/5yKFYMa85x5SjdTnZCNsR6j/tNqyC45E3\r\n2pJAbCkOFD9PD/nfh4lg1FOauj2VEafnDpITqfiS4jXY4PfuDD2BHTdQ3ssW\r\nk8evyMsplHOHGVY9uqxih5p80qDOShpPYbNChBUCKeZ9nK9OHZ5emU4RUa5a\r\nwsXzpr0tdPOsuNHbokd5nWtBCtnlXUc4NPhxbP3NGcESX8S4+b+033kDYfHp\r\n+KrggSpx7ATO26TrPwbLiBJRqIdBa3g0aOfI/LiIGp4pIHw0L0eddOO1Sbp/\r\nnRPcRQ1CzvYJt+L9ySqI2QGIy4mPgOQbmRKzL6Ejvk4ClwEkvktpKRxi1HeK\r\nzmx5DxhJJEExuVUTZn4UcaWBrPhkDV9fyJFhklc6nPP2z1/Ga5B1ggmFX0hY\r\n6zFg7VEWvKZAZSKFlUckZztZo5KXMwII71rLajakmDKxCIQSDadAV2C63s7H\r\np9skQN0+9zLw0yEIM9b/5OjHB7W0l+W7uri9WpAaA/QEpKLJ5FWjbzuPvUCK\r\ncNCveI6SfbGZ7LHCdJ3cn2Q6hi6jAHPAcr4=\r\n=5Ro1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"00be798d56184d5daa74ad6f53d4992db90688bc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.43f5323bc.0","@material/rtl":"15.0.0-canary.43f5323bc.0","@material/base":"15.0.0-canary.43f5323bc.0","@material/shape":"15.0.0-canary.43f5323bc.0","@material/theme":"15.0.0-canary.43f5323bc.0","@material/button":"15.0.0-canary.43f5323bc.0","@material/tokens":"15.0.0-canary.43f5323bc.0","@material/animation":"15.0.0-canary.43f5323bc.0","@material/elevation":"15.0.0-canary.43f5323bc.0","@material/typography":"15.0.0-canary.43f5323bc.0","@material/feature-targeting":"15.0.0-canary.43f5323bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.43f5323bc.0_1670863697547_0.4927519878254112","host":"s3://npm-registry-packages"}},"15.0.0-canary.5490e32e7.0":{"name":"@material/tooltip","version":"15.0.0-canary.5490e32e7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.5490e32e7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0b30187a554c3254beee7d69de0858ad75d8fa40","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.5490e32e7.0.tgz","fileCount":36,"integrity":"sha512-7ItfgdXpi+2m9p+VthVo78OzpOTVkwmSjYh2iH3fjyl05Mx5giyvvQRVlkP9YpZ7WpqqsHkQ/V2BZLvkfnlJ6A==","signatures":[{"sig":"MEYCIQDEss1TKoqop6wpHxEEudmSZh8U949hb/80StiiVL9e6AIhAMebbdtaM8DXbRccALtQOGDZkVhz01VZu1msyzun0kCC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1189286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl17sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq38hAAm7ZTOmaRb6VhXQEFQ2uUaSbw5in+UiUTEDVQB2kowdAXLaGF\r\nlukX57OZoPgOG0WOw193FIoaBpDG9NexeSSiKNZ6Zfu2VjlyGhp43gUHU2h1\r\nQWB0pVYJD0zitUSMoAx7r1grnbZ0EbDyv3LColVGoSv0lvcpleSAMFvnhj6o\r\nZ0Jts2EAKtvQqMg1pS/KcgBlI2PUsbujdToC/3JoE8b2ASQhbW8t2xfhYg7H\r\nStWbHYJulNBF+FbMxHb+8wmfn6jmV7a3ApTlAMu88syTjOTJC/ppkg4jpdlo\r\nvw0Y3Dq1ks2zfg9WR5qhhEvQg26Xe+2MKliBK3V9gOrKQVMEVDb19hbdDAAQ\r\n5PrmYXvSiCf8UTr0rpIFBhrJvV2J57JEgsOomsoYeHU6/HaNtnAMXiOnDh1r\r\ndDXa/PvGB7hUVhh9nEH3tiABIabJFGCZIv/2/NENsXA5c3YBXRsZWCwLoNky\r\nhwhw51+SgMxrypOxDEKlut41QNZT/kUCriE4w9AGsfmDbTzqzwkzvML8GHTF\r\nuXvdJb5WoBZHNlM/Myl62U0wGWNVIdqxOVpXlFJC+cmtsl4TdlPwt7HbfNFU\r\nIv6lbX7F4yinraeOJsn8UqgmLN4M7pZfYL+ovjlYFqsA5c2KTojAfj7qa/+J\r\nrSURRb6SRRdp7bO3zSJyeiKGYaiP85rvH+k=\r\n=XzeD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"968b84204c7a8626355569e2b90063abd574f7a8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.5490e32e7.0","@material/rtl":"15.0.0-canary.5490e32e7.0","@material/base":"15.0.0-canary.5490e32e7.0","@material/shape":"15.0.0-canary.5490e32e7.0","@material/theme":"15.0.0-canary.5490e32e7.0","@material/button":"15.0.0-canary.5490e32e7.0","@material/tokens":"15.0.0-canary.5490e32e7.0","@material/animation":"15.0.0-canary.5490e32e7.0","@material/elevation":"15.0.0-canary.5490e32e7.0","@material/typography":"15.0.0-canary.5490e32e7.0","@material/feature-targeting":"15.0.0-canary.5490e32e7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.5490e32e7.0_1670864620016_0.8804535742219157","host":"s3://npm-registry-packages"}},"15.0.0-canary.817002c29.0":{"name":"@material/tooltip","version":"15.0.0-canary.817002c29.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.817002c29.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"87091792bca68d356b366fa7c1824726ac5018b6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.817002c29.0.tgz","fileCount":36,"integrity":"sha512-STlJTqBOE/i5kVL1cylZnlYxcN+Ql83lmApnPkM4nl7oW5SJeKeBnWz3wFAxMb9iLhXj/6SNkQ6dL16yiQyDzA==","signatures":[{"sig":"MEUCIES6U2XMw0CuuZjJfdZjKIrnYgWiCr/Uhc7IuXt0FE6IAiEAvf46t8gOmkO4KZa3ODmV+2p3PfNl9AFYSpFOtYsdQEw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmPTUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqddA/9Gl1oW9WvkHLub7AQiYw1DxdS2e5DggPOKDrg64j/Hv+ILaAA\r\nHdGWUn+gYT4Px2pfrZZXVGCHnvtY3vHkxtz+8igefuvQPQjc1A2dzrRNgnsJ\r\nF5HOCj98mt663XXkydQP3r2W7aKaemKROoPsRZd6A/lWH9m6X0Rvsk9SFbRA\r\nZan14fgrZC/i5dC9gYKuZCMOQ1oaH5snPgSNTveml4viWJNoCDLyZDY4Gmad\r\nN7m+Ewlg7AybS49+k9rWCHi1OTBJAMiLVURRu2apLS3cA1wVTut02SsPSR5S\r\n5ZOruPQJY28huCoMB6jvuElPf1/8oBGAeHYr+fVxxHd3buEfOGISabzp4qPe\r\nvSXd5CbdNIMTGSzWtV2TmxiIlHA2CXOlWWXHrbyNWscXMUMD9cPD6H1Lmb4E\r\nt1Ab+VROslFf1ziD0lqpHfRrBTKpLVBs8OKnGjjIA6uf9beaoUbBiMxL7Vyf\r\n7AmFBG3hWPGjVGvbO3WOMI07+QUeepM5v7SvtA37xiIS4ByqS/vvO0u8nU8m\r\nndcCqAtgjkPTKkX0oCTEeYob4nBwUuUPgVdG6Qo8twl63NN0YhND92YED07V\r\nwFnadYTCj6DvJ0RyBqsfq9j6B7QtHVEkguQoadH+i1EbZeJDSRVDHPsd89dT\r\nauDZbR8O1p45kMvOhz/W8ri2gPHss0w34s8=\r\n=rJYZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8a85122d0f4bac7142c66fa54e2fe9a569e7c4a3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.817002c29.0","@material/rtl":"15.0.0-canary.817002c29.0","@material/base":"15.0.0-canary.817002c29.0","@material/shape":"15.0.0-canary.817002c29.0","@material/theme":"15.0.0-canary.817002c29.0","@material/button":"15.0.0-canary.817002c29.0","@material/tokens":"15.0.0-canary.817002c29.0","@material/animation":"15.0.0-canary.817002c29.0","@material/elevation":"15.0.0-canary.817002c29.0","@material/typography":"15.0.0-canary.817002c29.0","@material/feature-targeting":"15.0.0-canary.817002c29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.817002c29.0_1670968532277_0.9777727572966712","host":"s3://npm-registry-packages"}},"15.0.0-canary.313a1326a.0":{"name":"@material/tooltip","version":"15.0.0-canary.313a1326a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.313a1326a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"890dfa24c4a67fca6c8eeba947809f5071a0cc19","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.313a1326a.0.tgz","fileCount":36,"integrity":"sha512-nNvF9D2mh185CROZGifJpSdAJxqVJPkHkH+WJ6uUo9f7zDXgkV5bd1kP9oUQlJowJOyluB/uhuKChSMlLsFXzg==","signatures":[{"sig":"MEYCIQDQdro2E8HStbU1s9eAiEYgZIbxmcGf91ZDghftL57LbwIhAL5OE4/djzqceONTqt7ENmSj1tpmRkGpmYEKttwxeTkW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmaW9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUxw/5AP5Hq6rEvV/XMQdgpblqTYSe5gznQAfdOb1YHlofznucvRcZ\r\nPPcWe6SUkuJCI2H2zf3zrGpyrWpaYe8BPgzS7Y/6szuWY5NAwaVhhct54Dlu\r\nK/rtCA/aSh4BCi0AXxvj2219SJKq8qNkM7DNEF6rtFw5D5JWrHAq9lts49Wd\r\ny1YqNXOvEitTfU/b/UGwWSQlbIUqtuK/AL2xkhw8PjgPDQFy3eOTXtkYET0J\r\nEwqyXE1OXUS/FI0iPE/Dyqh4WX+9GHdnnjpQPD5jTrJXjXJ3vRPWY+y2DWgB\r\nmmgMWEnT6SXXk6+UEBCUKPMtftRBvrkLiYe/MboNRB56TFSmRIvPUlMGxc2P\r\nzr3+0iI5fLwpdOYoUerAjy0Wdc+p5hxd9+zuvDGmHymd8Q2FuCd2WZvKxw7z\r\nCwBMzYSP7RTTphDyP+7rBDiY8DEYHRAPqDBAdp5RxZSCwiw/Qefnuj4DGARr\r\nBZpONlVA7stZlaiftdeRia+C0B9HdgJo3ZhSAZJmoTKxgDCItQPo/79tB/vG\r\nf6WDUGksrQexJtUhPNvoZpBBXJMW0opSIz2g42DVb4unY0WDGmVl5vAzOdar\r\nzpP50nNqlE8X0frjQ19+dgrqySkFN9ZUjE0cX6rv8c5m43ZGIVe+WO8V1LOa\r\njGYdk4FdFfVyd0ZtvvYzv/gcsUL4hijyAws=\r\n=nN5E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"899522d523dc8a23968f530bb4de8698a5b0e78a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.313a1326a.0","@material/rtl":"15.0.0-canary.313a1326a.0","@material/base":"15.0.0-canary.313a1326a.0","@material/shape":"15.0.0-canary.313a1326a.0","@material/theme":"15.0.0-canary.313a1326a.0","@material/button":"15.0.0-canary.313a1326a.0","@material/tokens":"15.0.0-canary.313a1326a.0","@material/animation":"15.0.0-canary.313a1326a.0","@material/elevation":"15.0.0-canary.313a1326a.0","@material/typography":"15.0.0-canary.313a1326a.0","@material/feature-targeting":"15.0.0-canary.313a1326a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.313a1326a.0_1671013820800_0.5845459540774194","host":"s3://npm-registry-packages"}},"15.0.0-canary.a69c14e10.0":{"name":"@material/tooltip","version":"15.0.0-canary.a69c14e10.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a69c14e10.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e8ddd92adca10949b78ee31ddd373d6ec35d8b73","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a69c14e10.0.tgz","fileCount":36,"integrity":"sha512-2x9J2I7lWIMayc93b65eY1+K0Fv3lusQut6C7/yzzffYh+VrEtuXZqxnfYuEBF0tbP0ArrcSmk16ZknuSFqzpQ==","signatures":[{"sig":"MEYCIQC3zDwTMiJpDRFSnB/Y8u/kbo/0sup8S34znDOrtClPBwIhAOvZXqyXAjk9Z+2UlUW+2plPhUz704wCcdeg4jg49W06","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmbGYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/vRAAgO+WwsQ1I9dQfvo9+eVnxxKZ6Swj98RQ5vG4+4w8AxYTnIi9\r\n3Rv5k2oEBlnOAwvoeNzpIeFDpDQa+wFqKEnYxZ9KbY7NUnsN76M2+mMjI/wY\r\n3NohvTKJZhBsSMwSq+crTnkTjTCU6gbhJLDEhQ75MynhsmZ6E6D/2c1NFr7w\r\nmfqHH0gY+QVRtA72QJq4a0Q1CLWf/5NDrromvhrSaJ6VG2xXsHltTQ7orlue\r\nHpL9G5nfx2UPQl6mA1ZQz96zMdQFx2tDtB9HoiHOcxOsvbnyTluEvt40dXmA\r\nni6TWiVj/qV9c1iiLv4jttydkNaU/ScG3M+Fy05Y/V4A/6fC6DpNWh9en9BC\r\na1dI/4swHT3TiVRnN+MEvQv9cbpbJ3ny/+D+XT9SgsqfTUaxamhR2XNNIY9Z\r\nvxoEsbOV99SMvYv2eZZSflNc7LU8MxL9VP3cvHg5Y5dhIOw+F88Iq3Q/dqj7\r\nyjmcjMPYktbyzvuCl6SFGuU4VtXBOUxwWx19bg4pmn7pDLEwK6Zju12WPR86\r\nX1nUBP87DrFDa37qzoh6DMT4A6iFT+coJ1Q0Lc3Ol1hd2pBJQ9v78dZW49vy\r\nukcXRyu0sVslrbnhbq8zSiWHF+7jmh9dpNX57LRJFuCOPpSHpDj+t8zx5EGm\r\nyQwXSLj/rNxKbNjCOiPzRo4N2ifl6eUzWko=\r\n=ZwGl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"39b456415cb22d1c1b4de3d505f0e2412c1f5316","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a69c14e10.0","@material/rtl":"15.0.0-canary.a69c14e10.0","@material/base":"15.0.0-canary.a69c14e10.0","@material/shape":"15.0.0-canary.a69c14e10.0","@material/theme":"15.0.0-canary.a69c14e10.0","@material/button":"15.0.0-canary.a69c14e10.0","@material/tokens":"15.0.0-canary.a69c14e10.0","@material/animation":"15.0.0-canary.a69c14e10.0","@material/elevation":"15.0.0-canary.a69c14e10.0","@material/typography":"15.0.0-canary.a69c14e10.0","@material/feature-targeting":"15.0.0-canary.a69c14e10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a69c14e10.0_1671016856599_0.6859076894422083","host":"s3://npm-registry-packages"}},"15.0.0-canary.f43e0ceb5.0":{"name":"@material/tooltip","version":"15.0.0-canary.f43e0ceb5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f43e0ceb5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a67d1900d4b0c823562ba8e8b644539ab0878cba","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f43e0ceb5.0.tgz","fileCount":36,"integrity":"sha512-y/e5EeQ3pw2RdZfUeZAo+FUU+34zUs5HpIwJvax3A/+uv2zsQNEI12kpdk/fwbrhFPygoPJNH75U5z3XowAD9A==","signatures":[{"sig":"MEUCIBHn15LT8pedDze4wVRCGWXwA1f/flZlJvkIeZ6X73sPAiEA0BFMvBYNvd6VU48UcuCKkgm6JudiC3vpwTGnNG8SnBE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmf3XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqr2g//axmX7EH6qliA5/obwRweh9GQvbJ938ysxVg/6MPJhdieujtW\r\nIOBzmaejsyhqIm3oBjdpFcja86QJwJcRNVr+wyxl+mIp4eXAyoG2c2fB1gX+\r\nr0oWU9u96aaZIrvtiG9lsjpLmGHRPKK6GReYM9J5E/ROzREXDw4XE8MMGHVt\r\nvWHnnW4D3epPsolOnfsi78QpukPV5Xe9k/zp4GGUPmjoTEc+5Y0s7Q2dIPEE\r\nFumlzfbdteygPVigseidsvhJYXBXOwHQznFNeyCGlQ6AbU0K4f35te0EzIRt\r\nbTOV/kdcFkNpeZO4Lhw9vpzsf500tj+KBRXSOvQ3VseHh47ZvpNCaItvN8Kn\r\nAowlv1UfAdEOLfWU2W2Ro0KzZ2iFh91cgslIsQBKDbVxXQ7S+/y1PDMYf33F\r\njr2VNJzYDtOxXwlD9wff8qFDgqCwlRVRdQkSgSGqLJplfXX3lM6G5EloD2tb\r\nyqYw1xy8Z9nyicIWQdeaTactJiPSBvsuTz3byPKUaHT5PynwjfSwyFY1kYQH\r\ngic+SiVxahRXtir7jBlp8kIK01/ekaDg5K+ERe8wbnICtjNB/MyD1fPKnvyk\r\nULEU/Nkif/uEU9RytWiFMCuwR1/SzrrRJaWGlgBi0aXQuP1k7rqB5uUPWID/\r\npygmz7h5MaMz24UJ2h01KwI18JN4sYOv6vM=\r\n=3dKT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"35662ba23c37e102fa09f72d61e38e5ce3b10881","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.f43e0ceb5.0","@material/rtl":"15.0.0-canary.f43e0ceb5.0","@material/base":"15.0.0-canary.f43e0ceb5.0","@material/shape":"15.0.0-canary.f43e0ceb5.0","@material/theme":"15.0.0-canary.f43e0ceb5.0","@material/button":"15.0.0-canary.f43e0ceb5.0","@material/tokens":"15.0.0-canary.f43e0ceb5.0","@material/animation":"15.0.0-canary.f43e0ceb5.0","@material/elevation":"15.0.0-canary.f43e0ceb5.0","@material/typography":"15.0.0-canary.f43e0ceb5.0","@material/feature-targeting":"15.0.0-canary.f43e0ceb5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f43e0ceb5.0_1671036375170_0.24797863169863965","host":"s3://npm-registry-packages"}},"15.0.0-canary.34767110.0":{"name":"@material/tooltip","version":"15.0.0-canary.34767110.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.34767110.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d51f658e679dd2cbb94a626f64770bf6dbd72241","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.34767110.0.tgz","fileCount":36,"integrity":"sha512-NPYuoW7sufo/45Uzq1BVjgXgQJWpnYEyumZWO1oMBlYykpjrYsExJCDsz4M82e6OloX4H8vbSS6Gz9HXTU4IJw==","signatures":[{"sig":"MEQCIGQCXgCNUlJat7q4kJCROcaDan+4SeszXIfg5cFo/plIAiBnrP5ckDO0Sa4E+Wl0vfvXAfC4PUoLqt71gS/IYb2vUg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmgZvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZIA/+PUt10p1C3MZALuACzoVdsdfYU/sF6D1T2GFqFwgeJOgmoU3e\r\nDGwUfogcBHyRkU2bGfKWbvp5ncflVxFfRgOkBAolaQRLorNb597jxKps8DPT\r\nEzXAJVseFNMLyYzMBlVGs+1VBHd14hG9VAD0arvipoahWy6DfhzrBNayx1FG\r\nApi68kGJlewKvruTho+JcI0UKKRHU2K8OR/VoAFYT3Fp/Ip5LpBDqcEgJ3Ds\r\ny7u8CvxxXiTmuNy8doGl3zHbqJaFyTqcxJZAex80VwdjvsZVTGc0Ur4itk/d\r\nsX7OYYturuD3VMi/m7BG5yogx6Z50mFm1pdYBG643nNn0pGjGmkzQNTGA308\r\nJ2M9+tQvTxAgn9tIttUKJde5dPmqNMBvYivoDplgoR9JyPBZF5rnCyFUhz43\r\nLDEVr3Ax1d+1e9eFIfiYzSRXkZU6zdsHl+gGKPN4uL160ltYL98i9C8QslzV\r\nnokPvsYSm+2ePBKkzo55FaJcTe4lyL2ISS9v7yyCCq67o8D4EgiL2y2gv/p7\r\nfJuAU13d0G5PhGU4hQLmzka/Gn/V+tNDTo19djj0/oXGIsU+/ObuRQTBFtIs\r\n1JUNDHM12xN0aaXtiY4lGz/JXN9YLODTKLldfW86OuDlKPapkzCyZ1BhQntD\r\naBjHo0ia0dN8uLj7TeXoCUH1CkQ/CtYhNCE=\r\n=Y06q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ed8adbbccdff96503e43dbe6291e95b5d2bca2c8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.034767110.0","@material/rtl":"15.0.0-canary.034767110.0","@material/base":"15.0.0-canary.034767110.0","@material/shape":"15.0.0-canary.034767110.0","@material/theme":"15.0.0-canary.034767110.0","@material/button":"15.0.0-canary.034767110.0","@material/tokens":"15.0.0-canary.034767110.0","@material/animation":"15.0.0-canary.034767110.0","@material/elevation":"15.0.0-canary.034767110.0","@material/typography":"15.0.0-canary.034767110.0","@material/feature-targeting":"15.0.0-canary.034767110.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.34767110.0_1671038575211_0.09229311308414623","host":"s3://npm-registry-packages"}},"15.0.0-canary.1f99f3c50.0":{"name":"@material/tooltip","version":"15.0.0-canary.1f99f3c50.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1f99f3c50.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5aa5f2bd6b365440bf53b792a315f25db85743ce","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1f99f3c50.0.tgz","fileCount":36,"integrity":"sha512-a1D06fuwhkOJr7f6ViyXeaiJTU1dgn9hCyCD2a8WIT37MTUNA22Y4MTJD06n2AIFKLjlSFYXgYT+DREitPRvIw==","signatures":[{"sig":"MEUCIEd2Nrmewu6yXdiZnoZJtfVaQaf4sB9QUJ6/2AwazU/UAiEAhn+FEOffkFOaA2ji45gTUoZBMTKQOkTbifPR8M9j4hk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmy63ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAdA//a9tObMQFe3AyrKzXOKZPACv0p/e8pnEb2IaZQu06DBolQCqj\r\nPSxLdhI2yE2DUYqgKXu+S6SeMM2sDfGfYr5+0xQpiVgFHmoga+e9TIu+OVIx\r\nZBS6xHTefrxSLhzUTgqtfSZp0yGfVKYa5pOVAOMctNeq4JFr7svblkY3s/ne\r\n5GfUkFDxVgsHA6L0BPviScnui/6rlt+WN0EircDki/vPp5RR/1e5yhwyymqd\r\n+4ymHA4TaJ5IPtvL1H7nJVR09xMjKoryU9vT/vwMk5KY7EfwtRD8K1/rJGWy\r\nN7XzxahE1lYLjyMRgz1H5MX6kGXQA9asvji5CqhnFAf3Abj78QFQLZW6PhHR\r\naZe6ZCriUnjc8nxYTxtGIAF8nriuvJpmLtLpqseA/0RXH/W8OzKIrTKzwqUQ\r\nPV24CbgaZhURPGp2Sl5BnaRZPZmMef/+OX41JwdkfocwaORcdPXEK5hdRknG\r\n4fzE42XOYpFQ9fyuEmp4h+Rs2WF2/bWCZpbsUf/HrohnPLc/6bOSrif+nVK/\r\nrmv2P1zO3eOVFU+8CNt4fGvjF2UnSBTA4lQmL2XcqI6CIa9rwky0O7Kp4r16\r\nZk7PUIPOY2aMMpQ0fNOfORvV/DjLDNj00pNhCq1fGlvHTEbUs+9C/1L1BxWH\r\nKtndQwQdVnt7FIRgFv76gavlmAUiAC1NoOQ=\r\n=kK+w\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c9094e8faca1eaab158d26f7ca8ee4b42fb54bdb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1f99f3c50.0","@material/rtl":"15.0.0-canary.1f99f3c50.0","@material/base":"15.0.0-canary.1f99f3c50.0","@material/shape":"15.0.0-canary.1f99f3c50.0","@material/theme":"15.0.0-canary.1f99f3c50.0","@material/button":"15.0.0-canary.1f99f3c50.0","@material/tokens":"15.0.0-canary.1f99f3c50.0","@material/animation":"15.0.0-canary.1f99f3c50.0","@material/elevation":"15.0.0-canary.1f99f3c50.0","@material/typography":"15.0.0-canary.1f99f3c50.0","@material/feature-targeting":"15.0.0-canary.1f99f3c50.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1f99f3c50.0_1671114422994_0.17417879573408612","host":"s3://npm-registry-packages"}},"15.0.0-canary.cfd69490f.0":{"name":"@material/tooltip","version":"15.0.0-canary.cfd69490f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.cfd69490f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ddcb0086787ed5b924a8db65da76d58f968ebd39","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.cfd69490f.0.tgz","fileCount":36,"integrity":"sha512-6M/MBmBQBfCmp99s9Bamq+XQa4/CCMft1vfrZwYz0ExSJtO6EvtKawASmg5YWBTR5Qj817PMsg8HfhEmtB/sIg==","signatures":[{"sig":"MEYCIQCoK9GEbscUZEiEDu4dg/UtFFZ4ba3xEuNPWXZ/tJeiJAIhAITRZ4ANUqm3lGQim2/iEBvK3peJsuKqk9MSXZ2+VmB9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjnNCaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoI3BAAg9P4nS7Q7Ga82vukGW4VLWWBOfRpfkiNubAgrlqfPbMN/3Hp\r\nrEWJDISEdpeo6f8SRza4jhiQ0H2x86xVy3QeJsY7RT+wM1RhPd7LLkCgO93u\r\n6bHsYscfcRmonnDipv+4ypKNXy78Ja/IwisfV+8HlnvJ2Llev8L4nFduoQZi\r\nM1TDxvxCC8EVMj8ofATFdKYhEg3tVatWCXu/o2JhWz9DnV6dXpCJtM7VMICR\r\nef7lDQ1MDFxCF1XAGzAAxBtcNht49lqM1x9yLSHw9OlXJhbBSBVMR7WOj0dG\r\nhlV3ibJY1b7DD7pZyYj0rBpz1XIJ5Gt59tBLS1r5zbmBeddTg3zyQakit7hm\r\n/SgGNpY+10qFgDi8JtyFhMVO2sR2u6FwXJsrLxoHEmY6lZrGfCF4QAZIFEcZ\r\nGEKeKIbLmKR8QMD1p9hmLwESqwbazTZFMA5iXLrYQA4MwFCKy+xApyVq7TQg\r\nicVMgZRLVK7FdxiPHsodoF85Z5u5kOjHLAv+OObexqhnXXaWfUTxNcX8MHOV\r\nnNgbF1YXNHxMuAQmf29UMHGcZujpNJ25IGJOVIQvf+ZGsJzpcTTZ4RJ1nQnU\r\nKi9HxvdrbhZReyfiSVG/3H/8QesGazGspCrnsyy0X1I3mK+X4ahMtmi0FZNF\r\nLRLFZzwukPTTnIp0lNfbOj8cFXHjA9L5GO4=\r\n=0JWh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a7b9218e1ea7572b08b54629159e6f3a98970096","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.cfd69490f.0","@material/rtl":"15.0.0-canary.cfd69490f.0","@material/base":"15.0.0-canary.cfd69490f.0","@material/shape":"15.0.0-canary.cfd69490f.0","@material/theme":"15.0.0-canary.cfd69490f.0","@material/button":"15.0.0-canary.cfd69490f.0","@material/tokens":"15.0.0-canary.cfd69490f.0","@material/animation":"15.0.0-canary.cfd69490f.0","@material/elevation":"15.0.0-canary.cfd69490f.0","@material/typography":"15.0.0-canary.cfd69490f.0","@material/feature-targeting":"15.0.0-canary.cfd69490f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.cfd69490f.0_1671221402346_0.826482029968709","host":"s3://npm-registry-packages"}},"15.0.0-canary.94ad8d986.0":{"name":"@material/tooltip","version":"15.0.0-canary.94ad8d986.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.94ad8d986.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"92d268dc8bbcc82b7ebdd2be2e80cc5b970d84c1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.94ad8d986.0.tgz","fileCount":36,"integrity":"sha512-xjYtSt+GNk05At3ldwRpvg6tp1wiwiWCd588+WLp8AgnHmZALnJlLYaHyHULHzIJtcnAFupy8YbYdeg3ZQkdhQ==","signatures":[{"sig":"MEYCIQDObKmg9W1zVstcTEIGk02aXfwt0MvFy6OmdWpmhXITqQIhAMWctG/rBsUxFuDrwVXPioSq6a79LpJJDitN9O3ysJrA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoLtmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoB2Q/9EK7gcAp8Tqp2Ng9gVAK/fsg5tXKJh1D8BSNx1NKP6V/q7gnu\r\ndvK8E4mPxkDTemY+l/dUdNnaHa0rMIhUJRLvR3DYLzJYGRl+z61QWv0HK3Mw\r\nEGF21wQiYLjKWpZsqh3es9JoCdVKHtRToFoSr83oBSePcZ5CLub4D+YF+b4V\r\nHbecaOsykhtY6cHn7UCGXEWAFQMgu/sti7SuoRyXpIh7drdFHYXmzL5ou0CV\r\nH7sZljd8q2JnHdDPmIxNwA/LaGLk27z0kB/R0oz6c7AUAwzgxa2m+ECgTafy\r\nvFZ4RkXBuXWGksevDoLcr6LZqtzGSpCw0lKWrznB6vRqKRcpbMg/gkGwFPZz\r\nReyPCBm4gLFrWstjuy7WyGpuAU+ACTkBwMRXo/5peAaxW+wu6WnfYCUxhV3Y\r\nzKNN3HUtaDZCa8T3o6EeM09CcAObosG1ZEM39M5COzqCgeb/CAUD/pTFfeOK\r\nO7T8M2+cFwE45nTOZIFlRfNxxg7Hs4ri0MbXTeX60tKihG1Leyxj62Yq5gU6\r\nL+C4ALrHz/Za8TMJvo9ERsN4GN8lMVsyI2HgANFEhSfILeZ9yQWy3Xgrtp0f\r\nSWe/qksIMb43PSWpIPG6XBZq2QB7WIL2bE698iQl0TcNpHgEOmBpe/nM2cyf\r\nPqASHH/1umpI1Y080eA178SwkBpRsGjuVQQ=\r\n=YpcN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8e8a69afb313ffa8badca57ca15ad4a464b9f718","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.94ad8d986.0","@material/rtl":"15.0.0-canary.94ad8d986.0","@material/base":"15.0.0-canary.94ad8d986.0","@material/shape":"15.0.0-canary.94ad8d986.0","@material/theme":"15.0.0-canary.94ad8d986.0","@material/button":"15.0.0-canary.94ad8d986.0","@material/tokens":"15.0.0-canary.94ad8d986.0","@material/animation":"15.0.0-canary.94ad8d986.0","@material/elevation":"15.0.0-canary.94ad8d986.0","@material/typography":"15.0.0-canary.94ad8d986.0","@material/feature-targeting":"15.0.0-canary.94ad8d986.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.94ad8d986.0_1671478118190_0.9776786164210027","host":"s3://npm-registry-packages"}},"15.0.0-canary.604264203.0":{"name":"@material/tooltip","version":"15.0.0-canary.604264203.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.604264203.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8ae8081731f2ce82fe7ba72d55bf531111aac79d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.604264203.0.tgz","fileCount":36,"integrity":"sha512-dt3kW/+BV+L2qxfNwTzWcvyDRfEW77jxEuyAAjqGFG7+0yMnGKl4dSB/hmAsFQfJUxwwUFPJk/nCCKpVTNT1Qg==","signatures":[{"sig":"MEQCIBMimeHHSNda8e8D7S1um82Qqw69oyhDDR1sGFVYYCsbAiByi56Fh+1l3GuWEULBDAVVLfcWmyVzim/qSBkGeHRkKQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjo32xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrB0A//RUzpMHwu4akobxrwJS1xkrpdNIo4IDU7oEU/9W008tb7sT+P\r\n6E+L1CCb4gYhJz6koO45c5yP+3fs4mpmYHY5itbgK5yc3IKj0Vo7DoBwM6YK\r\n3fy912m849m1BEKHpAbcC/CKO1ZyPJ52xlkGYoLFhtEpOU67hopyVV3VXigv\r\nGBDWQhVnWU6BhEhPg0KW7e6cU3kM27I6spFCLiMRkU3qe1h/8GMZAFTySRjm\r\nLUu9xzhHm9AhPXl5ozVVhV/mzDcdWbfKaVUCjrBbCLVfaeP41DNw41/99G08\r\n5dzhlt+1ZDKg6HjpIatn2LdhePV1Kk5qA9sbLoKYba8AJHDg3FKHPD4PIu5J\r\nh5k/pvuyIsqtDsp6vGE2l5jX3RjqkzbCSOwffb4Hh0bscrt6MCkHyqdz1s2P\r\n8uBY6pjd1F2E737SOsJtsgpg75xZZ2xvDaPe3NGaqssA+UFUnaDT1VIoD/wp\r\nNF0tdGIsnDlUialSQ7Ie0NzQ81WWBc0is4etjy180rNT4lcQowo4+55xd5kf\r\nplgdtA5u4nXV6/wBO9s3J/bpv61VspPjJtL1cPlvQasExEBPM8ucfcmgMcyJ\r\n8KtbIR+DlA/gEYfJdMkzvGOCkSUQ7Y9rQMj1x8I+J0Nm3pjPlz82kt7+QS73\r\n31QT5SK3Cf3RUr+ljTSyqfIBPp3opf8i9C0=\r\n=8FSa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e37bb80002397246ad3ebd1bf11a465b2eb763e8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.604264203.0","@material/rtl":"15.0.0-canary.604264203.0","@material/base":"15.0.0-canary.604264203.0","@material/shape":"15.0.0-canary.604264203.0","@material/theme":"15.0.0-canary.604264203.0","@material/button":"15.0.0-canary.604264203.0","@material/tokens":"15.0.0-canary.604264203.0","@material/animation":"15.0.0-canary.604264203.0","@material/elevation":"15.0.0-canary.604264203.0","@material/typography":"15.0.0-canary.604264203.0","@material/feature-targeting":"15.0.0-canary.604264203.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.604264203.0_1671658929463_0.66612851690473","host":"s3://npm-registry-packages"}},"15.0.0-canary.85bcff6af.0":{"name":"@material/tooltip","version":"15.0.0-canary.85bcff6af.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.85bcff6af.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a121aba36f73d94ef6387f8017c04547ac40e69d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.85bcff6af.0.tgz","fileCount":36,"integrity":"sha512-KBJzezWUiBXHEyh+wcE5TIcVX5vjx2Ff4zTiPg9k8lqHB+4GgCK/9yzqJCRzYTTjJQ6BBHRybdgdR8KVM2NBDg==","signatures":[{"sig":"MEUCIHGWTtI/ExFy3gbmmYFLer0dTSfRsCHqVJsIGUeKY/lWAiEAzyZVO0PQ1kBuekyXiirs10cU7+UPnaUFoT4HmPDo1P8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpDD8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmooQQ//SyqLyQd367cGS8OtFMEuP4glOpe8tByCAT++e4iEyENAxeJX\r\nzCiD69GH/amDAMfQeijF+nwAWU4+S6ORQ5m8vRneQlk7Q1GIClmdPPW/Uzmm\r\ngjueMrkwGSmasgNCu7eb/lQBU1v0ofKJhB7dq4Gyo3rlRrxrmSQaE0FuV7IB\r\nokbYsHbGI43+Vse2SzJpDcZ1Ku8Z+iUsxHMy+FG3AY2KQ6bd8VBpmgsrat4T\r\nrjKu2ewGQ73k8eLxqcMGcWRYa5W+kkXfHuMrsXn7NTtsnC5qVeP5DkGfst7s\r\nKzeDVo7nQfzTEiez+nCK5qE9Evv6VXhkuSOUeW5lBfSgnLmhO1Py9JiFhThf\r\nsBAOahO6OGVGxa0QaAWIER8giX6fDfy9V63sSpk+a71a56JIZEFStvFIaZ2c\r\nvVCPtv+py/PeRTVwBOgC1bsl9NmQjCnbgauDZjdEDg9t4wKk6AMI5g6AtG30\r\nv+puS6imGR853HzM6urtGpWBn+paoEX2q7Yta2atcF58Q/L4YLAkD7ClvGeP\r\nrve2DbIQ5auhVRXXZd4DzL5BqgTu2k7ahWVUnUi7OFoPKKMJmJCWeZHy97PU\r\nFPfzQn05wAtohIKOQMc62Lf8Y9Rt7PNbNgomNZX+uob4ohcInKfjosm7fVWE\r\nXPf4s+2YO6rFY4vNTuaqaVySa2BI0cPn70k=\r\n=7ViF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ccd1f76fc7f93266cd894275969c05a833a002b0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.85bcff6af.0","@material/rtl":"15.0.0-canary.85bcff6af.0","@material/base":"15.0.0-canary.85bcff6af.0","@material/shape":"15.0.0-canary.85bcff6af.0","@material/theme":"15.0.0-canary.85bcff6af.0","@material/button":"15.0.0-canary.85bcff6af.0","@material/tokens":"15.0.0-canary.85bcff6af.0","@material/animation":"15.0.0-canary.85bcff6af.0","@material/elevation":"15.0.0-canary.85bcff6af.0","@material/typography":"15.0.0-canary.85bcff6af.0","@material/feature-targeting":"15.0.0-canary.85bcff6af.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.85bcff6af.0_1671704828636_0.23248186424816208","host":"s3://npm-registry-packages"}},"15.0.0-canary.ece3e8d21.0":{"name":"@material/tooltip","version":"15.0.0-canary.ece3e8d21.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ece3e8d21.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"acd0adb427091235276b2ed601da3d7aeff23257","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ece3e8d21.0.tgz","fileCount":36,"integrity":"sha512-c7D9/anwWwbKEe8il4lnL/KPc85+nueMJNpFuFdW2BSbsZYW25GGWOdZy6jJ/pMmyKFuezpPtYA/uQRIN090qQ==","signatures":[{"sig":"MEUCIQDKFZ4bT5wbrhfUxZp5dTX6XWZNX1TiqLIwBnb+b1Uc6gIgYOLxhhayw1kzpZJjOWcyAFU8GoiOAYqa7FY9x9D22gA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpJBCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp95w/+JuyjFp9Axi0X9aTT0+iTnyzo8hQx0peeuGTFveP+0O2J3Trm\r\nuEQTwPbdifA3hWvJRTHdO5Z42W4FvdsFOaQLeB5PDBl6L25M6YfDzlDCban6\r\n/gRyaltUOosKvWv8TZ4ML2GK8mXC2teGb3KPiyTGWWu1GltRxvSUBfX1oycw\r\nyvM+zm5AMUpKeEOxl4X3JwAw31U874kefyPQlpSiKzh7OGDFAi3N97HHlPNf\r\nxAUwCaiZ3cWE2jjf0+vnSJLcqBmZnP6WB96tRJWq+vODDQiBxU9jYc6KMn4Z\r\nfdtobh92v8DQXRB1wvKGyCPSnpJvfKZfgcScLgNk8WvZ7XOJabjzasmxKNZE\r\niLAcdwO074CwVXAFuwx8LxsZNKxbpR3Q2ukT0O95gf7ZWGUlotabNSjOdJGW\r\nrBUewNwVhJslmh4yiEsJK/9T636wV+pzqMUfWjYiaslgqD9qxf3ezKY9Jarl\r\nCtGhOZEZLfLoV0MStBbwNeOBJ7rIrMtgfIqZGIuF0vOl7LCmBetG+dirYJ0T\r\nVGmJhqCW+jyukIyaN1zV2Nw9PzcKSbfDH007zfSxtULSFptEFm9kD22s9ipf\r\nojUg2G53Y2MNISKKOmVJsl0S27/LSyNSfqUmS7hgBe+547U0pCQNPzGv3Iqn\r\nHsBg3lwXwKGfU4Z23CQm/vABYW3geJSnesI=\r\n=UZdc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1a4efd7042befb584384fcbb35f1ca445adaf1d4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ece3e8d21.0","@material/rtl":"15.0.0-canary.ece3e8d21.0","@material/base":"15.0.0-canary.ece3e8d21.0","@material/shape":"15.0.0-canary.ece3e8d21.0","@material/theme":"15.0.0-canary.ece3e8d21.0","@material/button":"15.0.0-canary.ece3e8d21.0","@material/tokens":"15.0.0-canary.ece3e8d21.0","@material/animation":"15.0.0-canary.ece3e8d21.0","@material/elevation":"15.0.0-canary.ece3e8d21.0","@material/typography":"15.0.0-canary.ece3e8d21.0","@material/feature-targeting":"15.0.0-canary.ece3e8d21.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ece3e8d21.0_1671729217969_0.2355227783453797","host":"s3://npm-registry-packages"}},"15.0.0-canary.278ad53d1.0":{"name":"@material/tooltip","version":"15.0.0-canary.278ad53d1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.278ad53d1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a8250e95262cff45f84cbdb0686823605b7f9674","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.278ad53d1.0.tgz","fileCount":36,"integrity":"sha512-1eWFHLOJHp2kngd2aJEkguk5puE+rA5C44CTK5XkoOlH/sM8yjim+2G2FGJE20lpXhRcFVwme+DpTdenkP8akw==","signatures":[{"sig":"MEUCIQD1u93R5H7AD0MNvXXWVCXhwAvzO7tkJ/MMYxoZnajH/gIgH2I5W+NlJFUkXhovFIYQuNvYZ0oqCLklUBovPyoWaaI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjqyYdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpkng//buureJXadw95ax0h7WMcGzdIWXVu+UJTmEcHXnltj/JmjCOE\r\ngfYuAoQxe4Ng3jA8RxR5YnorRe8UBGZ31Mdki9qkAyV3ruSbzJNAnooATnR4\r\nZqixxgcautGFSRmdDT/EXgFfWXSjtSiT4zXf/oUP5Y9KHw0aPV6Ih84WBOS/\r\n+vUeEsm3OL9pRqKKKBjilsULe+aNjun6lt8hCFCHs4WgbR3JNrJgYIb609bb\r\nnKf3ozieStbD0OsXFqw2ZR2+XZwfrH5auP7OIBP8OfKbaJN3xLLOn+sGgiQs\r\nK7wrUaRmKMOCYrVHelyPxL2GhP55D6e2797d4B+R9y97BZYNwIluVo5abpIt\r\nKxPvpymcIgkBwvHRkv8Dkc9izypnsSp/mvpAgZd1vb1jKMexnupr9wElrVCN\r\n6Tr1Qwt2/bOdgRKNjV2Khuas1Nmv73qO7LiI6vQmCQdraXhx7UeR+dyZw164\r\ndkk1b+AEki3/jXXPteUA8gk4IxKGL+S599AS5Q7pVh/mgpp02RKNcaRPHEOs\r\nbsUFF1PplyAUIjSHXSUy0p10ujnJAHIz2QlVottTRPv7+1dGtj7IL1Fbhnw2\r\n/PXjETtH8bGSrmbFq/T24FbaZxbuU3rUzgsfH0rrS5O9bgctzzUtjYyKQq0u\r\n49cIa3PCdMOBVSHun1HOo/Lw6r0ipwKyx3o=\r\n=oboE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"967cf83d2b9fa8a3e6bd992aa107c66182e0c65b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.278ad53d1.0","@material/rtl":"15.0.0-canary.278ad53d1.0","@material/base":"15.0.0-canary.278ad53d1.0","@material/shape":"15.0.0-canary.278ad53d1.0","@material/theme":"15.0.0-canary.278ad53d1.0","@material/button":"15.0.0-canary.278ad53d1.0","@material/tokens":"15.0.0-canary.278ad53d1.0","@material/animation":"15.0.0-canary.278ad53d1.0","@material/elevation":"15.0.0-canary.278ad53d1.0","@material/typography":"15.0.0-canary.278ad53d1.0","@material/feature-targeting":"15.0.0-canary.278ad53d1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.278ad53d1.0_1672160796825_0.6383923808171996","host":"s3://npm-registry-packages"}},"15.0.0-canary.a7d8389e1.0":{"name":"@material/tooltip","version":"15.0.0-canary.a7d8389e1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a7d8389e1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e10e93e5f86ed6dcc09e841d28425613199a35a6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a7d8389e1.0.tgz","fileCount":36,"integrity":"sha512-Qy9tC0MersJR9fSzrNt9zr0ZKgRgs7FQr+TI6VB/Mp+b+NpOSJAl53075nX84tQv8KyyqW+pcIgcsmCZROmEKw==","signatures":[{"sig":"MEYCIQDg0HGWgcm3qINAbU5uaws/Dfnv1Y7vqiYgWHUk2aTftAIhAN5oIqa8y/NedLBZwd/yT4HUOYZiStoVc+8w50Q4Miuj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjq0HyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlDA/9FyThX++NqSGgBZdCcTTkdadplxBjQu2q81rr6MSv7SbCugDv\r\n089dFe1ceERwT5eJ7GwhU/KIMukTAlLpVwzijzerOSRPCSikG8FxT3CYojwE\r\nc8SfL0Az3cshWnJBmY6LLdkJJhZVnRhIbEp/Xx4LuejWsXs1MeR5vDYomumM\r\nSbk7SSIOsALcTXFMQG1GEKrZA8ggoK9oSI/cj5vWSR3FP+/b6klzitSHK/iH\r\nxEFb8AY0zRy+CBxeLRxyZaWNAKUXbW3tLBx9zie5b8lYjkM4xbbFR39ol2uk\r\ny67tnVuicjuYyQ5ARMJkgtlHtnu7ivbUT+2CAnEJU751bVblph1v0APiu4Kw\r\nWUPZu/zn+uNtJdYRKl8KDd0toRgGGzziulQJOz7o0KN7Z62GtMji2uodj5xU\r\ntr170o3rK4RU1OlvavV4XnnVMbFnnpk3oG2QOPRcg+QuV7pJEOjUNQiyfn/s\r\nBcfbsBBTuAAszuMSHErOFpMrucfVqI6WA0xPf0URirxElqPkaXwlb+ByP3Ea\r\n0RflEFb25MvcVQvAtwzrThxJjuhf/GpPIfnl9konizWkRKsL2CdHIck9yBZb\r\nvmLstFN4V2FD6ewTvbyh1Y9CvQFDmCFlimGZBkeBwETkHVLPNzIm2V4vANgb\r\nf2lazk5BK2oa59sgZXRL0Fa3depD4nhOg2M=\r\n=d5rg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f9b27084bc44ecd4530cd2252389b0dd8116709e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a7d8389e1.0","@material/rtl":"15.0.0-canary.a7d8389e1.0","@material/base":"15.0.0-canary.a7d8389e1.0","@material/shape":"15.0.0-canary.a7d8389e1.0","@material/theme":"15.0.0-canary.a7d8389e1.0","@material/button":"15.0.0-canary.a7d8389e1.0","@material/tokens":"15.0.0-canary.a7d8389e1.0","@material/animation":"15.0.0-canary.a7d8389e1.0","@material/elevation":"15.0.0-canary.a7d8389e1.0","@material/typography":"15.0.0-canary.a7d8389e1.0","@material/feature-targeting":"15.0.0-canary.a7d8389e1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a7d8389e1.0_1672167922234_0.6031148491065006","host":"s3://npm-registry-packages"}},"15.0.0-canary.8175d5eff.0":{"name":"@material/tooltip","version":"15.0.0-canary.8175d5eff.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.8175d5eff.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5333c73ea47e30b91fbd5c87efe258d7f1fea38e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.8175d5eff.0.tgz","fileCount":36,"integrity":"sha512-5GY8ArsbCVauLVXrA9xEyHkvlpf+cuWi1C5YD6XxEgZi72TPJ+IBO/AiqFLxMRS0U4gYKBmtJp1owFYqxlBeKQ==","signatures":[{"sig":"MEYCIQCpkE7jolJHWN38yL6mvynWCAV/TuaGncblcoHQN6kTSgIhAKsAPJtADb7BaapEdD58qCXkii6sZlOCr4HpBocRU54s","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjq6F/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0AA//WgL4fMtHw5EEZP6+irku0hBIBzBCETmvxr1beRgVtk4Eb74k\r\nMDNu6aU8R7JFMwOjlBuFCbk+PYDcr91FPFDxOfKWa+YfPMqJ9FmIgZBkifnE\r\n4zrHFY+lORtU4JmkM2HQdklZY8zY2b8LzQrj9pO0QHYhif7HY+bOmHnuUJsI\r\naWM4W/rQJTTFPtYbF1DShZKlpTb2m9q3qR1yK8K8+yjWeh2CiVv+ArC1Yo2P\r\nkNLUpXN3BCw3sqoxrdpR9ztqfXQyNXdwEVNUeCoRWd+IcVA+QNegR2yYGPQB\r\nCQGniEDxnG4OhCuU+zJkOiV3mtO58644ksVrTAcF++HpePvz7LQDgUpdZ+cs\r\ny+1fvnCHbsed3SeyRjArsbGTJuxXKWbn7r7pzOjK8KpFDvPNtryATBgDP7NM\r\nr4+X8ju5DVGpGz5r84QX4L+HslDaUyYfS2Md0bixOIlocYRFcO7DFV5Ahk34\r\nDbkZsiJqn+vU0mQVUiU0WSTCDT7TtOJ1ud8aLU+pBTuKD1ob5mmHkOcS+uGn\r\nie0QQ3F3FbAVtDMv1EPDaMrInDtqd83CbYP6qHd4ve9F21++FVH8uark/h3L\r\nwsaunqohvHdwGgBBacPFKS+icL8StK4DqehXs8qb8Sb05vh7Js3JDpfGsKOg\r\n5OiQEtUiHsCb3MlkTA8eKdZkjEof0ajl9w0=\r\n=6Khf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c3bb551a6b32480853dcc8e29f7f8513d62154a2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.8175d5eff.0","@material/rtl":"15.0.0-canary.8175d5eff.0","@material/base":"15.0.0-canary.8175d5eff.0","@material/shape":"15.0.0-canary.8175d5eff.0","@material/theme":"15.0.0-canary.8175d5eff.0","@material/button":"15.0.0-canary.8175d5eff.0","@material/tokens":"15.0.0-canary.8175d5eff.0","@material/animation":"15.0.0-canary.8175d5eff.0","@material/elevation":"15.0.0-canary.8175d5eff.0","@material/typography":"15.0.0-canary.8175d5eff.0","@material/feature-targeting":"15.0.0-canary.8175d5eff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.8175d5eff.0_1672192383001_0.4082918118332024","host":"s3://npm-registry-packages"}},"15.0.0-canary.e21dcb86d.0":{"name":"@material/tooltip","version":"15.0.0-canary.e21dcb86d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e21dcb86d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"93cb6b0f67c70d8011910c088b7c5fb31c9d05dd","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e21dcb86d.0.tgz","fileCount":36,"integrity":"sha512-v3JTkZxAz7sUFRQyUOUagTOtxm1hv1fc//W6bQnhYcwYjpthe2zv8AG/EhtFICy+O4g+ScK1Sc+yZWs2k26Dog==","signatures":[{"sig":"MEUCIQCKkC+PAQovepLTeyq0d26qJkuGofARlSLOUGmeCVgwpgIgHXc/TRsXcyW5jHoFZGI91FAwPEdQ0svxR4Hf/p7NQBc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjrZ5AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmon+A/+KyonTofY+LKXNIMwdIEVGGNX8eBZUKwhLfUeDlUd3XquwWUl\r\nDlwaP26vPf8skzwr1YfWHUP+J2OY/Yl+DT2arejykMvW0OCSnjjxcD+ZJt6F\r\nHG7mbzn3huMuRbl5ID25LvY9qxeKOb0aRstTm5kBWM983U//k8fsBKXXAo+i\r\nmpxfBKG4q2NYYJw4jAOHq/Pu9Xa6Jg2BSm1DY2RYdpnxIlhXcfrB5UST7u7w\r\n9Bvg/z5WAcSpRun1MrfLobi0Ao0RBn3fXfT8nywgBIDD96J/6s8cpPDj5fsd\r\nTAwiikPWp+5XGOmxsPPwb1ZCgR2p42ceKBsMrfBt/RhGKcBWOnf1ofGBHtXm\r\nZEJJFZOdv9TsZtr1rNd3uGhixEEKCaY4IO3Qs5tCvL6ovZPOjh9OEt5V8suP\r\n4beWzffZLO70yJMKQzFIUyW8k48m0fG7TrJC5O8/owVY1o75Z3dY6J3o44+i\r\nfA2g+wbNLTf3ZThJ6owHoB08ePulP5KIbhp62hrabWxQNa/La5fHN+MDIdRv\r\nFX3PdMEQ+6Q1PFL6dT88S6FnKbW2tHcBEuMDEu8JGy5sckQ2PSOxiSLAljQS\r\nrU/iZzZsjNxIJZM7nM8gs1TiKUgAqclP5NDzwk1bn6ryLV+S/0oUDwHFreCo\r\n7h0KTAV/nUhg6cw4jHtBxnZwuX+q23bPmAs=\r\n=kE8Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a32b4ac6d2bad60870533296fbc4acf050735b8f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.e21dcb86d.0","@material/rtl":"15.0.0-canary.e21dcb86d.0","@material/base":"15.0.0-canary.e21dcb86d.0","@material/shape":"15.0.0-canary.e21dcb86d.0","@material/theme":"15.0.0-canary.e21dcb86d.0","@material/button":"15.0.0-canary.e21dcb86d.0","@material/tokens":"15.0.0-canary.e21dcb86d.0","@material/animation":"15.0.0-canary.e21dcb86d.0","@material/elevation":"15.0.0-canary.e21dcb86d.0","@material/typography":"15.0.0-canary.e21dcb86d.0","@material/feature-targeting":"15.0.0-canary.e21dcb86d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e21dcb86d.0_1672322623940_0.6765420698868951","host":"s3://npm-registry-packages"}},"15.0.0-canary.20ab6f5a8.0":{"name":"@material/tooltip","version":"15.0.0-canary.20ab6f5a8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.20ab6f5a8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"23d583ecabaa6718ba1ec98918a8a953e01dcb6b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.20ab6f5a8.0.tgz","fileCount":36,"integrity":"sha512-pAfF5NGg6lpIH3rUBQeOOKMn52T/zo6bKtzQqGdBTb6VyTiwripqlbV1SYGMA86TUjBlfDJYjhFqNDjmI25GlQ==","signatures":[{"sig":"MEUCIB4nw4n5VvwdmD6gSMtROHt62FpsnWBeRDxA5fBLwAfPAiEApWM7kdSBpmKo6fss8vP4BwrODAApVH/o7fXtlUXJwvU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1192916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjre2gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqqzxAAolOI3thT4UE+AJHYde3XGAGOlcUimk8asYZPPvQUu93M56jn\r\nmsod7c3ZUNJQebq2+KqOKcX4rHSWaEc9NpFCYYlG5omEwsNHpmtrgpEbXVht\r\n/DCpq9iPTKUCfIrAFI8go8c1+TcoDaLaUl8mJ4AD2Zrip91Xz2I4S0RAeTFU\r\nnSESeFbH0qNn3CRlOV5maOcFebajPSsyZK/X/fFV+zo1cBrokce9rRqrFHgN\r\ncDWudIDfK2ZnVyeTlXpU4OS6NIxJYVIRUvQD59CCzlSycMLHeY4H0Iuudkgm\r\nCycLTnbAikhG6mqeuyJXI9IHHXoTN0ZfWiBdw1/gFUCYFsKOmpEmTsfOzVxi\r\nCkaFlP18+0rxbp+4DaQpcPcP5vD52qcgCRTI0STTFe335Huzpvsck+pRJIe5\r\ne+IYi1QsWRZcHxFnQ1NxKTlrOIdzeKFnhGjWU6J0XckPWNyxM++ApjIpXbzM\r\nomubgHhLF7rSCMn9DN1cjEo6uB/OjsYR+PpyrvxlV2LeBqfdUx0K1x2nU3PA\r\nt0u2ab+7sUsoWAR2SeGdI3yCCNbZotv3DHl4WZ+Nm344ShyMqPw3+KuOyHgh\r\nsATLdSO3VzkozgwdMTrIJs6o+61qvTuk3/32DU2WWEzVKi4PWQX5zA9u8E/q\r\nw6w4tbU2RDktJQWo+0aQC9Gx0JxKsZMOGkQ=\r\n=jTtI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"abf2135af6e71ea44b6e6a4de17493e5923f7255","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.20ab6f5a8.0","@material/rtl":"15.0.0-canary.20ab6f5a8.0","@material/base":"15.0.0-canary.20ab6f5a8.0","@material/shape":"15.0.0-canary.20ab6f5a8.0","@material/theme":"15.0.0-canary.20ab6f5a8.0","@material/button":"15.0.0-canary.20ab6f5a8.0","@material/tokens":"15.0.0-canary.20ab6f5a8.0","@material/animation":"15.0.0-canary.20ab6f5a8.0","@material/elevation":"15.0.0-canary.20ab6f5a8.0","@material/typography":"15.0.0-canary.20ab6f5a8.0","@material/feature-targeting":"15.0.0-canary.20ab6f5a8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.20ab6f5a8.0_1672342943799_0.8897245735156731","host":"s3://npm-registry-packages"}},"15.0.0-canary.b9806f623.0":{"name":"@material/tooltip","version":"15.0.0-canary.b9806f623.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b9806f623.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d6491acd427dc8bd0e0dcbfc32e8ce157eb378c5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b9806f623.0.tgz","fileCount":36,"integrity":"sha512-j2Ap402rY5k6Dla487cOo10XRP+q+tdYQMsDdWUE5WOintBlC1Slo1ujPSWqr4soWf8sEZSWQCo9yqTPTNXiFA==","signatures":[{"sig":"MEUCIHzxG8QqqkKzH2rZsC//V1GLWWbbMhlbJ6f3lK79Hs+6AiEA/WCrzRCp7MgTC1sgItQoJPbJ7giTuGRm4POAI40lL/w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1193783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjrh2pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5jRAAnnSHywYaXdU1GyfnHKbuKDE9oFybxQYPhHfHGF+pZycx66PW\r\nGBOwdmIrRXLCdoZfqI6w7xO51ZPooV0+fkxtnQGWjxowJ55AG80zP/cvAGn6\r\nUNw2ChTm4aPBPVozYiNihJLQo7PZkQ93uIDK3sf8gLIjstvNDynutNdprlaS\r\nL/GzHzGIeMZMhKqpAjfajnhPGf211DZokx8SUmzQm2rzc7ZdL8/eCLdw0PjI\r\nQ1J/cGv+S/1oYiDW58Rq5jPY1wk5ez7tyEGgSpi6xzoxA448sP66iWckYxMI\r\nDXt6dLJg16oAW3ixwERmtWXIgbshRlv08l0d2MmkOIaatEoZ3z5XRoDi5G/c\r\nXK7QBQAz1nKmFeYauxiZDwoIQQ/5j3EXDv+nEYTqktSKQvUfqTx9uAtbEVsi\r\n9H5CNV66Tsf2FEtNpvU7UfGlkDQM0XHdXkOMvNU31vvmmDe2/T/ZrzyRbKY5\r\nm51hWBemljMFrXRq2/pp8/mvYnpeoHWg687S+tARlhCJg8puJ6GN65K14Owt\r\n3cwPVOHSdz913CAI9QqfR7bZPFiKjYJHuPLuXY9ICQ7UKyVK/BB526RGEatn\r\nICHBopAXtJlfX5ZOSpD/8gsLGswoVBp5MBGBbGefxs50SG0RYl/qqATnJco8\r\n87ovI4zOaQfJWIrCSoB8MLmnqtK0XZ4oBcc=\r\n=XuT6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0eb4b8fcbfba4d68dffe3a2b5c7478e69e2e2eb9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b9806f623.0","@material/rtl":"15.0.0-canary.b9806f623.0","@material/base":"15.0.0-canary.b9806f623.0","@material/shape":"15.0.0-canary.b9806f623.0","@material/theme":"15.0.0-canary.b9806f623.0","@material/button":"15.0.0-canary.b9806f623.0","@material/tokens":"15.0.0-canary.b9806f623.0","@material/animation":"15.0.0-canary.b9806f623.0","@material/elevation":"15.0.0-canary.b9806f623.0","@material/typography":"15.0.0-canary.b9806f623.0","@material/feature-targeting":"15.0.0-canary.b9806f623.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b9806f623.0_1672355241494_0.3481870015286497","host":"s3://npm-registry-packages"}},"15.0.0-canary.50c9f550e.0":{"name":"@material/tooltip","version":"15.0.0-canary.50c9f550e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.50c9f550e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"db3361b302876a2aaca6af2a783786ec4ff3da5b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.50c9f550e.0.tgz","fileCount":36,"integrity":"sha512-8rNH+Bxsfg3Tr5qzq2lyK72ZD2ZUtGVdZOpfZTjli15nV/gJjWAhmlG+VFCQHTvAEgAd2qjFRm/i88AFd6O8jQ==","signatures":[{"sig":"MEQCIEhleu/i/+3a3UQBLGb8QQy79kBktWlnfiCrlWpqHJdpAiAEw4/U7xofjVJzxPcbfGgPMjohYJ2EfTLQECTlDcXOYg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1193783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtE5xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDFQ/+KrWJkbZFs+n3E8nCs7bX8zqg9zJQ7N4gFN7l9+dCoYnsf4q8\r\nRsPcvqgO+IYxjeS9n/ZREJ7C2XVvXTuzVIH6ZTuteFuLwj06TASeKMZKAVb1\r\nXMQYxIAK304SoIPtNEX6LCrrPzR2i2KVz/BEJbAG0+r7Hs3YRuifKHN9XUi6\r\nauNGD5rcP8bSShfen0Vh8ePtd1sLI9lKEMeGQiDZihyXbADbF/RVw8XdeboB\r\ncc4AIHF/DKuyy190kH+UsGQRCz+2NbrXC32QGYEo3VisqWRXjb6j7tVHFRpS\r\n8zIz3n83omx9cxHqokFnbIjUpt/FUkme4EhQpFavjShvkbGr2VyaiUoOQ8Ct\r\nGDB8EG+RpnHL7FQFThvkQ685qyqzclD5VFsELrAEzLtldoEHPOw9+6sxqnsQ\r\n7kssQ5JxRHNbxE/BrKNbTxa3Uqu60HKdb2Kn1QBPI0fCq+lTqjPXvl/hE6qA\r\nGoB48PGRYsMCYuiMV//uWpy9CNMsW101/BmG0+FFfrCbjBGGj1iTWSwd1JSe\r\n0Zg9pwCQVCxqseDhmjAiy4ITHxXIcXE5VBbubrUW4EwwtekYLjg9rrRItvDL\r\nq7Dr/LjvO3+7zqxA3ZRSgG2KZc0q/Uc2WWG/ZUDiemPhVghqb6W69Qvxl3d3\r\nZWwnKjxKQ4lsx07TbLR1xUBgfgRInSMAd8Y=\r\n=yHim\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d020b19d0ab5525ccca1f803a00e184efafb15e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.50c9f550e.0","@material/rtl":"15.0.0-canary.50c9f550e.0","@material/base":"15.0.0-canary.50c9f550e.0","@material/shape":"15.0.0-canary.50c9f550e.0","@material/theme":"15.0.0-canary.50c9f550e.0","@material/button":"15.0.0-canary.50c9f550e.0","@material/tokens":"15.0.0-canary.50c9f550e.0","@material/animation":"15.0.0-canary.50c9f550e.0","@material/elevation":"15.0.0-canary.50c9f550e.0","@material/typography":"15.0.0-canary.50c9f550e.0","@material/feature-targeting":"15.0.0-canary.50c9f550e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.50c9f550e.0_1672760944963_0.9197145947612193","host":"s3://npm-registry-packages"}},"15.0.0-canary.af490a848.0":{"name":"@material/tooltip","version":"15.0.0-canary.af490a848.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.af490a848.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2b33b3ac80a374edfc9f23c65ea3df774ef52ef8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.af490a848.0.tgz","fileCount":36,"integrity":"sha512-rOorquJ6H3WyU6yqV8di+yVmIJYo1qqjhKbOLsR+pMaxJFWu+LiNFPdGGCU1Fy7G8UQozNQ2PlgeG8oTEd8pQA==","signatures":[{"sig":"MEYCIQDJdhLvNZQqQI8ujlYZGqf9vtLenN5WMGR7Cr/wRek/twIhAMDyy4v5Qaa7zIpNyTWL4Few7qQ7S2XVYsc0Munu6Mgn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1193783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtFDYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyRg/+IaFiTO6PRCABaD/B0t0Hl2GtN+6KN7Lp3fLMDSTaQ3f9RFZt\r\nw+P645AJt+XQl4d6w5rxM2GE4RHKPrGXu/0K5vu1raZMiz4v4pBtOwEB6VUp\r\ny9GJsL1L5N18UFOMwz43UeqmbTTS3SYJJVnbRQ17eUH76Fe1MkHB28yBzZdY\r\nWfvFCT3lVBEhJqmwuMG9hjJ8n2lP90OP1GSNwltZJP2mn7e4ZmY4HV7/7AFX\r\nEXTWqf9xwtZGOqJG68oVzO6txBlZbzyOExYW6e6IDZkDivOgCrQ9tuvn2qx9\r\npInMUe025BdWhgdii6EC52bSaac63fod4P4S32duh6fzh87tj0GsPmrXIaDH\r\nMnqXVaf5WGg8cilAonm4d8xgH1wZw1noqj5RiNG+rwQRAxhV8MAdmmRW9u60\r\nFiOjsKrBhi8XOo72p83h5U6P+i3Pi66VVEHb6Guifm0d6xbO1cz4SzAUkczJ\r\n7cdfY82GBpKzan6TNTgubx79evD+OgT1vF84bUiZ9+xWANDImuRM6bxt69Ag\r\nui6XpG8dzIFjhYCfv6rkmIOzgAGLyyqS3HuQVjpO4hbv003uh5g8Uwxo3psR\r\n/kUParKYQPDjcfriIomMj6317wAgrwLfkJzWgdq+ZxUSyTa+GdHXQZ4AP2XZ\r\n8dLueajX8LMgxB7fuv9oFS/BkPSoJns+7BE=\r\n=Mhv8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"95f5499a3dea1763e53574fb3b884e8e45cc974e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.af490a848.0","@material/rtl":"15.0.0-canary.af490a848.0","@material/base":"15.0.0-canary.af490a848.0","@material/shape":"15.0.0-canary.af490a848.0","@material/theme":"15.0.0-canary.af490a848.0","@material/button":"15.0.0-canary.af490a848.0","@material/tokens":"15.0.0-canary.af490a848.0","@material/animation":"15.0.0-canary.af490a848.0","@material/elevation":"15.0.0-canary.af490a848.0","@material/typography":"15.0.0-canary.af490a848.0","@material/feature-targeting":"15.0.0-canary.af490a848.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.af490a848.0_1672761560375_0.17337646030744835","host":"s3://npm-registry-packages"}},"15.0.0-canary.7cf487c98.0":{"name":"@material/tooltip","version":"15.0.0-canary.7cf487c98.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7cf487c98.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d875799e329cc3aa154868d89c08aa8e3b5e5270","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7cf487c98.0.tgz","fileCount":36,"integrity":"sha512-pawVF9QF77I2g//pKqKyN7fPmoatPM5aj3XaM74Rv8JGcMs/unNjzhcG/+/9+2no4nTl0/u0Wb3Kis0ksdGrrw==","signatures":[{"sig":"MEUCIQCq6SUjIuXYPDdYRtX94OsW2jmdTDZ0ROrXoA8VXObe/gIgRUf26HGh0Y57HcYauNbSXwDG95JlWkKXZPK8BhqFh0U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1193783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtGh+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrO/g//VYDd42w9aBqrriSWOMWa1CHjHycpN21/J6ehST/kvEQwGs60\r\nvpWFstvA0oVwRfG2c/PKVM7peVxF1rH27XjierfCEV3odQ6/6Mj9gorBWMnw\r\nfNsob1HOEw8sKdZAi0jPmTPkpbDhUx0ZZb71Fu/4LksSuh9XwIJR96F16nN0\r\nhH4XnJaYVWWEeKvH1CLt/korCGQFmosueMMjDYfPL2U9QX8fM4313C5YNV+a\r\n5ZzjXn+rOKv1H8H/bRoC+v1mjGqE1dJoc8ULJWtbwHzdAA6JtlcT7DWGDNHw\r\naX/krYe3XQTIb/YjenH2dODs1DP7NGkXVSZzgJO05vxjiFST9AnYsLpMtl3L\r\n3yWkZ71LnFCjlmVASS5NjkFjQ1YL8QOeZ7E5gtr4jp6zqF1H0/LCuBYHF7Hn\r\n48BnlgMGYD6NvWeCS8OvWvo4ABy/npGG5f+/kskrqGCkT7eXY13m42z7T5u/\r\nj8O09BT+ZlWoWg1O2uJdJx/Dzy/NXB5+W+hvrYpwf68X3r5n0I+4E1J8aJbu\r\nidNwNGTCoK9YbtO+WHcDPV67DPU9OiF3zlElClaGb2jQxSB96yjW6NAtD94D\r\nwHEdftYl/XX/sgecD7e9JhvMsf1SPzXw2VE+GCFd3WNiwqbT9Y6/bpCJDNHQ\r\n30Mv0fPbfKxtfB5ydGWFvBI2/GVggyi70OY=\r\n=0VTe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8d246270c785ca072651213aa63882309c7cd5ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7cf487c98.0","@material/rtl":"15.0.0-canary.7cf487c98.0","@material/base":"15.0.0-canary.7cf487c98.0","@material/shape":"15.0.0-canary.7cf487c98.0","@material/theme":"15.0.0-canary.7cf487c98.0","@material/button":"15.0.0-canary.7cf487c98.0","@material/tokens":"15.0.0-canary.7cf487c98.0","@material/animation":"15.0.0-canary.7cf487c98.0","@material/elevation":"15.0.0-canary.7cf487c98.0","@material/typography":"15.0.0-canary.7cf487c98.0","@material/feature-targeting":"15.0.0-canary.7cf487c98.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7cf487c98.0_1672767614225_0.4697442786830377","host":"s3://npm-registry-packages"}},"15.0.0-canary.a52be2d5e.0":{"name":"@material/tooltip","version":"15.0.0-canary.a52be2d5e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a52be2d5e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"184fb4ab5d1f9c23dde5c8280e14fb0e54a58641","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a52be2d5e.0.tgz","fileCount":36,"integrity":"sha512-qlIpxDegEU386LAJtUmgmUQtZqijWtUfgTl10WY+Gd3O8rF4tOmgH4AuNEG4gti6/BQmharJvM+/KxaW8q1f6Q==","signatures":[{"sig":"MEYCIQDj/+0P9ihrkb5AgdThtGJ08t38dnH73dbf72+4PPKVWQIhAK6Rnb8ubBblbZKWltcokv2cKv0/En4cacFelafdmPUW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1197631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtH6bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8aQ/+LDQO3FescMgKr5doo37S/jgYM3jOd+NsAYBV/mfD0Xk/YyLS\r\nC5vPNS7CPjAaWu+sDe0z3WNmI5n74kpPtMJMcplRuvD6vKqG6AZ8xAoOdYIX\r\nBqUptBQUP3ETQVwKqkai3j/zX82pFWMkq6EwWTvFc7+mXZoa7Mf9VQz/6b33\r\nE3ccDcL17NSBGK16D9EPbAGfGRJVoCth84odMkzXa+7xj3ZXlaRvtQwASnXU\r\ns8iiTeAqJ1dHnHGnZxqylFhWvxY9wBWqGdgRi0yH5lE4080wd+4URuRB818L\r\nQIgPSju15yU6d61w8wKXcOS+sq3A+Y7+I5f2uGUSreRsW6HLJEIuawGHb0B9\r\nvfPTcjNOvmU9fch7N7wJn33ZLn6xV30+hhq0HY456XP618079WTXSTP5/Z31\r\nMZeiXOPJSfPkfZk6jWNlkHCljDvbIkO0MuAiUKvbrgZK2dGKToKHC3Je46Si\r\nYOE5YkRFVtGsOLUMPhYyd9ETShjsRJfiQwhOnrBQNtv0XGJ0dPTo2MhO6Uvb\r\nsOAqj5zvuteg3XO+J9TJRsA7a8qrrvd/RaNiQAb0ys5aCXqOv48XQEFiUDmc\r\nwlxOuq051H6lgTCdffNIhufM/YRgHie+6y+H3nwjm11mL4uO2hJ246zbXZSa\r\nfVg4dauLUqOHZvnX18ftMHy7O6D73e9drbU=\r\n=QCJW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6c2c2b2b16d0188fcfc620c5bd95622d34ab600e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a52be2d5e.0","@material/rtl":"15.0.0-canary.a52be2d5e.0","@material/base":"15.0.0-canary.a52be2d5e.0","@material/shape":"15.0.0-canary.a52be2d5e.0","@material/theme":"15.0.0-canary.a52be2d5e.0","@material/button":"15.0.0-canary.a52be2d5e.0","@material/tokens":"15.0.0-canary.a52be2d5e.0","@material/animation":"15.0.0-canary.a52be2d5e.0","@material/elevation":"15.0.0-canary.a52be2d5e.0","@material/typography":"15.0.0-canary.a52be2d5e.0","@material/feature-targeting":"15.0.0-canary.a52be2d5e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a52be2d5e.0_1672773275351_0.4569333949354619","host":"s3://npm-registry-packages"}},"15.0.0-canary.e38ba17c5.0":{"name":"@material/tooltip","version":"15.0.0-canary.e38ba17c5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e38ba17c5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"747a4c19f0379a111281ba8e6170522f294d14c2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e38ba17c5.0.tgz","fileCount":36,"integrity":"sha512-OphaGGk6WWc3A1qQiAR1BhU9ryHW0rVA8VLDrXDuGSiXHxlRQHtg6o46nOyXjoW4QBxDwisXgd2oinA6aIuLqw==","signatures":[{"sig":"MEUCIAD/IlqQx4UZozIhavYozI/Rw9x7D8lzZsHYgLjruNZQAiEA1PTvFg185FccJMSaoFV8j6OHyHq2h0XccvOWuJjDEC4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1196580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtK1lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprRA//ZZiKf7rbL8WZ8RYd+Bm7SRbgyTFnb6K9i67TLD8hdGeZjG8k\r\nL6sWe81jat3TH17W1E6mLgKO9qqnmcptx6XnlsOKUFdRO3dFpP4hrj9mIDl0\r\nSgMesoIj8OsZUuE2kgxcivo5soxxPbLV2FynD12t2rncZ5wYlEm1Lf52GhWx\r\nhsV4vk+FLkxQ6Z0fP4WidM8zz5YamXQ2HSUbDheikJwBs+3AllGl7XHVJgvd\r\n4UyZw6fJ9MhMAtOxptbyJiqGAznRWnCjHRdDe9xp+tDbCvffui0KRp2ipsaI\r\n1Rw3HmMsJcwd2hBm95yvGhXjN6aQ0rupJwiMEeDhPA+ZQZdC1KSGjKNkTFhc\r\n9y/A2sIoe+c3PCAwBrvCFUz0u6V5a8nUBxFfyigBD1PNUCe59n8pPe+7JP3O\r\nstiYXHZUCdiXYp2P47A7bPKHAosCmPlzgh6Mn+m1qmfqckIaIFKZh2lp+Mh9\r\ntJx2eiq83LYlxKTQ2/2q+sS2xqJhHLquK9A4fsTr9+FFclwRRNWcIYozO++w\r\nmc83gztl84SyINkvK7e5bujaDWg/SHCgrOzCvQdyDpxnQc5/+Ltk+Un2NQb9\r\nT0NumwV+5/zexYNXgKPLRGUN9ixyceNvue4Nq7M6MsRRY23UfUE4/rC6/fm3\r\nUcZc1nPjFYouoSKFRQBJQsqJGvkzRNFd2jU=\r\n=ZNZ9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d44100693c450240b468ed28efc3841fdde62da4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.e38ba17c5.0","@material/rtl":"15.0.0-canary.e38ba17c5.0","@material/base":"15.0.0-canary.e38ba17c5.0","@material/shape":"15.0.0-canary.e38ba17c5.0","@material/theme":"15.0.0-canary.e38ba17c5.0","@material/button":"15.0.0-canary.e38ba17c5.0","@material/tokens":"15.0.0-canary.e38ba17c5.0","@material/animation":"15.0.0-canary.e38ba17c5.0","@material/elevation":"15.0.0-canary.e38ba17c5.0","@material/typography":"15.0.0-canary.e38ba17c5.0","@material/feature-targeting":"15.0.0-canary.e38ba17c5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e38ba17c5.0_1672785253579_0.3022533786931185","host":"s3://npm-registry-packages"}},"15.0.0-canary.49041a6c3.0":{"name":"@material/tooltip","version":"15.0.0-canary.49041a6c3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.49041a6c3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"834e4d839e8b4a65917424146f68a5c83efd2a33","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.49041a6c3.0.tgz","fileCount":36,"integrity":"sha512-QHGPMuBe2vdP0fWz8pTcH31FV6GPd+82hKU2fxgWWNjCunxFk+Mv+1F/fux0j19Ax7yxwQfo+2iNh7f2aqlTQA==","signatures":[{"sig":"MEUCIBQa5wIg71NsUdJiXspaE7x7CeN5h0CtNyAeWZFfcE+9AiEA3LV915YAoI/vKcTHfckzpwdXUMs8HzH++i9GltFCZSs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1196580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtZjxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo01w/+NYV04sZCS5awTIO/Idarwg/kc4sGyicITFuAy4GHvnZSwQpC\r\nCGfTYQeNsPmdzuQNpJiTy3rLYs6yWI9Y+Hp47nCJsS//Bv9xbs1VuFHpR8kv\r\nQk4TqhbTS3MMmBfjC3i+EIXsz8hHuKY31EmBjLmf3E3uCDc8Bg7wTl7lmitA\r\nZHqdtnaldGKINxRPfpMTAbjpy/IZY1bHNFCqKH6bELlfJttl2TmaUyd1gfgX\r\naW4Xc3wQBXzi0WwNRhaFmlTB6CGW8pEafgttXsSMVKe7C8BlIfdOJY+kITC6\r\nqB7zTbd/sEcOzm64tmuN9iZW2KFWRFrzn5/GyCB93OTgpKRXgdoIMNrHIOGu\r\n6tdx+QA61ewfOKOP4/do1wM3MO2bN/YxOPSYDUu02wavX7J86ZfNzbSURGDK\r\n94xPpwyW1D5ibKJNIkE+rD6mp1Pw/xwwXNkM/9Ll/EMK+e7Izl9mZcN3EN1T\r\nwLntEiY/qkwgmBk6bPvGG6Z85kbEHjqOTTNPuTznJDbJtXJsrWjR4QZW7Fh6\r\nucLqzGNUIGShW6z/yf7voFaMtWRhmSyQXB+ZEfb5hh69qAG2ymOhrz3gC27g\r\nrm6a5julW1L9Vpq27/8uTqHPpbnBOmlfYKmmaqpWHBEV2uu+tHYzl6E7x9m7\r\nbffTKMhATFyvlSPFLeF+aJRGPRhYSv1GOdM=\r\n=qPjW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f012497ba1285ac3de691b5e25afe7a21ff62bdf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.49041a6c3.0","@material/rtl":"15.0.0-canary.49041a6c3.0","@material/base":"15.0.0-canary.49041a6c3.0","@material/shape":"15.0.0-canary.49041a6c3.0","@material/theme":"15.0.0-canary.49041a6c3.0","@material/button":"15.0.0-canary.49041a6c3.0","@material/tokens":"15.0.0-canary.49041a6c3.0","@material/animation":"15.0.0-canary.49041a6c3.0","@material/elevation":"15.0.0-canary.49041a6c3.0","@material/typography":"15.0.0-canary.49041a6c3.0","@material/feature-targeting":"15.0.0-canary.49041a6c3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.49041a6c3.0_1672845553168_0.9554065083883203","host":"s3://npm-registry-packages"}},"15.0.0-canary.c492898c2.0":{"name":"@material/tooltip","version":"15.0.0-canary.c492898c2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c492898c2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"292be51176f389d6e40cd57d8778fa11778787dc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c492898c2.0.tgz","fileCount":36,"integrity":"sha512-zLTVn0fnDSmuj4a2/g5OIo/Ac2HDQwdfl/3G+Wb4+NeGW9Bq7YPrpq5aMwZ2Oxv+t69t3FXmpoMSfB3TwFFEVA==","signatures":[{"sig":"MEQCIG6B/fb2WeTc6ODnsiPo6t5BPy5eOqJTd1DhHdhvsK5aAiADDRkE5pmtsHadIF6wx7eXUaGS4xiZ+/AvOhkZCkXWBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1196580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtbnBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJwg//VPpcR5SZ0X3M92Wq4FE4eF623k8wdaSZGZrBXk3H8vvHWPOP\r\n/aihvtSdMpxTdxmMau/9i9A3ulg+P0+q1CT/3QTk4NooXQTq9tywc0/Va3Fy\r\nKv8AcLUeOzqHrEXBWGM8+ybojRZj7ccT9SZdidOkYr+3TwypRphpEBVbBuVD\r\nAWF0l6QBTwYXGB1tDLQQ+SLqitmfuQCDawKaXYmRH21t/m5vK1hvHy+c4VpV\r\nGBkRjvn7URPHknpkObnPaQ0d/0kgpCydENmo65LJo8fc+0hISm73T9Gyvj9V\r\nudZ9Qntkjdg+jXPqeirw2RgGWf4E5dn9byUV9EU3MqWO13bz7fT8m0fK7ZEE\r\nx/sBI8X1f/JeNkpfYH/EScg72dc3mERM7InwhCJInxZdiJS+VUx6U/g2psmR\r\nnQB66n8cTBt7NP5IRN50altJKcU3TEDWrRpdbEzonEZn4unkHw9LCysBVcl8\r\n/zlIum1w8efLEg0d1S8hV255wMoQdCiXGaWsS/QtWYCXTluj0DZ27CTA6HlR\r\nNx8OEnsIt4rvdPXwU9ABlhvT8B6mVGJPvYx4zeUEEWVNLJWs62qoXPcSyjom\r\n9D9dCeMaObzfcb/oXgRqeFkO2Rk9n5JYWck4youTkccyXyIyZEl9hX0uc47y\r\npDDrjOsdAz4NRRSIirrOdqoR3FQS8SICyso=\r\n=0trS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8f57d41cc546a15258de2fac7e4ddca48b2987ee","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.c492898c2.0","@material/rtl":"15.0.0-canary.c492898c2.0","@material/base":"15.0.0-canary.c492898c2.0","@material/shape":"15.0.0-canary.c492898c2.0","@material/theme":"15.0.0-canary.c492898c2.0","@material/button":"15.0.0-canary.c492898c2.0","@material/tokens":"15.0.0-canary.c492898c2.0","@material/animation":"15.0.0-canary.c492898c2.0","@material/elevation":"15.0.0-canary.c492898c2.0","@material/typography":"15.0.0-canary.c492898c2.0","@material/feature-targeting":"15.0.0-canary.c492898c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c492898c2.0_1672853953527_0.030404750110049283","host":"s3://npm-registry-packages"}},"15.0.0-canary.d7a2277de.0":{"name":"@material/tooltip","version":"15.0.0-canary.d7a2277de.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d7a2277de.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"091bf7184fbf50bfce062725c99173ca9e50d8df","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d7a2277de.0.tgz","fileCount":36,"integrity":"sha512-wPTtKcB4pSvY34yutlDUb2r1fE1eIVarZsi0hhwDqQf/UUTsnC+aT528+udXGIcZLLr+BBpQQql08nmFW+nXRA==","signatures":[{"sig":"MEUCIQDNPDe5NmPo5zRHseoGOc4OaTIaLYj3rRROhx6tj+P3vgIgdexaip9o/C+oCg9/fV3SJZZfYijo0wjbHvSmwdGqSGs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1196580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtfGEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoP4w/+LyC3BZWqi7nSIJrRkLkG0cQmhqRjGFf1IpkR24PofnGb47C3\r\n/MM+XFsm1V08cb5g9zKNECBkHHcvDANmMVe4XVn4YMpnX46k+dKDspmVmmxh\r\nliJwqe4/opbno2cAjKhoBgNADxOvZicmIsf3yIV8BLffK7A66DY1qmVLNhq4\r\nTwRSbQbYA7SZelQf9Xek34v8NabD34r1Y13YwLYwHGFlXYcQAVDi4wMVbVCw\r\nHtKdpc2F1Iqfr4dF6zq0tGnPjl+XKGqafJVEZKaEXswtczfD/o8t2unpSR4n\r\nImoA2jAJsZCSVMA03gQPWIlWG1NBmHvrZLstiiVZpqgjaDbIV+AIXiKOlZC2\r\n0ROibIiKLb0KWSi5cP5yzp7iAEZ2K66WxciQoLnno7neOVN14LWnSIBsXhEB\r\n8kpGih5deMBFFZWAvcqS8yH2kg5zAv1j7EQPM8VgBnWlJFnK6sss9ec96Pcp\r\ngx4fknQas2lJfwwYif0YTbFnY5jDHbhlpO/3A2COcZwanj1i3bbEcHZ457Jg\r\nYygbXax5ZFh96u64Lwp70exFm2+2qqS1CAOkTvVB2iWS8uNb4bRnWWW9WaVG\r\nwy4tONjQXcx/4ybvzd98pmtMv6SqOQYUk3gBXQbsUst7RtE+5VQh1ej/JNEs\r\n4FPl9GQ7G6wO+v4WhkFjH0tW/maNyuEIfrU=\r\n=23R/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f9c71e947019fdd0ca8837669de0401f3752d1f3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d7a2277de.0","@material/rtl":"15.0.0-canary.d7a2277de.0","@material/base":"15.0.0-canary.d7a2277de.0","@material/shape":"15.0.0-canary.d7a2277de.0","@material/theme":"15.0.0-canary.d7a2277de.0","@material/button":"15.0.0-canary.d7a2277de.0","@material/tokens":"15.0.0-canary.d7a2277de.0","@material/animation":"15.0.0-canary.d7a2277de.0","@material/elevation":"15.0.0-canary.d7a2277de.0","@material/typography":"15.0.0-canary.d7a2277de.0","@material/feature-targeting":"15.0.0-canary.d7a2277de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d7a2277de.0_1672868227981_0.6340060139486552","host":"s3://npm-registry-packages"}},"15.0.0-canary.fd95ca7ef.0":{"name":"@material/tooltip","version":"15.0.0-canary.fd95ca7ef.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.fd95ca7ef.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"324d30345714fd6dbd2f3874cef7e2c5aee6e9d0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.fd95ca7ef.0.tgz","fileCount":36,"integrity":"sha512-mbn/dBh8hYczaxds+e5MtmQ3Gd0frH9F0EAD6EQLKnuRirBrBQ6s5zhs/u7ta2wzG1pqCZTONjW8k+uZL+OpCA==","signatures":[{"sig":"MEUCIHszLaG/V8h9/MfGcwACtjMBJvFIiVh7HpK9hpbtP7PzAiEApzjkzWUtzwLKkgvwEXZHMUMqsaWcq9MN9o1/xLtm+Oc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1196628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtiIPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdLxAAh951vbGBRwxLw5iY+bVB3QJZS8Z1nWkGncYwitEdrlMllqAn\r\n4FLq7J2R7MxM8abTGxePyjtxAVL4lzeCgwdIOeX8XwxzCYc8MTGyj/7/wd2E\r\nXBVEv+Y5aXD+pCzSs9VnYw5XJCyXPDRc1/0RWl+DpeB2TDRj08TFngycP4wV\r\nPeERFiCOOhziiplYyVY9b9x8VDvhLqT+J5bri6EinhnR8gT7DAvjhFYHiLm1\r\ne3qxQbGCm8IpGt6RUghJD4Hd9xmvM5lwM1IZW39bCOIQrcW1WeobPkCPoixD\r\n5NwKz0IBCvFoTGC9QW1OHzbTBml6b/tOBz3ntyy0NZPuaDtwd+nzvdw8JZqf\r\nHln3Xe3tr9WqcszJ9d3pEV5bdyk7dYlGrB2Btz8JBCwpNyNwgHk4YpyC63Bl\r\nZZ04+EQrewe2MQptntk5u17Itcp6BTfUPmphhxXaGjrDlaXjF8ZoNwlgqeqE\r\n2GyFWEj95+EHX5ZMoOY1qIMtIrM2etHanHkV7qfNXLvwgjcvNOouyv3AK0v3\r\nNmyzivdyN77m04Yc7Y2mJiC6EeAeMEV/ic3Iwgt4qs3AlCYgSi+AdotY1Zey\r\nVmSBRV8zZjYBS1/N/ZrhYIdT8gWall4HJwfQbmjp4vm5VWkhIyvQ1gbRimdE\r\nvZiTkKsXZ099OSjh4HEmnXM5S59Aqs/uCio=\r\n=tXyC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b0d2fa371ec4a3d0a8a11e19d9753b1af5d2d62c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.fd95ca7ef.0","@material/rtl":"15.0.0-canary.fd95ca7ef.0","@material/base":"15.0.0-canary.fd95ca7ef.0","@material/shape":"15.0.0-canary.fd95ca7ef.0","@material/theme":"15.0.0-canary.fd95ca7ef.0","@material/button":"15.0.0-canary.fd95ca7ef.0","@material/tokens":"15.0.0-canary.fd95ca7ef.0","@material/animation":"15.0.0-canary.fd95ca7ef.0","@material/elevation":"15.0.0-canary.fd95ca7ef.0","@material/typography":"15.0.0-canary.fd95ca7ef.0","@material/feature-targeting":"15.0.0-canary.fd95ca7ef.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.fd95ca7ef.0_1672880654901_0.7576383315024449","host":"s3://npm-registry-packages"}},"15.0.0-canary.1eb44faf9.0":{"name":"@material/tooltip","version":"15.0.0-canary.1eb44faf9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1eb44faf9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"64b01d414298c7fa206cc64d1cb0e529f5e142a5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1eb44faf9.0.tgz","fileCount":36,"integrity":"sha512-gfrgx+8rWKNEWHROGn3ZXBujQBEbAWuFQJxzBnGxly1W+u3vLO39ASP3QBiclNZdSPGRhLZw7jg+Z2T6vAGM7g==","signatures":[{"sig":"MEUCICq10baVZgJuEuzMFQq9v0kh8OtN2IfM6k1BpdFlDxjYAiEAzbhcAL8bTqOFBGX0Nk6iUN3Oik7UG9f2k7cETrUOA0E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1196628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtpQVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+8A/8CJ2Rfx63606zzzEt4nH7xSklLj8QYqHlJGVFMezd57cbFkHB\r\n32ovh3q37bEzs/Mby0pewFZDOoWAgRBsGVZ2MW0LlAJaCVDONQYo8jCCdGDg\r\nnFNT7wqSlJWKiXMjzpMt5X+7q7HR/JUxaoKBI/9j8yE008JbnBb6bHFABdjI\r\n96nCVA/vCPqi7NZ1h/cCryAdmij53i/54BLPORcIRN/+xtb33cxNifHVHP8b\r\nqe6ifqk4V0cOnCiofoz6m9OScomPBZlU4S7Ioh9y/u/E+4/6fsWtfMzJwCEc\r\n2KdpNLMgDepYzHsryaMeqgZmZ9qH1RtMPysLQSH62VFqwMBZ/drrHufM6v9k\r\nKKxJmnCBoShKIVc8NS3J4cUyEG1oBMFekVub438WiJM+PvE1CwXJl9LqVST+\r\nKKzPPrG48ezuvhO7+uIWqzt4BzxGMoNC/ttJrkqNQVbW71gS1OXVSdjs73QW\r\nIk6XLoNxJvMvhgFIux3MdShtMtRxPx7eP4BkdPIQjnTrK55ERc6IT2L9JMB9\r\newJh+oPCIuLTPSO7dLVD5v61S16wwBRLdTExG+99DWXKm23dD7o1UwII7Gxl\r\niu4AHunnkrP+K5SQ7SczSdP7Vjz1aXOFAUjM2qXwn5bp8CNCOKK5Mo+FSOMa\r\nwO021oHdCZAJeJcHiWB4sucbHo6j6/YYbr8=\r\n=iAPB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e0eeb94598a14217ebc97ec3e249d126a29a13a5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1eb44faf9.0","@material/rtl":"15.0.0-canary.1eb44faf9.0","@material/base":"15.0.0-canary.1eb44faf9.0","@material/shape":"15.0.0-canary.1eb44faf9.0","@material/theme":"15.0.0-canary.1eb44faf9.0","@material/button":"15.0.0-canary.1eb44faf9.0","@material/tokens":"15.0.0-canary.1eb44faf9.0","@material/animation":"15.0.0-canary.1eb44faf9.0","@material/elevation":"15.0.0-canary.1eb44faf9.0","@material/typography":"15.0.0-canary.1eb44faf9.0","@material/feature-targeting":"15.0.0-canary.1eb44faf9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1eb44faf9.0_1672909844997_0.20100184208186578","host":"s3://npm-registry-packages"}},"15.0.0-canary.adcdb7db9.0":{"name":"@material/tooltip","version":"15.0.0-canary.adcdb7db9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.adcdb7db9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ec0923ba24a20896419ed628e005113134693d04","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.adcdb7db9.0.tgz","fileCount":36,"integrity":"sha512-CHRHnb5+XhbvisA7ron1meb22+tuMwNyx2D2CDkarTpNbOIh+rf39bS7yODQtvWrNs8Uc3RUmFb6gTOVbelYsw==","signatures":[{"sig":"MEUCIAmZL1QpM+CGgJjdxO0vGwWvp3RQgBQ21fUxWDYv+ig2AiEAkXGwfnKJgYB0bCnnlFHkgFUK0KX6t8RrzkD18vmtkwk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1196628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtvmOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtIQ/8CVVquPpp7YYDIlzIsyb7MnKZ0JL2lPzzm/VRmGtm9e2vbPx1\r\nBONWcytp6zlZBUhnWwZ0u5yQJX17eQbTvC2PQ/KCHcEMu+jgHi+YlDIYXsC3\r\ntBts+Ko5T0axRAZGPKVwEFLrEpJ9kB0eTk4+GpfcOn7CTdNkvAyTVp5Ib4yW\r\nnAmPpFoBJhwb26CYtfP1rQ+i4QrWg6TbtfC5cKTLhFroio2lfAVN3bqoyQ9H\r\nSenRVImKwUac9JAvzW1SrLNWpadyO9/A3wZdX8Ut2HhtzcOIIKpMawRGT3y/\r\n+LSssHjqP4H4ucKed5rdnah2YL1XWlMuPk7tW1mnVVHeBcRDWUcoZRPIxHgt\r\n20W9uCFyRIoJeFkp2JCIYD/uivzR8BYGiXahT7BvvP0LrTrL/4pnBcjeLpfq\r\nzIbLMP+o1UuhN6D6ndI/iKPgY4sFJQ5ciNfZRJCCl2LOnwxLfvbYAxUiKR08\r\nO10ECGtAyPtQXb3bQNoSGO+DUinXTl0/Kt8CjOe33YN7Z9trI6wUpLUpc006\r\nMEeN24iLchtcAwQmRoyMsXbJu1oZToTweVMSKUlbAzfaj77qqLcX2J6ZdnSv\r\nnvNZi2qMtBIYD22H3kNfGlsiBvCovDa4XXdgDpJi0dpN5X2tis7oOLykZ6Td\r\nmh2C4pgzMkTS4dGXa8ucPwHktLY7LPvNJOA=\r\n=ilq9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2bb419da8b7b393c085616b6c5f28a3eebf832f6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.adcdb7db9.0","@material/rtl":"15.0.0-canary.adcdb7db9.0","@material/base":"15.0.0-canary.adcdb7db9.0","@material/shape":"15.0.0-canary.adcdb7db9.0","@material/theme":"15.0.0-canary.adcdb7db9.0","@material/button":"15.0.0-canary.adcdb7db9.0","@material/tokens":"15.0.0-canary.adcdb7db9.0","@material/animation":"15.0.0-canary.adcdb7db9.0","@material/elevation":"15.0.0-canary.adcdb7db9.0","@material/typography":"15.0.0-canary.adcdb7db9.0","@material/feature-targeting":"15.0.0-canary.adcdb7db9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.adcdb7db9.0_1672935822649_0.7439163406381557","host":"s3://npm-registry-packages"}},"15.0.0-canary.067af7eff.0":{"name":"@material/tooltip","version":"15.0.0-canary.067af7eff.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.067af7eff.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9225d7b7d72e6ed43fe159c4e6ae3d27fefbfa44","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.067af7eff.0.tgz","fileCount":36,"integrity":"sha512-BXdtUSRJJ0KlB1rVbnLaLiU8cW+GVvKe4aSA1+pH3pSWPFwd7LEeGtkAjWfyRHGyGCXiGwROId1ae6F92SpCUw==","signatures":[{"sig":"MEYCIQC6BiMjcX1d7AfoI9VjphnfrNW6+B1MuefFzfldKKy0cgIhAPyH124jx0SaXbvT2uq7GJ3oePkgclqvS0EOrpShvOob","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1196628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuKwGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVhQ//aP8OGCOJbB0rmSJgcNnZrtSdIwwRHjRkBjwDd1qlrH/LoO1a\r\nlnlt/004VP8s5JkpP1PwCYkTX2npEP55YEFe3KO/+tw4kKkYawXf6Yv6wbIn\r\nqDo3aceRGWOCSAXZP2DIzhzx43zSvkX6NX5SFfRRWH34D5LZT59xEbrS8TZM\r\nAD5tjnv+MbVrjLA6wDjj+/A2toLV3U7iu11G3KgSuKqSh9o42idNsn91D0wt\r\nb3XbsV/15/nEAR/pBxa5nZmMO8FV+R5pMh8+fTl7w61ddAR/bcuY7p8qTG9n\r\nplAT/rBmaIcnlUVQyCqy3O0SpSPs263rc2mtuOw+ADjPDA8kcNBc4SW/esqQ\r\n4PEaDSjq1yaHHRGF64JtDGCyhyMSFLrUsWKUfvSeJ/JauT0yqmrl90zm0oQM\r\npC3rKrl9FXemEslaPP1TxIvRccN2puwuZ5cJOi5x6v03RII+ZT0OLs63paw7\r\n3HL7VQoWJemsZD2KAcQaXUZ/Xq5b735wtetC7w/UI+vh7KIr8KJpAP/9zXJn\r\nD/eY/T0a/xUkG4BWfz5Y5dLV/Q6zEPB5Z1LupfwyGUnhGJq0sp2REu+BAC2v\r\nhmT8f2fGMIb/BHGLhSU57TsbnGGV6czc9EYcblv93LKZFxeDwOeqKyktwupI\r\nyrMzB5Qu726JfEpTOoOc7pEGJ46H0DfUxgI=\r\n=YwM2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1fae2c792ff8ce557995a8d5d858676b4355c7ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.067af7eff.0","@material/rtl":"15.0.0-canary.067af7eff.0","@material/base":"15.0.0-canary.067af7eff.0","@material/shape":"15.0.0-canary.067af7eff.0","@material/theme":"15.0.0-canary.067af7eff.0","@material/button":"15.0.0-canary.067af7eff.0","@material/tokens":"15.0.0-canary.067af7eff.0","@material/animation":"15.0.0-canary.067af7eff.0","@material/elevation":"15.0.0-canary.067af7eff.0","@material/typography":"15.0.0-canary.067af7eff.0","@material/feature-targeting":"15.0.0-canary.067af7eff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.067af7eff.0_1673047046377_0.6952466991318473","host":"s3://npm-registry-packages"}},"15.0.0-canary.21d1196a7.0":{"name":"@material/tooltip","version":"15.0.0-canary.21d1196a7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.21d1196a7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e5d84ad6789fc2a381963e026653ae5685d69527","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.21d1196a7.0.tgz","fileCount":36,"integrity":"sha512-UDtAqMZfSWIKiu6oxuxrzGHroASBQZTmhw88e4h5qO/R9UPDnp1WQra+5NQ8h2CqRByW7FOLOATuxlTgGw9/DQ==","signatures":[{"sig":"MEYCIQDPzA1T2aMY0RsXPBWMSdMMHj9dBBisubfpkVxyolNOMwIhANRBF/UT/oM90ieZLkJyIuSw8BQt2oTfEHlvOOpVAJms","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1196628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJju/AvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohyQ//R0IoC7/lJ6+RLacj/S3pI6+uX0Jn8WtHxIdI5AqiyylVuZhV\r\nhlQtyYjr69zd08VXwVJPqqWvu6LYrUUJdVFUFiPpP6WfUgMCF4rYOnrdx3Yn\r\nzlPNutjek15A8W9IBbNmnqCupjuPRXPAIPRpuZWzZIJz1nxYgAFT8tX1iiaQ\r\n5DvQN5ZjrFn2wmmp6vKAsUIHSh2aaBWjN+lVK1FXEVxbm/k9dK6Dza5WDIqz\r\nHmKSQUT8wls8h0yuH1s5+9ZOmezOpa72drLq30iFaAnJoR62+V3F75YRJlFh\r\nrSheBTKwAgO5gsd5O5bYg/E6F2yJK4McsAwpzk35jmEnlUtR682OmFKGJEDA\r\neLahquiRmEWhAuXCnFs0lyTu7H6FqVP/dvnTrEG8uU5MBKl88UjqM42u0Rls\r\nAZ3ZetxAc558iA10L9sdcXC1KUWNZhn00aJBOpDMVfhjIXTusLPnLL9n+Bbs\r\nfrIPH3ig9X4+QJis8w3CZ3JowOn9FKMKCxyWbBP3Phy66t4xrXF5rChbHTy/\r\nRqyoHo0iLXyYHVEUOcubK1HwUuW0oPkiGO1M7gvsEjPR1SKFyx32J81MSbeT\r\nIGmRNTKf8Pue1d+By580f2VKzCRCQ24pjNBprG2pe7T9Sll9gNHz8xwBNwPI\r\nQgiDWXDjUprqs+vcvXTeW6KJTZiVs1uP/Z8=\r\n=f8lc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"361e536c54e276112f021b419f666618a20599f6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.21d1196a7.0","@material/rtl":"15.0.0-canary.21d1196a7.0","@material/base":"15.0.0-canary.21d1196a7.0","@material/shape":"15.0.0-canary.21d1196a7.0","@material/theme":"15.0.0-canary.21d1196a7.0","@material/button":"15.0.0-canary.21d1196a7.0","@material/tokens":"15.0.0-canary.21d1196a7.0","@material/animation":"15.0.0-canary.21d1196a7.0","@material/elevation":"15.0.0-canary.21d1196a7.0","@material/typography":"15.0.0-canary.21d1196a7.0","@material/feature-targeting":"15.0.0-canary.21d1196a7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.21d1196a7.0_1673261102983_0.75261495019266","host":"s3://npm-registry-packages"}},"15.0.0-canary.8d2d8d3c4.0":{"name":"@material/tooltip","version":"15.0.0-canary.8d2d8d3c4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.8d2d8d3c4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"138f6d20fedf8f01cfa15bb289f293aa564328a9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.8d2d8d3c4.0.tgz","fileCount":36,"integrity":"sha512-tFCZuV7wM/G9y3q+/gUf5LhMTDKAkITIRoyQMu7mysXJlzAQ1sNcU/TlR02/ODykf/cGJb1zRk6Z/psPQoocwA==","signatures":[{"sig":"MEUCIBFd+8qjgAaSexT9kTKDAj8uk+KWsmf8ig++v6T+cvIoAiEA+spggCe94oQX5tpEw8VMRkd4WvUQ2f3XxbqvatOJjdY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1197344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvJRbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoz0RAAjxVGhFiUGkTm5ckjkSYY7LOGjx+NYYLS/x++JV/4LNEpc1Fq\r\nnRbg7GNWBCstS9MmPxKrOkyE/fqQUZUi/Ra1t4RGk5UfPHgSbWdRku3H09yc\r\nfC3h7MoWJYj9DO7utPsah7bfHTUpAi5RI80UVNUbr+eQGSojwVNQKA6h0gx8\r\n2kJJvU90xPFrpaMfeKICbMfA7MhzO2i2zDHpTMu09aHRz/RZ/hT6USKcQ5eZ\r\nSJaRxi1Qs4THkoTyctprWg7FdEI2is4+HRpZiODzhaR/GcUM7dKc6NPIl6cF\r\nxbvp4zwAjEWAAGopvSvC7he35gA/cFTHf3poa2yTAZ5T9NiVteRhn7kxNphE\r\nA/8za+w75nokBkuVmiKWpixw1y3SY7Fgbr1fOS4tXscKB0BUwayshFPZw+1H\r\noTAb2olKUhDUzTKkrtYePQ5kgB8HSBmSXh3N6fYtmwYE8mHg0tcu1JcuxHEy\r\nLhsdILgAFNI5gxPrK5HJ2j9b+PxyD1kCJJCkfO8GHu8LxTIho0L8G9/PC3J7\r\nVxRwpW1vKKTg++8SK67fv/2hnhK5KBr/yQzqUDEpcHzE74uqhxoIKV9dW0Vi\r\neOUqStHYefALLF5f5lhRr4VkrUM7oJWJrVY/16VafRCINVouvCEsiRyJAQma\r\nznoWnwbKD78NpeHeXEe+0wAXOttZu5VWOFc=\r\n=U1ZG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c2df4624468d99280d9dcb0894d04d839fc8673f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.8d2d8d3c4.0","@material/rtl":"15.0.0-canary.8d2d8d3c4.0","@material/base":"15.0.0-canary.8d2d8d3c4.0","@material/shape":"15.0.0-canary.8d2d8d3c4.0","@material/theme":"15.0.0-canary.8d2d8d3c4.0","@material/button":"15.0.0-canary.8d2d8d3c4.0","@material/tokens":"15.0.0-canary.8d2d8d3c4.0","@material/animation":"15.0.0-canary.8d2d8d3c4.0","@material/elevation":"15.0.0-canary.8d2d8d3c4.0","@material/typography":"15.0.0-canary.8d2d8d3c4.0","@material/feature-targeting":"15.0.0-canary.8d2d8d3c4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.8d2d8d3c4.0_1673303131476_0.46774407168124","host":"s3://npm-registry-packages"}},"15.0.0-canary.fc6ee6c32.0":{"name":"@material/tooltip","version":"15.0.0-canary.fc6ee6c32.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.fc6ee6c32.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"989e6c5d4560da643a87474a7eb56477eef74b76","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.fc6ee6c32.0.tgz","fileCount":36,"integrity":"sha512-kB+im8VJ0Gh2wUH9H9Id1DnrGyfVe+ao0ufITkQCQjfVUeBOm8T2yXS2X2Jtpqc5I5nlY0/nFveS+SG8zsxSvA==","signatures":[{"sig":"MEYCIQCDXMl0WUuEf8kcn6U+JXrD/5PLslX/WbO+azndtfyLhgIhAKNgd4rQMBSNwzetDdPphwk7ws1D8pjJiM5VSEHzdGFh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1197344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvZJwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdwA/6A1DJe8b9w2tZjBZEsZGnxuJ4YCVk391hyOEZvScvAyilLNOy\r\n5dsq+G/dUuic+bc0CYPjD6LqeXkqNa7dquVBgcKFLA8ulR8BEAAlhBIbQNak\r\nwl59QtbfI7KaZHVSFlQrANbyyXyaQvQsFvPU95q1Cex5Kmb5QqpODxYeZb59\r\nZbQD/mduPZFMkjn6e8B9KfEiqCE73M6od5rSDTKNRQNKwBpQIXRX54CdPNWH\r\nNne2WQUSvvOh1AKbjuubhuRoff24+6VKH9LSCjmPMs6oPe7Q3QO2GDYwkW3t\r\nKZQ5Qi3RYRG3kg73LIi9Q957Dik0OWdUpnO9YsCvFNjkiJIkMmipjZwKSIAr\r\nnDD9zKfemP1kNC6pQ4ZqaX3BH5glJkj30YGnDXv5pMHFKuj43v5+qZ0jGbiS\r\nxwRqy78U1pGFNUlRp1hp5hfszXJGArypwMiPy4PzKXrLMr5snLt8Sa4FGfkf\r\nvlLXxyGzgs49pueyZGg/pOBa0sp3WtvZR6rKkKHN2hVuzclMkdLZYTL93Ouv\r\nphf2BW7fAwh0SFuw+ueFElbk6yUSpXJ/7HrVRLawFWxd5OtJWfJhfmUW1hJ0\r\nrLiDl+NMEZOgex0/REmN4XIXxbk+HbaB86RyJ56NzjU97thccWN4IRsQIP4p\r\nQWlHa4/FVIUr9L606NrUxmzuLQ7YHTOZ8Fk=\r\n=HZDk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"225aabdf74bdefc3d2f70f268ddd04c501a821ba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.fc6ee6c32.0","@material/rtl":"15.0.0-canary.fc6ee6c32.0","@material/base":"15.0.0-canary.fc6ee6c32.0","@material/shape":"15.0.0-canary.fc6ee6c32.0","@material/theme":"15.0.0-canary.fc6ee6c32.0","@material/button":"15.0.0-canary.fc6ee6c32.0","@material/tokens":"15.0.0-canary.fc6ee6c32.0","@material/animation":"15.0.0-canary.fc6ee6c32.0","@material/elevation":"15.0.0-canary.fc6ee6c32.0","@material/typography":"15.0.0-canary.fc6ee6c32.0","@material/feature-targeting":"15.0.0-canary.fc6ee6c32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.fc6ee6c32.0_1673368175809_0.747221489106316","host":"s3://npm-registry-packages"}},"15.0.0-canary.73537ab0f.0":{"name":"@material/tooltip","version":"15.0.0-canary.73537ab0f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.73537ab0f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7760fb1195f84ab72ebc832da4697d85d28ce959","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.73537ab0f.0.tgz","fileCount":36,"integrity":"sha512-Z3RGetaNttcJGEJEcKHReDUtnzVu48KRc4OJSC5hkUh10yPm0pAACIa+nD0YVkJ63mtJJPxcDKPC7GJlvnwefA==","signatures":[{"sig":"MEUCIHpnNkVaWtDYVJS4CwzRapu+HSvREoOfaOM5sQtJZ+3SAiEA0wnfG4eaHoUn8KkNz/NWPmCpCneYpjnNBO7F0MVSYv4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1197344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvaqwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3XA//eRJqZbVW57K9BvN23839D/tYZxsbbPvjVCZD3CRO47jaQxyG\r\nmTCGwuL6F0ovE6y0gVs0c1ZjLKfBga7lqvkYKoSFgkShYqyq4kN8JN3gDv77\r\n0+rWWEuhmxFqT0wL0YXW9M98X4mc8S1y03wwcUTH9au/xbUNh0TYB1LK5kTF\r\nWpZPe+EHKKgyJkxLyTyG0iFNHsFIljG8yNod+vkHJQIn6Fw+4ptLlZXhWOE2\r\ntIoVSZ7xe1Ar1wyOpp4Pfi9AuoSxNVSYfGfefWcIxEwJYA6kCpHP1pYjDD6h\r\n3tRuH8pKcJ7S0atsO/xcYLi2KFbA+kWfMpiyaEdessG0x+eBpJKRQPASPOJj\r\nKCHX6k6jsDMDyrCQ5ickU6XJ3cY5QVRpnb/rWdjJP7h58JZn4tCPAUfWjA8U\r\njAAKwYFreF0JU+K2M0Hc8RZxVCttvC/LRttiITRbKVIR+Ly227h7AatBvsg6\r\nsFRRiEjgK1t9eNuULrML57UXAqju8xSMKWiJT2746BQmfmKGYIxPFkrNHC7I\r\nNQEBVcFXuxmLjhcL69TZWgjjw5YnFZ+1aPWSJm8SS3JZINMTaDpy8oAidnet\r\nPSjQoXVUpWg1xKKbLKFp51IOTHz2QD8H9D547O8vCkZEuXh/9IchBQOA7EXm\r\n2VE6+w1aVCpWrGE71TUMcmyYWHJKgKOhIOE=\r\n=GUVU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cb3a480e7be3c8c7bc8f8ee0acf1ee8145f266b3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.73537ab0f.0","@material/rtl":"15.0.0-canary.73537ab0f.0","@material/base":"15.0.0-canary.73537ab0f.0","@material/shape":"15.0.0-canary.73537ab0f.0","@material/theme":"15.0.0-canary.73537ab0f.0","@material/button":"15.0.0-canary.73537ab0f.0","@material/tokens":"15.0.0-canary.73537ab0f.0","@material/animation":"15.0.0-canary.73537ab0f.0","@material/elevation":"15.0.0-canary.73537ab0f.0","@material/typography":"15.0.0-canary.73537ab0f.0","@material/feature-targeting":"15.0.0-canary.73537ab0f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.73537ab0f.0_1673374384032_0.2271699600039272","host":"s3://npm-registry-packages"}},"15.0.0-canary.684e33d25.0":{"name":"@material/tooltip","version":"15.0.0-canary.684e33d25.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.684e33d25.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"981a20a010a7c41064f1a655f3f2482588585ed5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.684e33d25.0.tgz","fileCount":36,"integrity":"sha512-dtm26QjxyQdinc8btgz6yys07b7bUW4FZgNF2EBPeGrICrPg7jf+JEvDziz5g8VMaTBQLOQRSCGy0MKuRlOjLw==","signatures":[{"sig":"MEYCIQD76sOGH8qnT8zBZGa/j5xadq8KntKeLz4O0H0Oa5+mRwIhAPN1hQyN0qKzr2gp90pZqpY3FCg+UTzOOUjJTBoDPxnW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvbpfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTHw/9F0CBrHqqZL9BH9OWfcWE1wvBVoE/6pQXZRpxOs7uSsD4x2CC\r\nOswCM4z8tZ6r1ghiQtflw5OMgMSLu+S64iN4CrOgR5flsxFANW00psgWjfvX\r\nE3EIB0p7iqP/Ebi89wOK1z4L69pnXaPptIHxJg8b0mBKQsA5OsuLmv78VPA8\r\nWaVG0yUm3rQ3bTqpxCt5rkfX9yFyAeJsLcOZTxCj/WeVx0oDdpVZ6xqygF7H\r\nXkU3qnItJf4E7Sw1zl8kmY9Dc54qB0AyTaDbAjvDQTA+iAvLX/n/Tp3odN90\r\nVMnqB3ed+fwbHo/BnfYqxsYasjNQbc5CwvEjHg5luly0y2SxQCKbY2wZP8fO\r\n94zeaPR/C94YcLE7hwx2TJvJ/bWfcgpqTSya5RdHDraL98yvohphhohuWRIx\r\ntBC4DqdJAfbC5PfU47ziONZ/6UY+kWgeaGWyFR6r0eBDnVtjMHVrFF1mWCE5\r\n8/9cQQIjU5k3iwEwxIDr8LpuKiFp1ApEikQYlKaycykNVR/ExFYoC40dQQRs\r\n5B32eLOIemrdKtWsJKXWmSX51o6yLsLz8LtWEEsf4ZS4pNXLffCDwg6pV/ig\r\nraiweTEiPv49tpLXjn9pwkvLRmhQiAiUxre8+Qj3qy3E5P/GOCvoQGwKb2pS\r\n7CSel8DUMIANwo5WN4nZEn9/5ChXaBi9lVE=\r\n=kbyk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"518d26a1e091925c1b3a87f4d4f4dc828580a863","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.684e33d25.0","@material/rtl":"15.0.0-canary.684e33d25.0","@material/base":"15.0.0-canary.684e33d25.0","@material/shape":"15.0.0-canary.684e33d25.0","@material/theme":"15.0.0-canary.684e33d25.0","@material/button":"15.0.0-canary.684e33d25.0","@material/tokens":"15.0.0-canary.684e33d25.0","@material/animation":"15.0.0-canary.684e33d25.0","@material/elevation":"15.0.0-canary.684e33d25.0","@material/typography":"15.0.0-canary.684e33d25.0","@material/feature-targeting":"15.0.0-canary.684e33d25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.684e33d25.0_1673378398871_0.349292980051668","host":"s3://npm-registry-packages"}},"15.0.0-canary.0e89aab6b.0":{"name":"@material/tooltip","version":"15.0.0-canary.0e89aab6b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0e89aab6b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95aa937c14a7edc20517e1c76b57d4a0aa39cddf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0e89aab6b.0.tgz","fileCount":36,"integrity":"sha512-lvWMv36unEL4ivQVYlubBmi+i6sRvpAzyZf6LDaMFgBgVQGVrxlZtGqQ1bLaMIvcI8NK/af+OsYvXmqBaV4+sw==","signatures":[{"sig":"MEQCIGOPDImKwZGS/fONDHcWUVIwWKczvhsi9DQtNU8b2hKrAiBKLtlle2bij99T3m0IRfnaeWL0PWPiGslUyasTIdCQoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvuGtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKSA//UTSI1EqPaX5TZbYX9O8/+wwQlRqTzap+CBk83YDJAKh6rIws\r\nZvsxjE/bYLWi2249vUbgTg3TLJz2czPff37s5dQLJPRYLQkf+Xqk37IkvrA6\r\n3mJWq/yjrmC9TrWtAIAMAQ9aTeBv6Zld2bFcNTMlx2U1HeZnIhtI4gFyZHQH\r\nNffNx/qsTqPbHoBUI1ZQCFrKPgD4HcEMPplfNJLZXkqgZwCRM6bf1hiSl7tt\r\ngI4g6AEAhPqFJ50OMhhmJxu/x1tAvNrzQaloR6BecrFBLu2dHj4MaJwccjG3\r\naHI/vNW7a4b6PADxrQKFBtOtrzvZ8ew/O8Jp1ExTIhI5aeb0x7KAGc9uJHvb\r\nLbYEqrcWWNfD6o2QwmBMGU7GasIqrCSeSg3WTWJTZjsnHV1AMZpXTIB2QsDd\r\nlRIAj4Ok2CjA8EiiP2H33nmCHc71cVqDd5P1J+OKO8AkiD9aqJws+Hh3cLBA\r\nTV2nR08zR3ABr5djk6a/VJ/Qqv13hYISnlMWCa6rD3cLWerPs3u/kKBRjGWy\r\nilPuRgaFJisQsx1Lt1VKCXLsXnzGSd10kGCTHMnCh1/XdXwAsTmoyIz5YJoQ\r\nnx64qRuOU/Ilc3raZiImnfTScutHkG0qksYL7EGAb8WjX58G0qrM0T6wjbxg\r\ncRrfK8X3d+qPffyONd/jRe/lVx44JUkQc6U=\r\n=oHWX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e4a9f0d636d7f4d6c0fbbf49a7016627715eb3b6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.0e89aab6b.0","@material/rtl":"15.0.0-canary.0e89aab6b.0","@material/base":"15.0.0-canary.0e89aab6b.0","@material/shape":"15.0.0-canary.0e89aab6b.0","@material/theme":"15.0.0-canary.0e89aab6b.0","@material/button":"15.0.0-canary.0e89aab6b.0","@material/tokens":"15.0.0-canary.0e89aab6b.0","@material/animation":"15.0.0-canary.0e89aab6b.0","@material/elevation":"15.0.0-canary.0e89aab6b.0","@material/typography":"15.0.0-canary.0e89aab6b.0","@material/feature-targeting":"15.0.0-canary.0e89aab6b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0e89aab6b.0_1673453997320_0.26069546624558915","host":"s3://npm-registry-packages"}},"15.0.0-canary.b0103d10a.0":{"name":"@material/tooltip","version":"15.0.0-canary.b0103d10a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b0103d10a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ae266d6b7e078e843b093d04ae35afb26ac265e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b0103d10a.0.tgz","fileCount":36,"integrity":"sha512-QcAfZYmcvwkCFau/q3SPgHgyACJpL6bnWL9HGSq6pLQHZ1qgU9JqRGBFi2nZMeVVo2olxGwn+twHp8KHh/7iPQ==","signatures":[{"sig":"MEUCIQCC0pZZ5Six36uJxZGBT4BAIc9h1U4df+RZdjIv7qlqxgIgIJXejaiQ6nntxci1PuM58nXZObf7MXd7k1XO1qSjMLk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvwqWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxKg/+KGFFggIFKAfq+2UE7Og6rlIF2T9bHBF1evDKcr8Zqkwk5r8s\r\noODdypYYnNa09GusvFls7KXlkS+QqPee/4vWitpcraNjQD0Pr+r2NGrrS0/S\r\naIsZ9cMP+Ne7CRQV4O5eEAEB7v9mUjO06MHYfqY2BJSBZEX1EIjWHH30ZOkz\r\nSW3b81MSUKzlRIPYvfZZRkyZ+6Mk85HJSlaIpzCdnXby3upLSknSeLb5J6JZ\r\nTmWyxjRdB8AN5m6tzUv9FND25I1Knl1yT+2y8Ebj86a2yFH0G20W+cTmsa2J\r\nLQA0GBxmygYDgHx2LkWqiV22meZdAGHPfx/TeHqT8eSQp7MP0qBh9ZFwGic5\r\nQDlFzU8jR0eWimc9SdM2F1ppljTl84M6TjtdEQXik071QxHIx1ALi9g4zFsW\r\n2+KqcbwxXnxN969VFkdV+pkB+fQJ+bED/fheCd4WhTcWeEowuTp1i0Ehd/6F\r\nGgZF5AiLKIWTpOBRlYpjNTplYBxSz3eS5xHI8WVK5Ys6l0JmQireEKC0Amrz\r\n3ijy3WYs7VooBMNE375JUWgumXfF0eq2U17mpDCl0a5RzXxsSW9RUix9At8J\r\ncl6Q1UIewi1Zb2JirsOD0eAYsa03TlKLF5gq/7D9iLAUFN6MUptqOJwcgw+F\r\nisSPApgEmK9SAlXnKtzyePX1zPOJ9ebWyEw=\r\n=HsXe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0e133b89a4afcc8020dbafdd4d22c734080d2d17","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b0103d10a.0","@material/rtl":"15.0.0-canary.b0103d10a.0","@material/base":"15.0.0-canary.b0103d10a.0","@material/shape":"15.0.0-canary.b0103d10a.0","@material/theme":"15.0.0-canary.b0103d10a.0","@material/button":"15.0.0-canary.b0103d10a.0","@material/tokens":"15.0.0-canary.b0103d10a.0","@material/animation":"15.0.0-canary.b0103d10a.0","@material/elevation":"15.0.0-canary.b0103d10a.0","@material/typography":"15.0.0-canary.b0103d10a.0","@material/feature-targeting":"15.0.0-canary.b0103d10a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b0103d10a.0_1673464470334_0.33637575398362896","host":"s3://npm-registry-packages"}},"15.0.0-canary.50e7a5312.0":{"name":"@material/tooltip","version":"15.0.0-canary.50e7a5312.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.50e7a5312.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"32985a9a9ac26e1337c9a78b954f5609a30319e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.50e7a5312.0.tgz","fileCount":36,"integrity":"sha512-70YIwBQ6lC3fXTRYLRmOfeIZpKp4QMf0H85N4q6c+PDhY7HMA0bdY19kIs6tYqBPvk5Mg/P27HdbqQfD7jN4dA==","signatures":[{"sig":"MEQCIFHEWuV0nm1KQcxp2hV4cmIBreSr/9w6XnptHCQ9cWNsAiBm740KADPdVgrbTUcBt0DWkcPJbaW5s1qD6oLby7hImg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvyJLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbtQ/+LJ++uPspHkQUK+7hbeeSmg/HMzmu91+eXbloO+egDHviqpth\r\na0TFwxrapA8YDPiMowCgM67adtoV5Lqsf9Ri7v+SglHnsz2ChhQPCGaAAI9O\r\nV5SP+9VC0ie3D2ZB9hdFAtkwIq4Hl++sOnlzgisgq9Kbzn7RVAK08olXijBq\r\nCVPDMm5IcTYPdd1XBICWmjrkdsX1QtI+c5HTaCt+LOrp8D4s8Xw0VahygJMs\r\nzV+zQtsuVgcTnDUysfdNFdJrWh7759UsT6D3pOVvQRxpg/6IJ26ldzFH7h6d\r\nVEV4O3IEP4uWUyD3M8isbnvRJ6CxOYOVmt3pb5EU2Y2ww5Pc4lErIjTgl0GI\r\nyiKbmK1Ao07WF0Y1ZOdxL57fbBwrg/VJQm0LYy3B01920WlWLtmhJP0jpI/F\r\nozAztiWfRDuP3oyehqjJeghwnfJPUeR6mDfoYq4Fy3NXuZWhJey/Mro2Edoq\r\nY1f3rc4VF3230TTXwrhn8U+sRsiDoX+DLVuTNwDve4xY5BQcsOLxhUAA42GZ\r\nntRJ9TRvG4cIsqKYEzNxrSwetltDukrGz2jx+oYmByUErwZrtR7HSXqiGVPf\r\nD9eZgF8vlreQ4hwh785k5Ucd2fiJxXeozZn/yV6lqLws6nAomBfiT7xYCCJO\r\n2WBk9YCQVbE9OD/zxAYPiRpA+mSOR6A7LZg=\r\n=VKsS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2d4b8df3edcb9b5e9fd8d8b6645dc9519d92f376","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.50e7a5312.0","@material/rtl":"15.0.0-canary.50e7a5312.0","@material/base":"15.0.0-canary.50e7a5312.0","@material/shape":"15.0.0-canary.50e7a5312.0","@material/theme":"15.0.0-canary.50e7a5312.0","@material/button":"15.0.0-canary.50e7a5312.0","@material/tokens":"15.0.0-canary.50e7a5312.0","@material/animation":"15.0.0-canary.50e7a5312.0","@material/elevation":"15.0.0-canary.50e7a5312.0","@material/typography":"15.0.0-canary.50e7a5312.0","@material/feature-targeting":"15.0.0-canary.50e7a5312.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.50e7a5312.0_1673470539433_0.9999877582360481","host":"s3://npm-registry-packages"}},"15.0.0-canary.202823f54.0":{"name":"@material/tooltip","version":"15.0.0-canary.202823f54.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.202823f54.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9a99c8da5eb81118ad9a9d48d9fad56544c3a546","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.202823f54.0.tgz","fileCount":36,"integrity":"sha512-D4cMi0Y6Y16kJaAsWFnHY1bDiX8fnmgfIzYZul5AqIDlqc2yWho2mQo4tsam5F7QjriYklP+co3momCDi4pD6w==","signatures":[{"sig":"MEUCIQDn6PHKTs0YCsM24vZl8+aRSkQJsO+lxTdrvx+hT41AYgIgBa5l5+qLeqRXaR8yPgx+bwbp+j1XRjo3qsgzZWzMqcs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvywFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0FxAAm80oUkhymWZMqnCG+ak5l84mTcne373ImFr3zYLJadJF01Wi\r\n8Qscihj3vYoTRu64D+5mlLw4Y1jdnG7A0Q2WNbsvQZ+Uowdhb3KNrgubNrHw\r\noVQwp/VanCVeqWZ3W7J2VLeaHXp+SMqDWpgHOOD8hk8DvzIUVaGRWrKT837h\r\nlm0+awsfXlIaP2jbecWlieGy8FtOVKvSNYC2KuVVT9/ypnlSh97Q+Q6DLFse\r\nfGr0SyWwy+Tp4G+HhIhEc+zw8qbLdiGuMxFFrC0RwHJORgo1VzbY7NnDWOWW\r\nYAfCgMfb6U44vpuwAsU+MglhygOi8Z+C7BS2zn4a/+bNH1A/Ge9Vf9b9+ZZW\r\nHmKN+HMqJEiBAxNXp6gFc9pisIEXo0juRKjQsNhqqxfbl183aXQvr3J2l+cZ\r\nZv3OtputnxpM803pRryI0SUT5OmqQpP6y5F0ySeU9sgsixB+hgy3+uAM/7s2\r\nOVM2MOz8WfMH3STB2hcv4SJzwn7HbcHkfxl0Tq/vs5oe5hk/8f7BZFTunjeR\r\n9nJKsMP9TgZmx7K38Jt3dfKkSmchgrJ5PPfBVIOKbH9VSzGaQI6qJJVM9bGW\r\n3Er5PGH43LG6lHxDLT+iGX143LI8DB0gDsrOEF00wYENSy7pb3vh2VcYymnR\r\nItzbT+h3hWGbV/aENSzcdB5VQ11kQo1DIgA=\r\n=fKzm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6a4dbcb0b4c7d96a85ebe59a5ff66d2469e177a0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.202823f54.0","@material/rtl":"15.0.0-canary.202823f54.0","@material/base":"15.0.0-canary.202823f54.0","@material/shape":"15.0.0-canary.202823f54.0","@material/theme":"15.0.0-canary.202823f54.0","@material/button":"15.0.0-canary.202823f54.0","@material/tokens":"15.0.0-canary.202823f54.0","@material/animation":"15.0.0-canary.202823f54.0","@material/elevation":"15.0.0-canary.202823f54.0","@material/typography":"15.0.0-canary.202823f54.0","@material/feature-targeting":"15.0.0-canary.202823f54.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.202823f54.0_1673473029150_0.029728730655868896","host":"s3://npm-registry-packages"}},"15.0.0-canary.199fe2a2a.0":{"name":"@material/tooltip","version":"15.0.0-canary.199fe2a2a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.199fe2a2a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"175c836995444e8c3b659fbda20bcc88bdd17582","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.199fe2a2a.0.tgz","fileCount":36,"integrity":"sha512-d3x86bTif8jDnNW0Ii4oWl/kUduSTNB+MQ118tBUHWn9pYImslwWwW2dAmSZwnsS3GJMKRAmpCgymI/pmr2gEQ==","signatures":[{"sig":"MEQCIHAOgAm7Z/YN/yZ9TDbTc29PWUi3NzF43BbUBDyhl8P6AiABpBO4w5sNjP/Ceg4LaTz+vpfqW/a1PY4Uqv37D3/YQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvzC3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMcRAAmmdGaMfbwYr9F/LhhjXfNpoSaCjd8F2AupBjy6hGUaQn42C2\r\n+HmEWE2v4XgsVaztFFkszjiqz6SI06+LHBVod46YdTJT69nMG8/YDQXAjKXT\r\n+dfPvqB6vEYSK20lcStjq/+tY3pWGNxRvBV6eA4v5AoK4F/G4nM+9v6TOZiJ\r\n4d7xa4eVcA/Nw+I4e7HRjzokxFDC4GGj4dT5n/PCFDKZdlOGiIElcjIP+xKb\r\nCmw9Mkrwi3R2fMLzeMJ2S+sm+F1Ui9Zgt0xVkTv2ktRGY46qyT+Pisx7AB1o\r\nS4qJtTTAf+drPAvTIGvqRrRPfZAh0QgB7GuB6YY/pMFvgeQchIpKWnUdQZTD\r\n7g3fNIqfUPK/LOII9NA78ACXF5HEB/InaBDfaROmMFQ3gW/1KbMM0wH8Lu2k\r\nV4L+gQDbtWlBcZ+JWTePN9SGAaHe+qqPVC/BPjlH/p278164bPTXl6XfSOxK\r\nJoZzanUHq9lH3aCvOckcxCFPvLG1GlaZpujEu8Nyb4oOJI6Bkl/coiqNpR1Y\r\nNHJMCFfiiYBmKTHQBvy/TqnnFQg7zEPzgOXqTx1uS4z9kaYfQUTcyvWMyHxe\r\nQJUTliqrS8ui+zjyANscrDcBAEhFGl6fgpsCSv2NM7MgP+Kqp/CPXvr65Ec1\r\nn3HSeyQrbADHDkyNd146mnyXE2ga5VkEbxA=\r\n=Z9QI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"eb39fefbc3ca102a52db83ad19b42f1a2b52ecd1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.1+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.1","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.199fe2a2a.0","@material/rtl":"15.0.0-canary.199fe2a2a.0","@material/base":"15.0.0-canary.199fe2a2a.0","@material/shape":"15.0.0-canary.199fe2a2a.0","@material/theme":"15.0.0-canary.199fe2a2a.0","@material/button":"15.0.0-canary.199fe2a2a.0","@material/tokens":"15.0.0-canary.199fe2a2a.0","@material/animation":"15.0.0-canary.199fe2a2a.0","@material/elevation":"15.0.0-canary.199fe2a2a.0","@material/typography":"15.0.0-canary.199fe2a2a.0","@material/feature-targeting":"15.0.0-canary.199fe2a2a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.199fe2a2a.0_1673474230992_0.12180588697930572","host":"s3://npm-registry-packages"}},"15.0.0-canary.8c0786d6f.0":{"name":"@material/tooltip","version":"15.0.0-canary.8c0786d6f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.8c0786d6f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"67028a85793a16c2efd8069d60c4b84bb66d5346","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.8c0786d6f.0.tgz","fileCount":36,"integrity":"sha512-4d4+XxKJVipzrauDTzWRW5zlQGcN9J1cAE8yIzeF80Ov6paf3mHVExCaxrvhGaG7mCJOCB4AQUfeB6tU85iyCw==","signatures":[{"sig":"MEYCIQD56zmeMAIYOO3Jmv51K3dTn/Gb0qWlMndjw0YaEkYIYwIhAMEqjLiQ0zPd0as4WjgJO+toysrQrCrT0hfSAZPXmR6e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwBtDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpU9g//YYZ0CDz/iE38RAnzVqgIqIm7wmYVMg4Md2IjStJnzPLTK7Bb\r\nkyZJP7WAwT0BDL1/kEanHoz1zxFIUZIFjLJdQ0diWPwa43Ix4iMvsBCMiod2\r\nvZpyWrFm5tuiNOFsnGEyVG0N2gX5Be2NaNNb6vYINNu5vxhm3wmTG61j0zg8\r\nPalhP0UTOeQ1VIflhCRzSbCkJPWWbbscUT9k/IdqgdzxsyN7eNXe0uVWu8hN\r\no3S1/7L/f1i75s/m6pa98apcSGpKKF9GElb2EXoTbjdbBaYoJy8vnpJEqfQt\r\nAUOBV7I4UASOPQ52K7Ce3WVeL5XmGkJBW++eUyslHaRwa72a8PM0AvmqmKJf\r\nYHRskG0l+wGqjxE0LvG5q1ot5KtrNWUc8rfoSDquFA5eVZsmkuL7zR/U6yHO\r\nNX7cPlvX2b89eCaM8LB6uN/dJdJ0nSrGUgQ4ut62uS3uKaLmlXzWXhgaVVBE\r\n1Ihdt3JFaabKkYsZbOEdBTsE0eNN5I44GV3mmqEOhE1LPRBi5mGhE9juPdHA\r\n0Pa/CmXz6/IuBaWXydDw5k9BXFCTy5zDCSkRGj6AXzdxm2y6HLJ4qMcsjId5\r\nvHHA0y0t/8Z67QLZyXfMk/5e2NGMZvmuryf60YsE7Q8P5zQDnsY4DEoTS7iK\r\n8B4aqrYYL87Z8YD4laxOU0eBDHR/wbUgG+g=\r\n=49dk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9016794346c3c3cab2cf31154ef6a35eb5598994","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.8c0786d6f.0","@material/rtl":"15.0.0-canary.8c0786d6f.0","@material/base":"15.0.0-canary.8c0786d6f.0","@material/shape":"15.0.0-canary.8c0786d6f.0","@material/theme":"15.0.0-canary.8c0786d6f.0","@material/button":"15.0.0-canary.8c0786d6f.0","@material/tokens":"15.0.0-canary.8c0786d6f.0","@material/animation":"15.0.0-canary.8c0786d6f.0","@material/elevation":"15.0.0-canary.8c0786d6f.0","@material/typography":"15.0.0-canary.8c0786d6f.0","@material/feature-targeting":"15.0.0-canary.8c0786d6f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.8c0786d6f.0_1673534275454_0.9099508615708709","host":"s3://npm-registry-packages"}},"15.0.0-canary.8a74f7c6d.0":{"name":"@material/tooltip","version":"15.0.0-canary.8a74f7c6d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.8a74f7c6d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b588fe93c733a45f36874141e14f5c318524b54e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.8a74f7c6d.0.tgz","fileCount":36,"integrity":"sha512-r9bjvKUEZfyA4hbUx1PNvO3Pc8vuTWujZ4QdBohSrzhSSkQ8IRjQ9qp/bgGMDZ+R2Elhy+Q4Ct9trjZGXN6+8w==","signatures":[{"sig":"MEUCIByfZjkuNZ0X8YCj5nM//Qm0zOET6q8RORBucOIpDW7oAiEAnuvGT5fRfsM1eP1VVokf/AQrhLrR8Vs8lgPQxMurXxA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxvZOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEIw//cYcERJHnVDR3zbaMJlGo2pJa+b3SCQ1550AEubqGxSa/G9mM\r\nPWddGr09HtGcd4qHSiHglwRB2QcjM2xqpix+/w1r/ZBWXt8ZH9K3zbU5PVci\r\n63OQ0PHKVq3aOlFl/qzECSg2PWR6/DbrPU64u+l8KX34gHmnL2xslRIDM/FS\r\nZSwPObW61quN1QjwDy2FIWh548rrqkPKQacyV/bIxUcbov9mhm3zxYwwHH/Z\r\nzRuvUG9hdD2JJap0Q5D90gkfzuJuaFRiuTiMlrh+s8hfgFElm49VbrFyNqTV\r\nSI+goBYGWWyuZZLIDAcT6yO1FzhdHuwwZopJ29oB5kOZ0+ir7iVqJBGzQ+a5\r\n6/rhuKmJ+LIj8VfEJg+nU2bP3MhYftqLkBf+YQENlYSe4TUSAwlg8Bl24yQj\r\n4/iLAKsG/RgZwANgcm845/2gXUCIC9FaPN9/PHB/04/yABakKqRCCCNwC7V2\r\npTIVxNYxSzmFvCY2S4Xoy0IFr7dxEwM8gVojrPDX1o+4F/zDd1No8/SxjwGK\r\ngp2TptzaCpgwhL40fcWYST093DMjIrQkVUc0GblczKMqKcFbOv2AN8N7saFf\r\nGoMURSuUlXpgs+KRZrWzAETgCHOOrCo9lcs2AeVaTkSmimHRCB7OwRWVoBUB\r\nBkekQjmYg2RTPtOXLNdTZJjRbMRT66M6u30=\r\n=8RAb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9c676a1e4329c32508a9e7110198a336dc704f58","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.8a74f7c6d.0","@material/rtl":"15.0.0-canary.8a74f7c6d.0","@material/base":"15.0.0-canary.8a74f7c6d.0","@material/shape":"15.0.0-canary.8a74f7c6d.0","@material/theme":"15.0.0-canary.8a74f7c6d.0","@material/button":"15.0.0-canary.8a74f7c6d.0","@material/tokens":"15.0.0-canary.8a74f7c6d.0","@material/animation":"15.0.0-canary.8a74f7c6d.0","@material/elevation":"15.0.0-canary.8a74f7c6d.0","@material/typography":"15.0.0-canary.8a74f7c6d.0","@material/feature-targeting":"15.0.0-canary.8a74f7c6d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.8a74f7c6d.0_1673983566169_0.24422606126407298","host":"s3://npm-registry-packages"}},"15.0.0-canary.b4687fdc1.0":{"name":"@material/tooltip","version":"15.0.0-canary.b4687fdc1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b4687fdc1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e487f8c9513a80db9308cf40be99460fee3262fc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b4687fdc1.0.tgz","fileCount":36,"integrity":"sha512-Ygq6k8PbFZLuaxnu9xPGw9BgGORz0BUp3cXhBqbri3+U+/q3debQaOZm67ESUwJx6LW/TawQQcYaW/Zbs1ssPw==","signatures":[{"sig":"MEYCIQCgUT7A5XIuzo2uFRVvujmwVO9M5M2doYNX5MYQYh8WkwIhAKWgf5hNqyRKk0JAZ7qeRIguIuOxTm3+B4yy+iU2Q6lU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyZ8sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpibRAAhNNYjEiCoPHI5aIfSx/4Nbjab82pnqJ9LMEYUdoCb5vLZrJz\r\nBHrE0M+M2ydrwsuyAthDP0kIZ1E5R+pxP7v8kWlMf4vOBFTUN7nCNZD25ijG\r\nm0TSxFN7YXhphxX1MLqVuiI8yLYVm0g/0GB6TY4B74EVKwf3CzoUFZ49aPaG\r\nkuylpQZuQQkWPhOfbQUiLrQvGM9pxntTl77fLJFBXEQtT7j6dwC4kZKai1Rc\r\nsNjnvsg4m8XNnSTub8IeJDSJgTVw+nQUCP42oFRIrj+0yNxUoRepxQf0ZtHE\r\nw+w+GdCFsgTnYwEKuwUrqnnxlpX4K/F5ZRN5vZ81DLj++I6lbCSmR7ADzjmg\r\n3stO9bxwWg8dgZK69/sKoLiT5lCYRf1ysu2UQxY8AoozhTMz5YNjp0b0Smm/\r\nqikp+QfeSQHrRr4ZTY/udmhcXJrXvDunX/qcQTKpvSmsNNx2A87EtX+G4y20\r\nBgbiMLpXa9ln1WbmF3u/UsFSnS7WoaHQ0DRTIsHhTND3BhH0nvO+beni4y0S\r\nUU7M1S7lEB6KTquY8CezbbObexVWXUbn/91oj9VuRgJVV9XxPn0NACKg1UYY\r\nUzkdkCJLTtjHeJWnlA1OrYMErQilyFqMCFXzF2hwYIwQhE1IMyfUjd//Q1cO\r\niye0yDrSfg+9EZpBK/R5cyGP+B8T6UY5x7Y=\r\n=UYgg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c9ec43c7d66a73ecf591f982a42a582e639a50b3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b4687fdc1.0","@material/rtl":"15.0.0-canary.b4687fdc1.0","@material/base":"15.0.0-canary.b4687fdc1.0","@material/shape":"15.0.0-canary.b4687fdc1.0","@material/theme":"15.0.0-canary.b4687fdc1.0","@material/button":"15.0.0-canary.b4687fdc1.0","@material/tokens":"15.0.0-canary.b4687fdc1.0","@material/animation":"15.0.0-canary.b4687fdc1.0","@material/elevation":"15.0.0-canary.b4687fdc1.0","@material/typography":"15.0.0-canary.b4687fdc1.0","@material/feature-targeting":"15.0.0-canary.b4687fdc1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b4687fdc1.0_1674157868103_0.44093540655917773","host":"s3://npm-registry-packages"}},"15.0.0-canary.b836b9892.0":{"name":"@material/tooltip","version":"15.0.0-canary.b836b9892.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b836b9892.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c852a9a4b9e714d13e19846445f764ca732549de","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b836b9892.0.tgz","fileCount":36,"integrity":"sha512-6P3CCT5qMGydSRXK+pH7q4B7MgHE98ALP+EeETh1pnTf/DTO52n7zlQLad68tXAQR1k/uwCIXSR4wxl551arWQ==","signatures":[{"sig":"MEQCIG9UuuBef5nd/tTdmVu4zyGmLlXt4mdwL7Yueq0Rl4x5AiAwpoAIJWr+rr6vvoL5TuLjT83tbi8JfxCJ3d9ixRUJag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0F5mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpg1Q//acMzZPDi3kwlIS9Y8bQ2B6X9++cOdk7uQ8jCIXckYvXLng5y\r\nx7swI7O3Wu7bOvyirubwGOzn3jIVTNISirX9WSTUsaJkq7X6IaSs69yN7B7D\r\nDYu/urSwX4D7a3fwn0E6hb3z6Ef7HEeyeKmqvBxMccySz2Ge4EX1Z9fDTFir\r\nUlc6R8qusCYgfz57IqZY9mipOLi77y5gcAUgyTfxlaUZvVnRBncb6KvqcClw\r\nu26mBP1qaKXHm/J8Wgm+HWXjk5beO0loNnvHa15Iiy4sIHlg/vJL77PkzRvh\r\nCvv2fRWjhYyDFy1Lc2JzxFHvZdWJ2jMWn7nyGUfzoPI9RtVdSz+lc3+7SATv\r\nsO4o0m+cqvb29F9LxUnv9hPqBFry7g+G9Et5ccXFXcq6/DBT12suymUnfhbp\r\ny7f12cnNhuVf6dfqOaBik9UeOSka3rTxigA3RgbgwkLsyRbvNwqicjIbDdV2\r\nWHxpnhy/NcXhHE1DpjAxUHjTPRMgYUBG34RKcHGhpGfmcReFx0VAtTQEjgTK\r\nZ/vDNofR2/uc5YFArXxWtlExOxjMXQHbiYDJslFzjRydTteyOq6CtRsYaJ1D\r\n2baBUCYqxHBPJgFM/TXvooAcYqv6CVR9QGKtKGckH12mg2renueXFM5jztj1\r\nPn6sWqDCOrmuRLO3d1bw7akD1ZnCpfvc2W8=\r\n=ECnQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3a9a0b2e64227ef1f8979cd5b82be3767b100551","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b836b9892.0","@material/rtl":"15.0.0-canary.b836b9892.0","@material/base":"15.0.0-canary.b836b9892.0","@material/shape":"15.0.0-canary.b836b9892.0","@material/theme":"15.0.0-canary.b836b9892.0","@material/button":"15.0.0-canary.b836b9892.0","@material/tokens":"15.0.0-canary.b836b9892.0","@material/animation":"15.0.0-canary.b836b9892.0","@material/elevation":"15.0.0-canary.b836b9892.0","@material/typography":"15.0.0-canary.b836b9892.0","@material/feature-targeting":"15.0.0-canary.b836b9892.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b836b9892.0_1674600038247_0.6969090119141286","host":"s3://npm-registry-packages"}},"15.0.0-canary.e8912fd37.0":{"name":"@material/tooltip","version":"15.0.0-canary.e8912fd37.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e8912fd37.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"39e585785a98478a5bbaa3dbb2daadef04c1a5a4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e8912fd37.0.tgz","fileCount":36,"integrity":"sha512-VZFaUeXWIEGjqi7A08L1FaMT34l0mMeXV9U08O24HJg2quMXhlsg7Hdz570GohZigjmOFaCs4tRSj+/eyDjcMg==","signatures":[{"sig":"MEQCIFV4fQe45SRGbKUl2M1WlYYxdqwI43rWhRPrfY1emN+UAiAueBQLQMoYgEY2JcLwOgwdDJWS+fJNLrtKkKE3l5fbMQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0sbyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJWg/8DXsxoZEQY/ZqEYSXfig9b1/NuF/iopbXkLkoLLGowc1jRg/l\r\nqpidTLda30DRm1pv0hs04ZX9tHosmct+Y5UzMpQhVfrH8b34QFZyDCi5MK/i\r\niynB10wtyT2niZYsLdPndeMItn4HP0Qo5P9s4VM7t6dXyYUCZPVZJYcGOFld\r\ngbpxC/d8onI3tnAm/FgoOQtkCnr/nZzLyE4+HA7USqcTGTBBgI2WrCuRXlyz\r\nBBx2ZRqfKigOj2VtST32Cv3rg3eLBI5cGiTHxB+wHgxM6HSqv3w+Q1UOsp4F\r\n6OJWxQZWYR96CgSToU3SVfF2wtIOCk7Jy/hgbZ2cHoBpiFRMAsaGr881o2Ax\r\n1o5Xxq1ng9UMNO6gIT813A1DE8I5+XXGtGT1API7zs+xbFaSAcX6qYf/ZeuB\r\n+0EGmFvn8aOLfePKCZcxy1X4mkOmc6DMP720Sne4X1U4kkfOTDDvalX+wE8E\r\ndhcjtqcNsa2myIHtFERY/G7vsri7dZam4ptw/LJSGW31zboqYEdXLjU4Vcqr\r\nA1POQWGVjmAqtCoNndfb8cLN3T4GQIioF+UmJIn7rTlEkb4/bZG1/pLUiNvC\r\nU6b96MJJCD6YS5qllX4HJnH0iZ5OU3d+DOLOXcjC1dJkgLnL1AAtiMV5K4dg\r\nP6Rmn4C8xlpeppA4+52hfBg81iKDzDMgfsY=\r\n=xYQg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"72b44fe55689bb591aeaddf242920ba73a6e5bb6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.e8912fd37.0","@material/rtl":"15.0.0-canary.e8912fd37.0","@material/base":"15.0.0-canary.e8912fd37.0","@material/shape":"15.0.0-canary.e8912fd37.0","@material/theme":"15.0.0-canary.e8912fd37.0","@material/button":"15.0.0-canary.e8912fd37.0","@material/tokens":"15.0.0-canary.e8912fd37.0","@material/animation":"15.0.0-canary.e8912fd37.0","@material/elevation":"15.0.0-canary.e8912fd37.0","@material/typography":"15.0.0-canary.e8912fd37.0","@material/feature-targeting":"15.0.0-canary.e8912fd37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e8912fd37.0_1674757874236_0.37140831378410977","host":"s3://npm-registry-packages"}},"15.0.0-canary.16fbd30ff.0":{"name":"@material/tooltip","version":"15.0.0-canary.16fbd30ff.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.16fbd30ff.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b62231993da92cd29c7e656be13b7cfdc1f574bc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.16fbd30ff.0.tgz","fileCount":36,"integrity":"sha512-f0zdM8psTUEDv6+nel6ZOXs0P04MhkZw6nZLyJI8MtfplctNsxXXPKX8agxBanIhCnrX1oZUQYI+K1hB0Xk2yA==","signatures":[{"sig":"MEUCIEQtwtIEwgnGFn31tr0/toF2oKaENQoRNseS/C8S+3IyAiEAlT1fVBBfXUveeth3Pt5uvrfQ5GrI1WWyoA2HbiW6Ynw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0sg4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphXhAAi+QO1N3/MRg1ac0rfoG6c4sJ7eHccCABsqhcKLNnDS2SmopN\r\nr7VBIsqYON18f8wJ/Ak5UkM/ZP0A1GKPS19Bhz4PhLts+sQgxE4Dxfed3R5b\r\n6ga5okLzKV5OmqgoGRpmHMYfvXlxvkse38Xvm6TJ7BbIpPsfCJolVkNGSsJ2\r\nYJkIXamNmaeAF94OJDw/gnx26lMGljfkXKNkHXwjasE2pNW3s2AU+C2U58gG\r\nsix65KN0yCT5QPTM7SYi6RUAtywx6tTHdd9b17HGhwx5WsnP69QPUXOi20Wo\r\nUh9lvEXG3OHXCcUUR/XTQeXu68T/e9hIJfKlsoECWBOSJ0+YaWJuLz6+d/Ni\r\nWUpViBJj2y+jTfnmMrFw7obJK64EftrBziABNAAcnt1Up8cUmsWnOjy8kS2t\r\nsVY5fQkFIGj81yRWvCJOoGTVcYuZSJUKtKGQvZSQ77hb1Y3s+K66XLrJI27T\r\nnTZFVIH1+/aACLyjYsj0V6Bplw60fU0Yr22OLCeULrRBn3s5Tvs1uVTXsABZ\r\n6i92ln+6mn1tq2HXGr+/ipea4Wnb6QyRTg6OLWp3Ce48HiRkv8hUy7ezMOu5\r\n/cV6F3shRZF08Cd+Haij7rBHqa4Wm0kdR24iL9VqgdAfPk1aj9p5xtTxoUyS\r\nc+hFTZFm3qhI43wMB1nwdnbSl1AXoJnZkb4=\r\n=eKe3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f4c39ff05bbd1045563670b4ea50b0be51a91d01","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.16fbd30ff.0","@material/rtl":"15.0.0-canary.16fbd30ff.0","@material/base":"15.0.0-canary.16fbd30ff.0","@material/shape":"15.0.0-canary.16fbd30ff.0","@material/theme":"15.0.0-canary.16fbd30ff.0","@material/button":"15.0.0-canary.16fbd30ff.0","@material/tokens":"15.0.0-canary.16fbd30ff.0","@material/animation":"15.0.0-canary.16fbd30ff.0","@material/elevation":"15.0.0-canary.16fbd30ff.0","@material/typography":"15.0.0-canary.16fbd30ff.0","@material/feature-targeting":"15.0.0-canary.16fbd30ff.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.16fbd30ff.0_1674758200630_0.3355819779716325","host":"s3://npm-registry-packages"}},"15.0.0-canary.033ae083a.0":{"name":"@material/tooltip","version":"15.0.0-canary.033ae083a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.033ae083a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"265b1e48027a132784398f737320c9fd8e146af1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.033ae083a.0.tgz","fileCount":36,"integrity":"sha512-+Ekpf3YDcS17k7B9HeE2LhffSV0AaBg84UgC+/07vR1NMJMGU3A9UaTVPwXTTL0Gfaw//hPEKoQeKN6WZiHxhA==","signatures":[{"sig":"MEYCIQDspypx4G98TYFVzYGI+ERO1xPn3V6X+vjUiGG1UTNG9QIhAI41egrcoBqgDbwoODQTWU63G/kCYaD10B3+HQgwAOoy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0tRZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9KQ//WVJg46Jk2XQ27rE/0eYZ8diFhOKQ6/bZBmnw+zPdAP04KmKO\r\nCyAZXly3tLkfXVJc8DHex8LwOfcm6z61XXh3/aGw6DaB/ygJfP8leUebMxf6\r\nqltQuDJpVInv4ICby4Wwb0SpjajYdaToYRCWTKBT6uGvOjldWyiMftQg0iZ+\r\nlNBKj+l6gt+JCsGjQp++gKEkirXrX9cKV1LEWK8Zb8hVtqtjJ2kcAtt2FDNo\r\nYzsmM3dTY3/3CYHSKnge4NcgaRj3JMGLBpJ2UHPCMffWOgEBw72kYd+gRsH3\r\nQvH13Lx+Y/xES/T14attXw0smVNoTkjx5MGD+gIgUwlTsiAAWSCXi4FjytU8\r\nZxlW+DhxL1MkjvNeNqfBwUPBxI3T37JnVXxDUe9ndWJKurTYBsW76muI5hPE\r\nG7DvijG4ti5Rl14TcQGNB6fmJHvr7RxeKe+ogcOnDjja0CyiqKqxZkPXU0eU\r\nRggVyaLyyiX8Of9oYT/I/JCfysOMsIvbpQ3tNUuP3rfmVtPyD20mSNdydgNE\r\ngh3yAlEzeACoAGqelW6lt0Z6OeKL/wiinPQDvQ+V5+joplGwue9pj96HmCSK\r\nmEORTXDOBk3SfuN0uHuT/Zk3JrlJ4oLGe6YEzrqp+w80TExVvQnHaF7XTl6R\r\nj1nyAwUkwr07sj1JCDwkmTInlPvojr0JJ/g=\r\n=UHw3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"89ca938c110806d9150a3889a7d25689661c2fdc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.033ae083a.0","@material/rtl":"15.0.0-canary.033ae083a.0","@material/base":"15.0.0-canary.033ae083a.0","@material/shape":"15.0.0-canary.033ae083a.0","@material/theme":"15.0.0-canary.033ae083a.0","@material/button":"15.0.0-canary.033ae083a.0","@material/tokens":"15.0.0-canary.033ae083a.0","@material/animation":"15.0.0-canary.033ae083a.0","@material/elevation":"15.0.0-canary.033ae083a.0","@material/typography":"15.0.0-canary.033ae083a.0","@material/feature-targeting":"15.0.0-canary.033ae083a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.033ae083a.0_1674761304672_0.8940181281613948","host":"s3://npm-registry-packages"}},"15.0.0-canary.3a705fa1d.0":{"name":"@material/tooltip","version":"15.0.0-canary.3a705fa1d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.3a705fa1d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d4dbf9177171bde6677ae2b5027acc47a1d20cb9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.3a705fa1d.0.tgz","fileCount":36,"integrity":"sha512-uC/+DvdgMAEOHIJDMEXw3r9r8O0AeqXC/7EbaYhoSN7AmkcEIzn0nnP0yf1uzwX5nwMsU9MBD4A4Eks4IogTTA==","signatures":[{"sig":"MEYCIQCRFcvA/xJwVbzG0Fei0q+SJlx/AoJ+Xx7IOunck6wkoAIhAIp3mCrqz6ZyRZhplh8uS9Gs75RKPMSdgcATrNE752s3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1FPmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHcxAAiRWwDkqjJDLkFTYTcW/9H2tcr5drHoZzH38X3DACSkfiswVZ\r\ngjzNFJ5ynRgXvl1zJMqIvLJLndGDIeV/wf0GJkJxUU9m5KKpx8csxD/ZXMkn\r\nleQpC9Nev8l1CetlRHNSsKn90Q67LvENK1qiC6VRrhMJWuTGlGJ/FLh13K9x\r\nqwZqWoPF0E4j7ZaGswVXdA71Pl1SnC/WM0Ocql4k9Ih1StyedLnN3abWLCm9\r\ndWqT5exNpjy+4T0HoIytrw3puS167e65QUVrk2w4nAJCLGv/ckLygWe2MeJH\r\nBrGONZ3tKQEr+ah8R6oXgvqY2hEkFK2GyvrWsibKp38Nz6BuyvDyG7Zqmmvp\r\nZJ13av9xj1l7HVSpO5v68k4hcmdZ+tyk8Yq31dcOStQlLCTELjz2NtLKfamc\r\njIUnumlkz9cVkq97CDbslieis2fRSpE9IML8Gs7zsKge96iypP82z5sose/o\r\n9JGDOIbqbCGBbMxLj1C3o+lynaMJWEuUbAg2P9x3PikwRr28Pz5YUI+cjB9E\r\nTevYB55/7bDGqSZjhRT9clh9f6nLI1OlsxrCjFfM8/3G0Xk8/WcrXHQPs9pJ\r\neuEhWRWwgF+423an8RGUKf6yRO+Ogyb2BOa68HRn3e5QXMpmh7XlLY0IK7ra\r\ng9h045Wg5GR4xZ8gt0z1myVn+MhyiBlXH00=\r\n=hLZn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7e0f3737f51c1319f66762d8021d6aea33391733","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.3a705fa1d.0","@material/rtl":"15.0.0-canary.3a705fa1d.0","@material/base":"15.0.0-canary.3a705fa1d.0","@material/shape":"15.0.0-canary.3a705fa1d.0","@material/theme":"15.0.0-canary.3a705fa1d.0","@material/button":"15.0.0-canary.3a705fa1d.0","@material/tokens":"15.0.0-canary.3a705fa1d.0","@material/animation":"15.0.0-canary.3a705fa1d.0","@material/elevation":"15.0.0-canary.3a705fa1d.0","@material/typography":"15.0.0-canary.3a705fa1d.0","@material/feature-targeting":"15.0.0-canary.3a705fa1d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.3a705fa1d.0_1674859494676_0.680834731446605","host":"s3://npm-registry-packages"}},"15.0.0-canary.d6bea2ff2.0":{"name":"@material/tooltip","version":"15.0.0-canary.d6bea2ff2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d6bea2ff2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ddb165f0711fbafd0dd2d9af12ac7bf820944009","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d6bea2ff2.0.tgz","fileCount":36,"integrity":"sha512-+d1568ZnbWyU/UyNkx+hYi0F68HsF7gSAz1DetcqWKZ+LzUdLF3By9/pQowQGVDsX5R9XMqjHd+RzHquyLjRig==","signatures":[{"sig":"MEQCIAiWkHxMRZzkU1jB8zLS1qlEqya7E0WMvOR/SHfDIKTmAiBx13gAihD316uiEeLqCGN1uHpel3kS8oIyd9N6xNLmVg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2TRSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGMRAAgnzye3P8PRHdQ/0hTjbINpJiIzUJL2iXBzlsrWU19NcvtRyu\r\nBzHUtSugtb6+5/IAGjwUarbkV4WHu02krOlGnyKBlpQw+Z5QA/Tk4u0RWXXn\r\nYmWH8h8H3nDU+IfyDN1OZxJa5GnfGQZi3/f4soUMP3RnJdWf9YBFtqGNk4aG\r\ntmAsEOCP0lAJmVvbPXuNSiYsUYx9DtCgLWsNanSuzzH6a1RV9TFMy9L9VduJ\r\nUXvUXch779ZXaWcASr7j2IL+PSo/r3GtvO/KXQ9HLMCgBgJ8potJWYRsf5SR\r\nqrv3/Dg8fmptmaZb2cXeAzdXczFtaXeGrfElgLwklZFTXj4ugk6Kn1YZ+UaP\r\nGLtvkxdM7O6HcvuJMPd+5zLr2QGZph0cTqQxRC347v/kDovX7f/6VlWYltA8\r\n42sBpppEn5sATq6hUxqtkHUS+Bbk78nCHhPX/goJKxFu7WO2XR84EUDCj8VX\r\n1j9M/u45zmv1X8DR+ulMxFdUmRsSY9QqSUmxa26C7b8gD3y3/vL6MNquNjPq\r\nqEoEtluo1/PO36Tkmlwx+CbSF6fk0YFKj+paCw86Qr9sDymPnsKxkJvS5fhV\r\nTTwoTMrvasBmLUuDPQmyiQNyAf99KKT8U877GtSG3Rwvv8KwvFXu4iBlb0V+\r\nRfe6EpztyHH3vz6uG5BV3zDmP5zvf/eNUyg=\r\n=kGI2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e4210a9f21a7e6ee007d475d5bd7e229dd7bbc00","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d6bea2ff2.0","@material/rtl":"15.0.0-canary.d6bea2ff2.0","@material/base":"15.0.0-canary.d6bea2ff2.0","@material/shape":"15.0.0-canary.d6bea2ff2.0","@material/theme":"15.0.0-canary.d6bea2ff2.0","@material/button":"15.0.0-canary.d6bea2ff2.0","@material/tokens":"15.0.0-canary.d6bea2ff2.0","@material/animation":"15.0.0-canary.d6bea2ff2.0","@material/elevation":"15.0.0-canary.d6bea2ff2.0","@material/typography":"15.0.0-canary.d6bea2ff2.0","@material/feature-targeting":"15.0.0-canary.d6bea2ff2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d6bea2ff2.0_1675179089743_0.11325653768537225","host":"s3://npm-registry-packages"}},"15.0.0-canary.0c94182c8.0":{"name":"@material/tooltip","version":"15.0.0-canary.0c94182c8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0c94182c8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"939175c76fc56e32be281bf1cd1b3cd9f25e8a88","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0c94182c8.0.tgz","fileCount":36,"integrity":"sha512-iIeOcQc0gRuhcLw/vKr63QKp0OSHCgNqagg0gmXJ2H77XO9FIb2ZFFppPkHyEx3+Vy9sflsmAV7/keMUOvhzqg==","signatures":[{"sig":"MEUCIQDXqoL6rmJBvwUki5LA+6keF72/8JcN0wlWiEnhJPCt2QIgBJwgzxWop1s40K5tkvii8cdTSOhIq/vd/eMU5Jc5MNM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2qVFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTphAAk23BMN1FAKqe7CSmgN2ujx2JWp1Z6bDAJlxCl6u5iA6S5WfJ\r\nsQG/PXtuUIwaBcEMeRIUMhlqI4ugiC2KeTDnQow66j+Wcrpid1MnBtFLXZ+k\r\n57h5fyTPZsx/ZsfcPYJZOW3rqZGPFBQ9Y5v7f5ZRQCm/zYZ1giAV4BtExJVD\r\n+WWWnmXK+GRofWHZWoUB2snb48QMu3aYqz+owvt+LRU8GZgPl685hMLVYe7l\r\n0CFDQ3sZzfWBgOj0DxvKg7Y/q2u6tR76rHzzcWYCQClO+J6O4ay8ald9gIQO\r\nBsBB5QPWyqrpPdQjVzcb/jCYdpNWt/YL/5dorQXpWg9IyL5igPfQ0T8+/dYn\r\nFUTGl/zqGqved3fS+b/w2hY4CX6OoyjCQQsgeEPdtN61VNiaPhVCQ4iYQGIS\r\n82DBp8PcP3OGLucTov9OS2k6w2WZxwvTXQdiBdLv/UtDMZY9Ncivcrox5D7g\r\nqRH3rifSkHfMfoKKaw0QcIemoqBq+JwBCJ9KxpRT/fHF3VszgK0oACFhVRsr\r\nwVoGT4+ZeNwzTdPdfdAffG7w9H2C3GrHgBuPwVlHi7sebeybYk6ZF8flr58Y\r\nzGrA9YMgSAt2OLTBdqCXTqZwOJarkXGxftF1donK5heU/fCWC/ChyagJljWv\r\nJVv/zqh7pFK1kbqK1v7/YzMTXiu0u6yKnXo=\r\n=kRqL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9e58d1edf6370fb6c26f762d83ca31f928149e41","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.0c94182c8.0","@material/rtl":"15.0.0-canary.0c94182c8.0","@material/base":"15.0.0-canary.0c94182c8.0","@material/shape":"15.0.0-canary.0c94182c8.0","@material/theme":"15.0.0-canary.0c94182c8.0","@material/button":"15.0.0-canary.0c94182c8.0","@material/tokens":"15.0.0-canary.0c94182c8.0","@material/animation":"15.0.0-canary.0c94182c8.0","@material/elevation":"15.0.0-canary.0c94182c8.0","@material/typography":"15.0.0-canary.0c94182c8.0","@material/feature-targeting":"15.0.0-canary.0c94182c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0c94182c8.0_1675273541123_0.14604501396838088","host":"s3://npm-registry-packages"}},"15.0.0-canary.15b221540.0":{"name":"@material/tooltip","version":"15.0.0-canary.15b221540.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.15b221540.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9982fe5e2b8641a0be85fef0d3a14ab548a0bc1b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.15b221540.0.tgz","fileCount":36,"integrity":"sha512-XncNGb4tZKh0vxEo6Eua3rQZV8V4Rp2KZRH1zt/4LobWgZg6vfWPFfAA0xOb3SQoHbK1kQYInMhITKzYzOsWLw==","signatures":[{"sig":"MEUCIH4anW7giyNzEHIjYVyo7WknOlR33tBMBaQX/VI9bJTwAiEAuMVCK7upCgqyY1fLV2EPTwmbvEPY+9pkS3P3NkdMQU8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2qc9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojDRAAilsTlwpueQSExxDKAM33EiASa6f88o2WIk1k4qPWDZwT3Ec1\r\nOv5HUR/xW34RU5gDrB6I+V+KkiwtdSDnM4NsuJptF9A3nqTo3PT3+cheTsgr\r\nPXqeqBHygHgw1r6KtfHn0ExeQ65TGLrsCKdsHhvL3v6Uv9gpVdTJf6UkLQep\r\nhF8PihXjdZYItTKrsfRiN/+PDDs81e+lvgGu/FzK8Kzk6LgbQe+DXE/FErDt\r\nKgSAYH24QnGN1Zm8PcxWgBex4jcB6f7m2a/G99UzmGJxTKrGKfszh+vX9Uhi\r\n7no+7aTjvGJ2Zd2+gVLIy/cHxBy/VvQcCPwHdTyL74CCxo+p9BS0U2jgjtFz\r\nvmRAjDcX5FtiXTlaGGudYRV9/hELcVZyuiNUEN/1Yw6ZMrKzE7zQ5wNl9Ctm\r\nmhj6Jog/uEF5tMwE7h3dw99qb90HZHAIGBw0URzubJb9EnSnb+g033DFxyfu\r\nyAL2Y1RStyGdykdy86Jd11mzvJTmGSeppPtweHndlCeVRhFSlf0EALZegOSw\r\nxNDaP9G9meACNU5CuBoMJMZNpP+RbO2RqxsYntmHFlmlEIwjYZVq5d6kqluW\r\n+ijbWZXMeQWKQ/gMIkBFHP55kkSq5sUgX76BcfDiphKROeM+Az7jhy/hC5JY\r\nkxoEURU6G5kEOCFE5CwyuDWX7y6rJKhydgY=\r\n=1Dci\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a4bc6d32435d33a7b99197f32b85eb0b730acd30","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.15b221540.0","@material/rtl":"15.0.0-canary.15b221540.0","@material/base":"15.0.0-canary.15b221540.0","@material/shape":"15.0.0-canary.15b221540.0","@material/theme":"15.0.0-canary.15b221540.0","@material/button":"15.0.0-canary.15b221540.0","@material/tokens":"15.0.0-canary.15b221540.0","@material/animation":"15.0.0-canary.15b221540.0","@material/elevation":"15.0.0-canary.15b221540.0","@material/typography":"15.0.0-canary.15b221540.0","@material/feature-targeting":"15.0.0-canary.15b221540.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.15b221540.0_1675274044843_0.3433926406208505","host":"s3://npm-registry-packages"}},"15.0.0-canary.6a4b3f834.0":{"name":"@material/tooltip","version":"15.0.0-canary.6a4b3f834.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6a4b3f834.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"feb19ea58f0e6e4adf64bc8b292d6551370236f0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6a4b3f834.0.tgz","fileCount":36,"integrity":"sha512-6P/BCmm+ce1rfa3bYyYKOzzK7uBZK/hfZ15MuK106Xr6GMW+4JvlKIINZeIDs1m48LFuU5cFICP4cBtGLI5L6A==","signatures":[{"sig":"MEYCIQCY6l/To4hJEXU+Up2ZWl8CHsDd4ccjMznXvuFY7f7JdAIhAKcG5gE+nfZe4iL9j3ZkMcoXoPAs7q12QR5gZhSFRO2E","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2raqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpAIQ/8Cl25M0pM27a7n2LPMZnZO+v7nLoawScQHHEPZcb7cFlp3vab\r\nTkFhTbN95ts/9o2abXXMBkKnc1mcC3SnUK44gtfhclBKPMknGqCRX2uwyUTE\r\n+rYdthGOlrAbtBS8wUoCsKLF6OlG24gHDME8W/C5I2cmJYzcdCKsUVqvSR1a\r\nQ9LxDsfHDg8oFXSDqvYWWxrPcIK7gvyJaWc/KxoJXre3DW1Ji+GTfuyYYcSa\r\nPB1LD76TG1nqR9fEJj62bkT7djdqCXFk6tgMqoETasEyFC/6YuTkxdQlHPBo\r\nfGQCgEJLL89MmSmULvQaI0k3Rws4ZtxNEXl75iqA6b1o/8jp0fmCj1n3y00e\r\neqYZ271KtZGANL0boVYF3hadyYG13h/s2TjZc4IKIde9lT9q+a+miGMYMmW5\r\nFeGycRMuNLB6QCYdzZZW4Pp1U6d7O4Z8qOlX5qhpLsP49i6w1Tnnoz6molw0\r\ng/HppPapHE89+lZMfTukMvbBmp2862A+zoz0trj3+te6qX3Q0vsueWzXdKhJ\r\neoh+ICKdhqECVi5KO6GKSYL8NohaLxTkbWGj8OyPsVSxXFDHLiO4nds6ipw9\r\nthiQtZeeEAc1hXy5T76WW4TiDRBY9D8ILuSzFsRwL0hUEm72bvAugmUxy5/7\r\n6qdRL/2zzOhq/NH/dIJh5Lv9vLhR5LY2Svo=\r\n=BvMU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b1f2d06637869496d98898f4cdf709ebbd279ed4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6a4b3f834.0","@material/rtl":"15.0.0-canary.6a4b3f834.0","@material/base":"15.0.0-canary.6a4b3f834.0","@material/shape":"15.0.0-canary.6a4b3f834.0","@material/theme":"15.0.0-canary.6a4b3f834.0","@material/button":"15.0.0-canary.6a4b3f834.0","@material/tokens":"15.0.0-canary.6a4b3f834.0","@material/animation":"15.0.0-canary.6a4b3f834.0","@material/elevation":"15.0.0-canary.6a4b3f834.0","@material/typography":"15.0.0-canary.6a4b3f834.0","@material/feature-targeting":"15.0.0-canary.6a4b3f834.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6a4b3f834.0_1675277993793_0.931361358806825","host":"s3://npm-registry-packages"}},"15.0.0-canary.b177b40e2.0":{"name":"@material/tooltip","version":"15.0.0-canary.b177b40e2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b177b40e2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"604cd8102ef2c37c7adc130363531eafa84c9a9b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b177b40e2.0.tgz","fileCount":36,"integrity":"sha512-1MhXLfu+l5oY6Om5PuwpZ5W0RdLrJCukT4uL5Si6fc99SaboCcNITkuvRGkV17UwwX++50xurkjqOXwaakonUw==","signatures":[{"sig":"MEQCIGQOzYyRYtsUdo72XmBhSZ50itxbZCBiywnq7nzsU04KAiBrdqkeKqGn9H2pXaKNvDyw8wNQfGWycic8s/eJx8FQYA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2y+OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoU1w//bIBj+PsRwfImX1VOyHHL7ETGXcrB4g1/jK9RJnoPgaWucSsP\r\nYhcWSFL7T487kResFKeBQu5UfHPR3WnxErvrzkQwbywRnpUOxEKQRXGDZmzB\r\n11xHOoYCb61dQbeTvXac2hJU6Xzm0BKoSIdDL5o+FknHHFIxfNGRYyTz1ZcE\r\nL9MfDU1kR26Ig9I+qelUBqKMbjTdnYnYLJif9uLksAO7400hB3Yot3p8COn6\r\nHBWVxg3gFj55zrGTbwZ/3uYB3xMgTu8cPmQrRELQw/eap1zQXbKb9ol4XxYL\r\nHiUPM8QaMNVkW8xUulyxyi8qJUT0RJns5EKERcWfMNQJLJi7pgD9/yFUavg6\r\nqwpnDweCwXVuwwgMpa2wKl3wAvTY0Ds6u37yW+khqNvX/vyBgEbTezqlHvLC\r\nhEPoNJqiPedYTEzPs02rcyFQKofEm2Qk6briAobpMdjRu267BN0BY6Dh0v6R\r\nkZ+1VuqqUpQdT7xKHTAIoherZjpyDJfJAH99vgBzMOmDCXrWHKhZK+WlYU0W\r\n87csazQFgKDmlsD4kjdFM2TNpZ8x6ThPOBGkO7Z+AuT3ew1ZCHudIlUqrP45\r\nDrEvopPgcOxqWEOU+c0aYmDrV2F8EO/lKJK8/+PgJu0rem1FK1sZexulD1yT\r\ns8fwzrWlJKVb8z9tWAW2g2Z82/yYLHiK8GY=\r\n=jx3P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e3b49a7dc72f9c88710ba68c63d4ddce56a58fe7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b177b40e2.0","@material/rtl":"15.0.0-canary.b177b40e2.0","@material/base":"15.0.0-canary.b177b40e2.0","@material/shape":"15.0.0-canary.b177b40e2.0","@material/theme":"15.0.0-canary.b177b40e2.0","@material/button":"15.0.0-canary.b177b40e2.0","@material/tokens":"15.0.0-canary.b177b40e2.0","@material/animation":"15.0.0-canary.b177b40e2.0","@material/elevation":"15.0.0-canary.b177b40e2.0","@material/typography":"15.0.0-canary.b177b40e2.0","@material/feature-targeting":"15.0.0-canary.b177b40e2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b177b40e2.0_1675308941808_0.9761544278324632","host":"s3://npm-registry-packages"}},"15.0.0-canary.d9f821042.0":{"name":"@material/tooltip","version":"15.0.0-canary.d9f821042.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d9f821042.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ae7c0ad45131155bd671d36699ef65118d4e033","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d9f821042.0.tgz","fileCount":36,"integrity":"sha512-WUA3us7R3woPizZXqVrWrh8zKhjoQXNLGwrhzUplo52eRt9V5YH47tGIgefYUDaqcpEvr1lPaHEp6mUfKZhSwQ==","signatures":[{"sig":"MEYCIQD0pty9P8pC1wsh1H7+M9Cxcu45lzc8frQKtMcLfdlQ3AIhAIuhhkBvofTSNLSb0a4391hggQzqrbQDWEkeH0F4c1Fr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2/VlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonaQ//Uq7pnIeJJLF6rtLc0vvIpGILgJV61pnTxxojkF6BS5gy8mUq\r\nGyJMH6l+HG1Uu6AdbV42R7AfqCg/wPbO7b/5b4kxOrwHKhGpNcQNPJTpFo57\r\nvD/md2XMUlhV0CiUpIx3fUr+gdIvtfA3TUrEjXrOvj8EUcfngIGVIhZxB6wO\r\nVxzr7kkJSsHzQZ2c/fzyAKgligZKeCdtqekeIlWJJHofLoDDk7jisb+vpwDS\r\npxQsO/yRshoSpEn/DlCmbRKxIGznk/BVSjVZt88jQA10Oc3b79NCBswhzd7Y\r\n2YrdANxdbmTsHakFzZYyeRy58S7OnXgrYfIrcmbDkyELvGECpVJ/Ehuc3yyl\r\nyG2pMfIEEfxI/Kegj4bdesQbTHXqsRN0NbegsY4wuv7UJxRUnRq1wyp8nIWY\r\n7H0CfnSOthoCXcGSiIASJ3vk77ZGD0nKJ8bF+6uyd//99QZOSDeolKAI0vMF\r\nnVv0rdiPpbBOm5fX356R3f+ltmEtQiYdmxK+VMVtuIRGsCDLWoJufIEUoI6s\r\ngfa8bMRAsBsgCLhDtidaPNWremNfUJFdfXv9b8hPsc9ZR6+Fjoq5gRuUhQSR\r\ntz50m/OHkBQuH6M1GmBCgfYqBVW830Srve87jJu3oehe/PMZdWXuZIAGbJvp\r\nOOcsI11Y+6vuqYAsHThyXta2ECn37OSxDnc=\r\n=rpDC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9748fa2e1dd5886715f422f644830717544192ec","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d9f821042.0","@material/rtl":"15.0.0-canary.d9f821042.0","@material/base":"15.0.0-canary.d9f821042.0","@material/shape":"15.0.0-canary.d9f821042.0","@material/theme":"15.0.0-canary.d9f821042.0","@material/button":"15.0.0-canary.d9f821042.0","@material/tokens":"15.0.0-canary.d9f821042.0","@material/animation":"15.0.0-canary.d9f821042.0","@material/elevation":"15.0.0-canary.d9f821042.0","@material/typography":"15.0.0-canary.d9f821042.0","@material/feature-targeting":"15.0.0-canary.d9f821042.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d9f821042.0_1675359588762_0.009663519985726232","host":"s3://npm-registry-packages"}},"15.0.0-canary.47c7deb19.0":{"name":"@material/tooltip","version":"15.0.0-canary.47c7deb19.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.47c7deb19.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d094f5ad328007bbdfdd9cf3613baeeb25e02e51","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.47c7deb19.0.tgz","fileCount":36,"integrity":"sha512-pNuPZBCHcgJdtiImG/duFit7o9Kd3Tw3499khjbkubvPkyNczZVIaf/Y7/s+C8HzDzNsl6xyDYh+edSKTlGy+Q==","signatures":[{"sig":"MEQCIBZTlOdm/apoGLmp4VKbOMA8fSQzvoTZvp5T7wGEaBLhAiANwKNJPLv3jOgRU7JOEf3H3UgeLh5q48JHc/DdR1Wccw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3M98ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGrA//RhPD17L8zolMNuCA60Lq0wt+BsQnn2ymfjRVR9Hgx3BdEu/w\r\n05RZwjQsS0CxC68ai/oeGBU6jF4nPpQ6VxmGujCC6PQwePr1PAFRwqLyYCbu\r\nJYyoRCpFQdZWt2bvdryyDfbxDz2547UpDZRle6WgFaUDJO5sJV4DkYLhdPL1\r\n2PUjEx9KJKIsJFia1RKQ9/QnwE78OBFur1pLpUOJ5Ctvcc3gamBlVRbq65Kk\r\n15QlAYbAtqYEUtry58OgPms9Rgvxr/IxwHvCnPhvXdn8eCJ8Yp1DCb48U/KX\r\nT9pbQtC0CRq9xFkDOa6LD0SWMQuRaJCI+Q+7WGeFt/QOpRaDMw9zLaOKy35T\r\nC8b9nliu+YVLSS47pSc17Gx1YQMrbgwdDpphqF8IeGzQNkmUzJAANo5WOZ/h\r\nOQMuHurz7vg6b5pM7UWKQfna+QGwcE40d2z7+G+6fFAsJZyBrOYHx7kVpG1E\r\nDmaguGjZsNNAhRf3WoQ4QixfQ/N5qht4VKvFb/JYbYlPBcib1TH0QmajigUE\r\npEwT8pL6JF3bEz7qhVteeDkI68G/fm+7ZDvm0683sHHLBbKq9ohGmDAqk7lw\r\nMQQpbEG0+bjoSc2+9OZEu8d5bR1ni/zF7yRf6/ObAZicuFYXjVx60h/en+KR\r\n6GK2up5e19ZNvlsl2SaqycOVZvQ8waiH8Hw=\r\n=CHv/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d5a6886a0dce343fed87311107975111f62309bb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.47c7deb19.0","@material/rtl":"15.0.0-canary.47c7deb19.0","@material/base":"15.0.0-canary.47c7deb19.0","@material/shape":"15.0.0-canary.47c7deb19.0","@material/theme":"15.0.0-canary.47c7deb19.0","@material/button":"15.0.0-canary.47c7deb19.0","@material/tokens":"15.0.0-canary.47c7deb19.0","@material/animation":"15.0.0-canary.47c7deb19.0","@material/elevation":"15.0.0-canary.47c7deb19.0","@material/typography":"15.0.0-canary.47c7deb19.0","@material/feature-targeting":"15.0.0-canary.47c7deb19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.47c7deb19.0_1675415419874_0.44148404878599345","host":"s3://npm-registry-packages"}},"15.0.0-canary.a16dbd1a6.0":{"name":"@material/tooltip","version":"15.0.0-canary.a16dbd1a6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a16dbd1a6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"98e141fdf55de0e1340705d95dd48d591f2d4781","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a16dbd1a6.0.tgz","fileCount":36,"integrity":"sha512-RsLXtbt0o5SANlrd/gI1uxB6/5en+Shb9/FOX0JsTSdjEOeGJZBNOSTcvZU9AvurSIrBaVZgBNRYy/lTYvSMnQ==","signatures":[{"sig":"MEUCICR2NSnOjaf8uSsXuCrYBKFlvqdAfPjagDlAAyTjMMRRAiEA4CVz3nqKCs0IW5T5OrSctAg8LIEROa/omx7YPTVb/Lk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3fgbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqt7Q/9EZwLtEUa6NLFJ4sMMkl0yXIK3DkMw9auHOFn+oIYUQudOuEX\r\n8DpciWtqbPWmxznAsiZrk30Q62B0xLeTjnG8W0E7KueEWcWZtpxsUJP5zA3J\r\neRJhie4VyGzoSOsG70ECJFktXou1ge92t5HcVOSaBvDo+O1rCcxuP6JvBQLv\r\nLyqDFdJQ+Ve/uwOrkm/iGcR4cHNjdz7Y/AguGm7Ir2JztTxwP/2hxrSnQdLj\r\n77nWyAbUxrc2YduFJw04A2JhjkFsCEl83JLMVUWR8jvdza0gTsVhW1WA/ldZ\r\nIJIy9i0rPsSXuBu2s9R1EXgrzMi92my6SVA19EyJDoCaLjtiKA+6ihXo1C3G\r\nXERerLP/KHWCMg9zr8zndbmMoMGmwmkGCvFF2ZHQDT4lf1dbgZI6NXeEZdlG\r\nm579ydeLSkOrcJE6mhqerkBzrJRdE0uD5OOJEPfPYgo3xE72KUKFsoHTzWLR\r\nZW3KvKVJQxJeY6I9ESXCNEgj0N7DVw6Wy1I9eDzFxo1kmgYMziE9x1xLN5CS\r\n1xu7/0g43X/wuXKoKw3TBOll732JBAjDn8FfOaTgGxgEksQJgeMygYda7Do3\r\nhyZivC0v4bVlKt4oO1V5ni1B9lZfobAZabnIlBp5a9hT7Ktq5FKdCbYuc3gL\r\nbnbLVaMVECTF+YqsW8vnuZvh6LXiS5YNbaY=\r\n=nM32\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6b1923aa24f460ae50c61296787e46f524bcf15c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a16dbd1a6.0","@material/rtl":"15.0.0-canary.a16dbd1a6.0","@material/base":"15.0.0-canary.a16dbd1a6.0","@material/shape":"15.0.0-canary.a16dbd1a6.0","@material/theme":"15.0.0-canary.a16dbd1a6.0","@material/button":"15.0.0-canary.a16dbd1a6.0","@material/tokens":"15.0.0-canary.a16dbd1a6.0","@material/animation":"15.0.0-canary.a16dbd1a6.0","@material/elevation":"15.0.0-canary.a16dbd1a6.0","@material/typography":"15.0.0-canary.a16dbd1a6.0","@material/feature-targeting":"15.0.0-canary.a16dbd1a6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a16dbd1a6.0_1675491354798_0.8448417057663467","host":"s3://npm-registry-packages"}},"15.0.0-canary.93416f87a.0":{"name":"@material/tooltip","version":"15.0.0-canary.93416f87a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.93416f87a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eec3ed14722213b8955d6e672c34d2703f3e22e6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.93416f87a.0.tgz","fileCount":36,"integrity":"sha512-Z6bbaDTysgnfaTKAVNJslBNToN5TsHcVlY1/iDGrFbOMe8m4kROpJTEctIaetXUcH9VQx35vv1sBKCBhjheh1w==","signatures":[{"sig":"MEYCIQC7NOHolEWIl8TRIAAJErvLB26y4VTgNJr66b88dOV+aQIhAKjx11BzsooF4hcRGTWvqn6PdcessaChbcfXxG+dsMgU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4lFqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGXA//RW7uoo3hTMtr9Pos6lRnX0FVYUmtPw9IZEZmB3rncIyT45kQ\r\nPBGqkMJkrilbMCICeKZfgBRMYG7j4DeivCn/jRzJ5KpwFJdwRjT1uhJOhGK6\r\nhZkdlOb7xmDKh4yoW4riaN7RMhWMG7rPFWpXO5d+kK6IjA8M/6/fSND/jFnl\r\njv3pYybaeSBBHUb4B2ZGagxhvi48Fi+ZmhKEzQhqZWm6Om89yjH/wyMXB8x8\r\n6BjBbLgAtQCMknOrYy0AaH5PR490uFsLcwh3U/eB6B3O7nzVrPYUvjKujJbO\r\nnV4Avt41jiiIDn9wsyR17pDJWedLNZ9g+My/hYa8e9lK0+O/2+VDxof952k+\r\nGBmNaAtDMIZqMG15QkgrtjHu7cot3NLCiv0/qTarpH/PJgTdGtDi2MFvCIGX\r\nIFH2PZ7k907Q6YQ0Q/DcKFOJ0rOL3qztySHwy0rkWYXay2PKc9W04Gg8+acy\r\nbEWPNIFmDBsuX85YjXTnk2MgxznFBsSdjfIBiNl/EM0qqmsU1ENXWRvIA6CK\r\nt6PZ0EVd9xZSdXPVijWM6M9AJAT9MF1WGQ5/qA8IBVjXVTCeTHJibTjqLlVf\r\nuD55bj708V2k1oY/kb+W6JmiOj3yY2/mm43JIHcEQpL2mBeu5VKcOuiM/bOg\r\ny9wdCis8MOLHgwyCTeQ/qKYokga5i+AfqwU=\r\n=+dTV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b9f82375a462288f01ce4e4efe6047a3fdd9f9a9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.93416f87a.0","@material/rtl":"15.0.0-canary.93416f87a.0","@material/base":"15.0.0-canary.93416f87a.0","@material/shape":"15.0.0-canary.93416f87a.0","@material/theme":"15.0.0-canary.93416f87a.0","@material/button":"15.0.0-canary.93416f87a.0","@material/tokens":"15.0.0-canary.93416f87a.0","@material/animation":"15.0.0-canary.93416f87a.0","@material/elevation":"15.0.0-canary.93416f87a.0","@material/typography":"15.0.0-canary.93416f87a.0","@material/feature-targeting":"15.0.0-canary.93416f87a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.93416f87a.0_1675776361745_0.6604241748743465","host":"s3://npm-registry-packages"}},"15.0.0-canary.49b8e7442.0":{"name":"@material/tooltip","version":"15.0.0-canary.49b8e7442.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.49b8e7442.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a9944b60f84bf047a4ab9f14e1e1e6e1a80343fa","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.49b8e7442.0.tgz","fileCount":36,"integrity":"sha512-s8KG6X/a6FS+N8E+j1ms1MSUilateYz0rwUd0EBJMAMJtRRdl09wK+GZvh0lKi3A1SaTY6ym5hJK0B9dKJJpoA==","signatures":[{"sig":"MEQCID4AdI4dtOgY9W36Otay/jrR3Q7KdQmYJOzTgRw3A+zJAiAqwELAfWyWvzd6t+ANANTXkw2xiBUttyo3HPJc4572EA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4tqEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgZQ/9EXs9N5ZbhdQ5ETmJ3gDMURRpLKupeJUNP2AMDcgOljDXs3Fr\r\nxMWMYJX0sJIDHU6SR1vwCAmiuzmAOx3n5eXKN7sjtCqyHXtP1UNUBMzcMloZ\r\ngIB2rI//6Q1y7lPLViJooN9tHBybMNkOzUQpubMvX7V8Hv8Bx3aInoSwhg0B\r\ngMVXe6+etQGLglbzLOOoUJJuakgXAE+boRRFylG3yDcQfXK//yBafiAg5O4W\r\nyVdBkyJjt87aJqTz0PQFDJeZ2qC8KJFVasWFVS8tR8ADjfgNvkaNLD6kOCwR\r\nat4DKF+GJ29pxrQ0X96lPwn7+xB09692n2oBpWr7JGX66qWQ9UgUHNKKwHsg\r\nuAaBrkNBZ9FicwqSe6VqQaenkLoCU6/FD5Bkar5qgFmqlEn8s+2tyLIdmAiB\r\nQFDgrwvnKcGBRfZbhdxPGRm/IYDlLXon3Iwbv9iNg0/Kk1EPzIhhm9MvobVh\r\nF3DeiRxSKrF9TmOzjlwEl8rnPxdDcLoK00afFJhnjcXPOZTV1P8AqkV37QAv\r\n3pFVUH9PPMcy2OBRsajmI61MtT90z059PQyUKUSOh6IYvzit+Iw8DAupdH2j\r\nS3t2hc+0bdDIp45q3MCi4jDBXRAfteJ7A5+133hXG99F2A8b5jXRNHjsBktL\r\nSH/4lOvMW+OmJt6QBUjs/8yBIXtODYvKg8M=\r\n=s4A5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0ab5eaa3ea130a4b79ba5511e4e46e1f99b9e662","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.49b8e7442.0","@material/rtl":"15.0.0-canary.49b8e7442.0","@material/base":"15.0.0-canary.49b8e7442.0","@material/shape":"15.0.0-canary.49b8e7442.0","@material/theme":"15.0.0-canary.49b8e7442.0","@material/button":"15.0.0-canary.49b8e7442.0","@material/tokens":"15.0.0-canary.49b8e7442.0","@material/animation":"15.0.0-canary.49b8e7442.0","@material/elevation":"15.0.0-canary.49b8e7442.0","@material/typography":"15.0.0-canary.49b8e7442.0","@material/feature-targeting":"15.0.0-canary.49b8e7442.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.49b8e7442.0_1675811459865_0.11920126329050351","host":"s3://npm-registry-packages"}},"15.0.0-canary.de38de758.0":{"name":"@material/tooltip","version":"15.0.0-canary.de38de758.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.de38de758.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5197f2bbc4ca138e00d256f3d4fc0e1b948d68d1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.de38de758.0.tgz","fileCount":36,"integrity":"sha512-VAzv74auzfm8WPRl6YwyLHlQsBRcPzBzCznG4q+m2UsmUSeK/OSyfhhCahRT0AKnpEJdVHaNXcOQXSX/2YqUaA==","signatures":[{"sig":"MEYCIQDy0rWYDi9OGpG0AajQqwmGPWVY/2GdAgq7YG+y/ik//QIhAOsfclRlPZe3gxeY1Z9t45MFWEzknQL7t1x8y5uMKsae","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5RS4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrwgg//akSafa+7VCWSndGyTtq8CSaeK/63aB5/VVLdJxiAEXgdd702\r\nVgC/vgObRTG7c1ZzeYNyu3gS2IaCDHNEVTpXZ/PKDFV72jbqH865Q3lzAyJ3\r\ns9aJBptOaJsyyKI38XxMrwnPNXqNbljB7wx5CwM8jmEYWrfIZ7odA1rgHp7D\r\nPscR3DAQw8r5L9F+eeeOkJZhz3K/sHJiOJXRETfHt+Xah/rBVmrrd1wEBD8W\r\nz7xmCbmgTHyxtK5g5rZ2/GwQxyJZTfr/m0TG3I9Y/MABmKeA5ySpEzKwmx0o\r\nE4owkIvrYDFzFxbhSCc0HMCdDxg6wxw1gEl3y2QNOj2zJw6m2sZSySMcRmeI\r\nvx4i47F8CTRHHCL8mR531ObnWFX6DoiikUapcLk0rHHOkqraahQVzrGRnow3\r\nAhHSl4U8QgxKmrXysswW2wcUfZil8V0GFxETxerIZPu1t3gklbsUJzNa2FB9\r\nq4u0W3qE44St7PfJBn9FjRNaxwf/zO6z921OPi3dRVGj6FcYQkZ9/b+459fS\r\n+yM2Ja1HNvR4u5ztRpzbMQ8yNlw6Nj0yb7a0eLcZ5HlHB/8WrMhxnkQHCVv/\r\n+DnAdKMh4J8Za3iIsg8HVilSLrIdQi1KqyMYLyW2kJoAix3AqMPeHhXarlyo\r\nvOVQeqLrljt7ra6nCK7gbAIUICFcCQeHfGo=\r\n=zR24\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"72df173af8eee38e00bf9af0ca5a77d5b780763e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.de38de758.0","@material/rtl":"15.0.0-canary.de38de758.0","@material/base":"15.0.0-canary.de38de758.0","@material/shape":"15.0.0-canary.de38de758.0","@material/theme":"15.0.0-canary.de38de758.0","@material/button":"15.0.0-canary.de38de758.0","@material/tokens":"15.0.0-canary.de38de758.0","@material/animation":"15.0.0-canary.de38de758.0","@material/elevation":"15.0.0-canary.de38de758.0","@material/typography":"15.0.0-canary.de38de758.0","@material/feature-targeting":"15.0.0-canary.de38de758.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.de38de758.0_1675957432179_0.38215724353379255","host":"s3://npm-registry-packages"}},"15.0.0-canary.4d62de70c.0":{"name":"@material/tooltip","version":"15.0.0-canary.4d62de70c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4d62de70c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4666b1b5dd8d1befe91af03dae750961560f10c1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4d62de70c.0.tgz","fileCount":36,"integrity":"sha512-/MtWlwV2i5oB6pmDJTK1qAqwcjXsTavE8mhPCYZOmz0DD6ssL5YDc36r54Jq04G7Cud3KmS1afqojORyXAUFsA==","signatures":[{"sig":"MEQCIGLFwKo67dt+ovQ4asmpliL6hIqOpDzvkNaTwBjXzCdkAiBARXWxVvNuEZrBAoa/Qz7nmx2+tTxVHQtqE9jQQwEC1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5W3sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUkg//V0UIoI2Hp+/9MYZskIMoeXeGhaVsHvumM+bxv8z7ijta/IvE\r\necbvgq8t1/ap2Wlx+PX0tGpnqsfoPObHaIVaxCijcO7vWJEvbLpd6d/cPW08\r\ntRSr7nvtS/ORSqsC6sYn6a43sJmHE7/bO5GcAQbhFwUskhfNnJ4GM4X8RJ+2\r\ngWgJkrokpPjRMVMrdbEt0hiJbC8+BXYdmvgpQ4zk1eM3xi3MJJHhR8+ybIyO\r\nxHxM+XLn8x+nWhA1gP0+5jTkArgexcXm1M4O3rxfYJCLQ1aw6uDPxvLlxU+H\r\n5PwFC/OMm3E8gcNAAKQeeB48bSck6GfgaLI1aQGP+WeNEQOLChLyrhXau/GE\r\nx1n1DztvMjcTbBExITzsjf3iu8XMa0V7KDvPXXT/+V8bAQE6FEnESIug7DPi\r\n64aw9eQhCwDaoW+W4aBnVw33WUt1n2X2uMMj8ESKPc74yL1+z3sV8tdQhHWK\r\nOMY831kZ/kAMPwxVS/dlTGlG8xlbcImCpI1wMDEwxDTyRtZqbGP3RXNWDAsa\r\nvibCLF+A4dqi1ceL1wYH0PxL14QVzxHQQcZx+OvW9D1e62CwRhtYkhKYWMTJ\r\nvmHhaOA4+9rSbkiCXWNmUz8AL9kkUU0WQ0Gr2FN5st9P08Mw71ZxtgjJzyFt\r\nkOingiKdk5ZA40OEOdA8G8vAj8RvfZbXCp8=\r\n=f1AA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d2081b5045fc9871ff56b0d31ddacd235e2316d5","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.4d62de70c.0","@material/rtl":"15.0.0-canary.4d62de70c.0","@material/base":"15.0.0-canary.4d62de70c.0","@material/shape":"15.0.0-canary.4d62de70c.0","@material/theme":"15.0.0-canary.4d62de70c.0","@material/button":"15.0.0-canary.4d62de70c.0","@material/tokens":"15.0.0-canary.4d62de70c.0","@material/animation":"15.0.0-canary.4d62de70c.0","@material/elevation":"15.0.0-canary.4d62de70c.0","@material/typography":"15.0.0-canary.4d62de70c.0","@material/feature-targeting":"15.0.0-canary.4d62de70c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4d62de70c.0_1675980268283_0.4843645880733354","host":"s3://npm-registry-packages"}},"15.0.0-canary.6fcd8d418.0":{"name":"@material/tooltip","version":"15.0.0-canary.6fcd8d418.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6fcd8d418.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1bada28a315c21ca778578f442c400c9e157d52c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6fcd8d418.0.tgz","fileCount":36,"integrity":"sha512-BHC312pFA4dvOQ9/DhGdjNgl3vkD6MDXTfXer2x7HMvA4PKS+ePlUIjqzCDr4c7P9X8KUbYTNl9L8GXpj3N9fw==","signatures":[{"sig":"MEYCIQDpzvusKfsK+as9J29a34OCwLWZ0UDYqacJqyluaLkRzQIhAKFF7VI/N//W0xKygZ0p9sjFzF/eRW9yj0owFrEUQABF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj6iQvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFrw/+K158U/tKw5AZXrCzRVq4zeDkSC2l2I0vL/NBbPxGm8lQJJF1\r\nyNQ6Jr7MJL53y1TA/sao0zGfFS/H4t2DenTjqy4IRlwCwJ4cVGPvzuBazRI1\r\neCBAiRzh+s+hOoylXUAm1/spzd7Ug9Ny0MSScKj6/15SyOR14LbGMvP7CjAn\r\nefHNFhR0v+7nIJlsVHYH4O4W6G/PKom3SVXaiuf8Y117Upik6Aok1i+s41zy\r\n+nts0Q4EGaSE3WvzG1UgOCcW+xX3k4us2afyRBFkm18IfqIQVzS+XdGvHHI1\r\nlMxqphLtgapOHSiVaG1W8GTuQpgAa3DVn2vk0oMX5uIUEHqjAHAvLPmPFoCt\r\ngfUNy6tU5r5imkU+uXqBaP+WK6KFjBVrGGfyVG+iv5Gr0hcqAt7r1eK3mTUc\r\n1S+ih4Ml1k1BBUaB7YhnsNMKH1KcE4aFUQkgLvU/KmlJ08T63HQeuH7ocZtL\r\nxv+3jFSzfk4JgRegXCCZqgrkFHRiE8OUVjgDK9rm5aKn8lTGFqXe6j2hcqSt\r\n9Kl6V7ByVADZpnbsjFKDGuZ7MspuC9dk7YGWxWspnmpwdQZvNgUhpthx8ph0\r\nBaiCLb+Qk74gegwEwH2tvdzw/G0cqbFqIZT0WJifCdiNhtmawWJmJcUGDYgT\r\nJH/xfMfxyP+kxxST+x6+cVIu+xrSrpEaiGU=\r\n=rLjP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"39b4fd2a38e7ab9611f614a59dd1694de0b94cb9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6fcd8d418.0","@material/rtl":"15.0.0-canary.6fcd8d418.0","@material/base":"15.0.0-canary.6fcd8d418.0","@material/shape":"15.0.0-canary.6fcd8d418.0","@material/theme":"15.0.0-canary.6fcd8d418.0","@material/button":"15.0.0-canary.6fcd8d418.0","@material/tokens":"15.0.0-canary.6fcd8d418.0","@material/animation":"15.0.0-canary.6fcd8d418.0","@material/elevation":"15.0.0-canary.6fcd8d418.0","@material/typography":"15.0.0-canary.6fcd8d418.0","@material/feature-targeting":"15.0.0-canary.6fcd8d418.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6fcd8d418.0_1676289070750_0.6534627890730387","host":"s3://npm-registry-packages"}},"15.0.0-canary.066d9439b.0":{"name":"@material/tooltip","version":"15.0.0-canary.066d9439b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.066d9439b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1daeb7e5e289cdde579dee2ef36f394ed366b42d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.066d9439b.0.tgz","fileCount":36,"integrity":"sha512-qBDIKvDH2YUfDIut2pHK6AE/KDfk9VJ7SNmsuG4WVh9IzZJ/N33Uj+U85nnEZpzW6PHzbEF03GshaXvRnD/how==","signatures":[{"sig":"MEUCIGrdM88B+4yFxx93PUpxyoA2s1nbgQw+SgbdMz57WXMxAiEAusocqTBA8zzQ0utkr0QQfoiWY+4vlXqJkLwkiXMGIRE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7TmhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrb4g/8DhxT4YS2DCYhPjPSS7AHgcCoPzHwUToC9AAShEwsbA0F24lT\r\nWPUMEWNkFOG0kXquWHsH/GA6ycg3z7LE6QfIFk3EC7zt0YApkdxNNIv7qFHn\r\nAhVhW7cH2Wg2jyZEygatk/Uz15rjQciPEzrUaybThThI61NcsyZGq4Cw12QU\r\nYU5z06wU+S0meXd6aH9VoSRNkseVVmyeOoxT3knyhj4lcZ4VuNCwcnt6/XRF\r\nhbPqtAsEu8SanSSnpmgz0YOHHckmZbLvsLsh0LAYA+Zg5hBsaqRTMTfl+T0i\r\nqJ01xfYuIKPGoiMUBHGYws+/Eax0TmHUzY/DRbtbmoeZa1vGSZ0WgAw6PMjn\r\nCRM83wFkzfU4mMMX1cMAL1t7OYYgjEPMKGh4s33G+3IsDhWFLsBa+8xeF5sU\r\nrSbaKgF58jmcaRzSFQKsBSzXPKW/m1wzEwdy4bA8UaooC4Xe6BJGwHtEO6AI\r\nmpjApf28EP2OZeC+VzvvFogS7f9HsgO7m9JoMSPetaXMjhFS9i8LbhGH9p3f\r\nH6r2OJLc/ZrOUuTm4+y2M7yaw3EF6aXvbgdsFz8dXLsve+BsNl+hBnput0a2\r\nbD0YwzqSc+yNQPgW/w7NiU0RC/sddIaP8AasEfIWqfxjGsqD8S7amMoH87kf\r\nGKgoIgjDCE7DWnM2pKS/7KAhFTq1nl2y/l0=\r\n=Qdzp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cfeee3e63b3e6330deff033d8054adb710498810","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.066d9439b.0","@material/rtl":"15.0.0-canary.066d9439b.0","@material/base":"15.0.0-canary.066d9439b.0","@material/shape":"15.0.0-canary.066d9439b.0","@material/theme":"15.0.0-canary.066d9439b.0","@material/button":"15.0.0-canary.066d9439b.0","@material/tokens":"15.0.0-canary.066d9439b.0","@material/animation":"15.0.0-canary.066d9439b.0","@material/elevation":"15.0.0-canary.066d9439b.0","@material/typography":"15.0.0-canary.066d9439b.0","@material/feature-targeting":"15.0.0-canary.066d9439b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.066d9439b.0_1676491169672_0.575549845689723","host":"s3://npm-registry-packages"}},"15.0.0-canary.7ab32468c.0":{"name":"@material/tooltip","version":"15.0.0-canary.7ab32468c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7ab32468c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"107c4b4cc3707bd929519ffb262cb91a774b4dc7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7ab32468c.0.tgz","fileCount":36,"integrity":"sha512-lN8bzH/Y1mGY+Xeab7NVQAmRoKp/NhvJSdUcQsbs6uKj8VTc6ObCvYu56rK5sRTXjqPfpYG8ZriPyYeHvQwoVw==","signatures":[{"sig":"MEQCICqCk7Q2TgiEOOuA8NBQm9Kazp375tbGpZk0wJSjGk60AiBXP9b8lMPyYYwBN2Z46I8huhiSp98d9Rr7MVftf3Px0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9Q76ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqC/g/+PJ5nYc188msWOIJnLDtWY1DXjpRpzwUZfBm5k0j6qysUsOko\r\nsAbCu2OEPEO08e8UoC61sq7K/mJP30QgV0Ndged7Q3v4/62cHXnRBTbaI+sp\r\nYPnvedG6y1jEyiAfqQLz2Zw4qjavOq3dzuEohoN47WNpcfQD8HD4yhvS58iP\r\nBPvgh9kWmXdctUWV/Y0Ojf4mrNIONp0QetF+M2x1sd6vHWnGDR74rk0jnzkO\r\nu34oDPW0L4w0HI/7WO+lWlr53bh+E/K/Hn9T49tv5+76DP6i+3aVmhUDLvTD\r\n2aVQon3F8MNFI0jVsieUyhOPCgKC/MlaEy6lXVIiiNAhoCq2/crj+VfsV0eE\r\nnqrMZVG/mPyWS0TIY0djjkozTrUIq4XLQ/yNNsYs7J2AFsPz/RW7nhwsJOMM\r\nZifDFw8qFD4alfzbQv+km7apwnTuXqEdDggqD/uOdo51K298A2qG+5GKrWAT\r\npcQSHEkPMUXPeEzjSDE8mLmVZL6u5Xl0clqcBVcPFuKESpv/YAwNWcJs9xxy\r\nIPOetjbxVAQ+aqXV12fgnYNP04wLTk/zbfAF4Zg9gJTd7ljeteei/ud1Wwco\r\nHZ8H4JIF3DJD3D7C1nr3WG1nE7yMFu9okVsYUxLQXTqnk/WseEBPI5zAr3cS\r\n3gqhlH91SSjCbN4yNTEjoxOx4YLShR0mSdI=\r\n=GcSN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"08b12f363223d69b2eae5d2719e9ff0da773381a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.2+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.2","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7ab32468c.0","@material/rtl":"15.0.0-canary.7ab32468c.0","@material/base":"15.0.0-canary.7ab32468c.0","@material/shape":"15.0.0-canary.7ab32468c.0","@material/theme":"15.0.0-canary.7ab32468c.0","@material/button":"15.0.0-canary.7ab32468c.0","@material/tokens":"15.0.0-canary.7ab32468c.0","@material/animation":"15.0.0-canary.7ab32468c.0","@material/elevation":"15.0.0-canary.7ab32468c.0","@material/typography":"15.0.0-canary.7ab32468c.0","@material/feature-targeting":"15.0.0-canary.7ab32468c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7ab32468c.0_1677004538210_0.6705266600545192","host":"s3://npm-registry-packages"}},"15.0.0-canary.fa27ba61d.0":{"name":"@material/tooltip","version":"15.0.0-canary.fa27ba61d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.fa27ba61d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b451865942c5dc59faa37eb7cc9e6da8861c1898","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.fa27ba61d.0.tgz","fileCount":36,"integrity":"sha512-jOClBSpv4CUOZFgO+VObkFsc/f7ruuD6bo9RMM72VeRQORNrwwF6AhXhm3SV7R6WQCi5U/1fvCVhadTk41o8PQ==","signatures":[{"sig":"MEUCIDRezEuGHSy9pgFZ0UQbTc9hawQ7bTG+HnpgxPYRE1xkAiEAloPMKXgKw6+S/vTmmyCrrRaSrdaxDQeE7N9TPoqs8dE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/NiUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqoGA/9GuNoDjqXljZW9yeaJREGLjS1q3hVPIkxZqQB6nn0lIF0mXcd\r\na6T19wzS9+cM7uKr7U/2rPxXNe7cXiBxHBLfzoD1KDD9mJYMMPN90vHeZrdx\r\nUVKJZ1F0zOLKNohK9WY71ekHKI8m1vUyUa7So03FQywASEirC4RLIHo3cVp/\r\nuQ7PFeTFdOnDhNaukaytgzKvAsYQE88OUQucvmDQg2IPo+RmA/cGJg3OdOia\r\nYthyPzVAnD94amG5q3oSe0KnM+pfL2WvpsNR8eBRptpxZEblr+3RsAeMIRBM\r\nQN39XRmqolz2s8Ztk9h1OialEkZlMzEgVK4XWYFOXZqHCUy+uHumYm76dunU\r\nMaBghmHCgPOru7FjQVaDSmGAaZLSeuxIknNrtRRa66dcMAddL60YZEh8v0Nt\r\nBNKA4+xBcDg79eRflwiY/ZWJaYvfm1RHiZFBeGYOAl28n2jdmLmbG/hGXNcx\r\ndD+njzgWarlCundDFh7wVU0wVbTMmP+09L+iiULcAW4i42AY3ZPd0/YA/nPD\r\nQbw6UAWLX+I9QewL2rpwh24kNsHhfUw8eVR2s+ARBKyjMXg33w9faJqf3nOg\r\n3Tsvu+is4EwZvPeNVWQXOpxK5PRqWtNGx2IRufoorGDfoPocnVY5ySQ9xRWq\r\nNDrz+5T9eBULLHGxfLGnm0NeTRdWXr+yC/4=\r\n=PqV6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ed40c112543fe3ecfc009ace11a6f0c3f82fa26a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.fa27ba61d.0","@material/rtl":"15.0.0-canary.fa27ba61d.0","@material/base":"15.0.0-canary.fa27ba61d.0","@material/shape":"15.0.0-canary.fa27ba61d.0","@material/theme":"15.0.0-canary.fa27ba61d.0","@material/button":"15.0.0-canary.fa27ba61d.0","@material/tokens":"15.0.0-canary.fa27ba61d.0","@material/animation":"15.0.0-canary.fa27ba61d.0","@material/elevation":"15.0.0-canary.fa27ba61d.0","@material/typography":"15.0.0-canary.fa27ba61d.0","@material/feature-targeting":"15.0.0-canary.fa27ba61d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.fa27ba61d.0_1677514900292_0.0029457425530652337","host":"s3://npm-registry-packages"}},"15.0.0-canary.311ab4d4a.0":{"name":"@material/tooltip","version":"15.0.0-canary.311ab4d4a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.311ab4d4a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6aaf7bd32689af7e83c573e7ab371b751854df27","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.311ab4d4a.0.tgz","fileCount":36,"integrity":"sha512-ktEgIcx+7qddpE22BYCTUOapjsP6b9Q24cvC2LzBm2Rnk3V9OqauoEV8GYeGm9VKDgdlmv3D+grQDok4UmQ8vg==","signatures":[{"sig":"MEUCIQD0+cla0VenKm3L25x/XwslNOg2NYDMdASqq5Zy56OAlgIgUdlQx9VZaEEMKOYQ7AtiMa5hra7JUEOIJBnmcR0+7DY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/N2LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+kw/+NkBNE6troIPQ1wfc8Lp73fOfjs+3RGYyPu6B1neu/a3cY3iY\r\nupspuUqk8Mzrt01GxfCIs7SX3panWWSUsYBPP6TcXgJ2iQCE7sD+ZEvuHTwI\r\nkwB6uLBU1JLApxlgF58SOuJWbkJ6OqWV24GdkR1eoC0JqbZP3A05hYPbRTPT\r\nglF1gO64fxD0Tm5CL7m0O5E+ep2mpwSClAKXzp1qha/Pe9jZVwXdM5pTtOJZ\r\nV/nwz7YUlmTb3YJ0unSyEJV9vF65AVU48mbaV6oPolbyiMoW81ivPFXogKW7\r\nnlFqc8Uwdx7CLIDRzM5eo0PGvh0cDaEww9cmRCTry92re2TFujvPZKIu0uyT\r\nH/WCchj6E/mm8T46OaHEXZmtLVKG9yIVOFYQ2mr2vL1XPC1Bch9Pu0PAvfzJ\r\n7rqeaoC4UnLp+by4tl3o5QGfRR2Vz+DFbuu9TpuSWkjm01UeSroTK5SEuI8a\r\ny+gcnINuQ+9hVfVfJC3FuN3Ma3msifKKBoNq571Ax00nvKZrRxhuDPBDjCye\r\n+rj6oJouKImtHBJ4xaHIvz0fzNw9qhiPDI/ttR/39Cb5BEpTK957vMw7evjH\r\nI7T4upZkTuooHO6WLcYCpFxMS5YFHomCkkva70/7SY5NKqjCNBqlmxwZfrcP\r\nQmyti8qTMcAlmC2NAWnZJmD+ugo5sIODuFk=\r\n=c58l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"07f8d2f7bb4b2f30e60a6bd8739befd9d17bfbfc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.311ab4d4a.0","@material/rtl":"15.0.0-canary.311ab4d4a.0","@material/base":"15.0.0-canary.311ab4d4a.0","@material/shape":"15.0.0-canary.311ab4d4a.0","@material/theme":"15.0.0-canary.311ab4d4a.0","@material/button":"15.0.0-canary.311ab4d4a.0","@material/tokens":"15.0.0-canary.311ab4d4a.0","@material/animation":"15.0.0-canary.311ab4d4a.0","@material/elevation":"15.0.0-canary.311ab4d4a.0","@material/typography":"15.0.0-canary.311ab4d4a.0","@material/feature-targeting":"15.0.0-canary.311ab4d4a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.311ab4d4a.0_1677516171702_0.5381204074983583","host":"s3://npm-registry-packages"}},"15.0.0-canary.5cb8e2174.0":{"name":"@material/tooltip","version":"15.0.0-canary.5cb8e2174.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.5cb8e2174.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0f9545fd955f6bba8c6d8939a4754250ee508797","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.5cb8e2174.0.tgz","fileCount":36,"integrity":"sha512-sDquQlvm0CNHcs4XtGkWL+XCy2pwkg3hyiLzRldfM6HAQ5Zbvq0vBna1QIgtk/a4FJ7j6lKlyeDkSZ05jfq6Vw==","signatures":[{"sig":"MEYCIQCISUaWe3fQmaIz3clH5sAaECiV3A1o+rzN47WTM0iwbAIhAMLPvZMRlb/0EEmX8g5bPh3tBbLpipLWkCHzTiF9VVM3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/384ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpcVA/8DEz+xnfoAF/Lv4g2MVWekW4yHubGJLTAlx1OVNVGT+FOXseV\r\n1e4GryJABrAuCT2LV/WQg5zTQt5bomu9H/yk6CxSZ8IlFL5HrOu5YdIhfREg\r\nNBVvQPiO+oDDLuEhCdF4aoTh9kHIAo+0v0/y4hDIVUOv/G5BBDcMxdFbRYB0\r\n/shj/logp+wN0lYKvt9IsWfUnivtTO5sV2T1dogiqmyiZeP1HzT1SQoO4Fy4\r\nLuIEkI76zxgYXrDSfXdHhXADiRGSS9rCsFDrQs3XxfCGwPanv+E8kUrns+EQ\r\nVViaIF08WI62BQpey94kML3sSe6EsPEMQFxHHkSXsDzyszkRfANTKLaCwLJ+\r\ngRR5sIX1mYk5c71iFEn0k8ZcLPHOrwOVCLN05LQTulcoUistCG+c7iyIdvtx\r\nKM638iPoQpCwZMvxAvcP8dyZJfS6aI+lKoU24e+D9mo/JySJVE5JDE3JijSo\r\n2qfsHK9VAkAvg8e2d3Mhb1wN8thfZoiaIyuPXVRl0Q2ZVXUv9uJKS4N9JUao\r\n1k8tZbrqRXDjRFHoVifA9jw71cfaVqRlC1OYL3fZfBoK/F0OyUkvGN5PVMnY\r\nrBp4UlJPbhRVANhwDAhJ55kOokc8LESBXNJe+ZeSTkbP2NEYKy5a0KHhpnQn\r\nkH1TLEZWIxk0Wd+v7/Ib/QixNez1FZ+81l0=\r\n=AsYY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d57edaa5a3a3079c48ef7c804f0a642bbb682478","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.5cb8e2174.0","@material/rtl":"15.0.0-canary.5cb8e2174.0","@material/base":"15.0.0-canary.5cb8e2174.0","@material/shape":"15.0.0-canary.5cb8e2174.0","@material/theme":"15.0.0-canary.5cb8e2174.0","@material/button":"15.0.0-canary.5cb8e2174.0","@material/tokens":"15.0.0-canary.5cb8e2174.0","@material/animation":"15.0.0-canary.5cb8e2174.0","@material/elevation":"15.0.0-canary.5cb8e2174.0","@material/typography":"15.0.0-canary.5cb8e2174.0","@material/feature-targeting":"15.0.0-canary.5cb8e2174.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.5cb8e2174.0_1677688632153_0.9993599803710524","host":"s3://npm-registry-packages"}},"15.0.0-canary.f32339937.0":{"name":"@material/tooltip","version":"15.0.0-canary.f32339937.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f32339937.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"cc11fd2c658e4ee754c1e24dc4b0bf43d1d02b57","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f32339937.0.tgz","fileCount":36,"integrity":"sha512-6mC1rK57W1ub/jEbwnppgeMAruMkcrvwNhn2udBTHTkseqsp7YKTarnaA/zgLEzwLnCFxyUt5vZdOgtJ5bo+7w==","signatures":[{"sig":"MEQCIBg2RpnFtAv2zx1xq3bMFLKqlaY8//arg8L0s5o+Dk3AAiBKLOl4t14MJ/Ct9w57nL9Kks5XPqLvjsInufI1AtFdBQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBgPxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolHA//ay2yhGDS/TM1R+dYmUevkSIA9y25QJsSSNrs8YRzKeYRP9Jh\r\nfRTYgEqhNwfp+HErC3/LJevo6ZAIEBep4Yn77rVsejF25p8ZWKCnQkbrpH2+\r\n6A7Ro2DSk04DYgUOM7T0p2ohoa5rDx1KFrjDCBGIWC/ctp4vEyFJWk13t8q1\r\nU/zyJLlmYBfRbS+R88QlDGN/sfWhhwixP2bfcNnKJYI5DFwbli84KHl4ZmzA\r\nSqDsQAO9DYgYZY5P5oMsGwVZ471LDEN9Pzdkv1sS3sA+lZz7EA+JwJ2mmmZe\r\nRZTmS/2eor09UspexkcfjjsWQtodpXzdkl0jTmSYKHJQEjDzysUXpGMiadPP\r\ng8E6h9pY6GXa28+WL8nIFQ7O/p1GDSvVNJdpDxJp9Xb8HHzYupDg33vOROGF\r\nGGb4uYhSlP8Kc3dAm/6eEDGP3xez+wj2XR6/9/GHWLuowhkgoqUQK1GQL2z6\r\nIGD6fUnmbqS+faI0RjhHNdfJV90qej3qsn5awClfJg6rPkqnxPoyaVmVZny5\r\nt1ktzutzLEv3GgBA+s+YqOx0snEp9PhW03yJ9vLa1Ra1iTySjhwFroLVv2D5\r\njPVUj8NZg4Xo2piWNdQGnciBsU08AJL9TQuA/aStLHpw3oBUETRaOzcAlh/h\r\ngBoRWWrZWwFP1x9JOQxzO9H96wV6l8jCMZ0=\r\n=NhFG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b6c5103b89138f008c28f70d93e0d3faed285061","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.f32339937.0","@material/rtl":"15.0.0-canary.f32339937.0","@material/base":"15.0.0-canary.f32339937.0","@material/shape":"15.0.0-canary.f32339937.0","@material/theme":"15.0.0-canary.f32339937.0","@material/button":"15.0.0-canary.f32339937.0","@material/tokens":"15.0.0-canary.f32339937.0","@material/animation":"15.0.0-canary.f32339937.0","@material/elevation":"15.0.0-canary.f32339937.0","@material/typography":"15.0.0-canary.f32339937.0","@material/feature-targeting":"15.0.0-canary.f32339937.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f32339937.0_1678115824769_0.30118414428543416","host":"s3://npm-registry-packages"}},"15.0.0-canary.7644d63d5.0":{"name":"@material/tooltip","version":"15.0.0-canary.7644d63d5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7644d63d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"07fdaa69a3d50fd8c38fdd8addc0891c49026cf3","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7644d63d5.0.tgz","fileCount":36,"integrity":"sha512-m/+l/elJxHxz3vkyWo5P6MlLs/fLTimeay0PLx/aoN3wlnVSGxUTtGaEx6LZ9tHySbwCeOt8x0ohjfFoSXKHtA==","signatures":[{"sig":"MEQCIFNfM+b2YZW4NCLeF8FiMNFyMXZe4SMUxmmDr3Odkh6cAiASVPsK1WiydQQxyxIcwJypC3tlc/USpBLC637ytXR3NQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBmkjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpg8BAAotK2iDaR1dTfMdsgrS2WQy9YjUa1ivHY9+IHSmpX6tHnzUVB\r\nFz7SnrLSJJBZr4iYwU6nq0YUZljO4DoDRa+M2xyzuR5jMo7loRQ94hIT2dr3\r\ntV8mReFuNnhhxbWrViFpRvT6FyWCXwHoEfI0y8LLYTKtvQS74J7sv15GkAu8\r\nlkGU8bWO4dL8EMe5UyVVxjlr0vNe2u26W+oFcDzaoyri5rSAkRAgtuOulIaO\r\n5xCEdPZIgVAVGncn13d0xrBMsRfxnpgPioOTFFd4ujPS0eVjwr2pIa/cveeF\r\nYiQy39cJx93SO0p4w9QqXaHfG4v9s3uBBSolpMBAD93PTms6Do1lyjqNYKqY\r\nAJNHL9lqHtv3D5fFN4S0lQD+9lSbCn/6EHFxgQyjINmU3V3uFC0kb7mA0V27\r\nlRswhNCP1LqUG5BDnfKioaQIfA5aD+pnUNpiaqLKEBtvT4wvIalp6z376BnL\r\ncpJ84nQlgu0ncPjXWRM/WYm+PWQlP1TxbCSmlKbZUIYWpOC3RV34Zd0IgK6c\r\n0BAP0G4rCnvKyF0I5EtYDgI+1GihMqoR6B/HxvT/aGJMIlsDdY4u8zHnLeUg\r\n5Q90N6zKfvofzKYoMdqDHtD43oO0vpxSWUn+LP5pHtP7Y5rfo6C+IQAYY0n5\r\nS/CUur+1FnyPFw8LxlA2IdzEwvSoEdywsSE=\r\n=91TN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a0332d9af18b36becfa025c452efffd11be59943","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7644d63d5.0","@material/rtl":"15.0.0-canary.7644d63d5.0","@material/base":"15.0.0-canary.7644d63d5.0","@material/shape":"15.0.0-canary.7644d63d5.0","@material/theme":"15.0.0-canary.7644d63d5.0","@material/button":"15.0.0-canary.7644d63d5.0","@material/tokens":"15.0.0-canary.7644d63d5.0","@material/animation":"15.0.0-canary.7644d63d5.0","@material/elevation":"15.0.0-canary.7644d63d5.0","@material/typography":"15.0.0-canary.7644d63d5.0","@material/feature-targeting":"15.0.0-canary.7644d63d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7644d63d5.0_1678141730997_0.8844664839791558","host":"s3://npm-registry-packages"}},"15.0.0-canary.d96330c08.0":{"name":"@material/tooltip","version":"15.0.0-canary.d96330c08.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d96330c08.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3e6ade23bdd44e88d83d12b06d4ef20fe692db0f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d96330c08.0.tgz","fileCount":36,"integrity":"sha512-sgPeS+x0aUPu7DS5KaXjWOLn40U65/lHJcS5RE7sHTfaQ0+ifBq1UTm+06FW91hU8BXhvzzllwevz7hDB2WhUA==","signatures":[{"sig":"MEQCIChRMhKar3rMUHZcjYrdMYZVjL+pER3H/OAT1/kA70PJAiBXCYDDpjTGVHPKhgzZolEfBita8g0CpS9eHc9+37KhRQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCHTQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopkQ/9FCr2oPISOkIDLh6pJP0kqBD5e1Tlje0/0Eyjq4H8B47GtJkH\r\ndXeqMLHwwZxbBuumEMa75GJsE0LTVmdB6n2hqICnEqTtizxIC4W8YrUB95cT\r\nFEn68zfU5cFp4/CQY5u6n3oGf9qjuXFWmErzWqBbjeg9e2p/le5nBGViSSMk\r\nA01N20P4ednG5PqPObwlid+FeJmGYlzlcwrirpGqlLLCEFpu0Hsb0fzr8vkN\r\nokVVXNpEWGBxNDx9S8VBAxFKjATpUm3nLqr3koqr9f6RAwrFHsGTD45q1rUI\r\nvgBokEO8K+C5Ic/ypM81/Ox60mazZLtE2oe40yMaM+jlZZThnwVgWdxpsMm/\r\n1ao5TAgR0JIiOx5p+QcBMdMXGi0KLH/x2v3eiWqIohjcOC88SRDtCX51dum1\r\nH2bYpeyxH93vY6gNGwTF9ZpX3QEjgGBqDNaT2EE3UB/yhqiuMzAx9V8o3RLa\r\n3BqrQRMPGYBA9AnkFqyIbhoxTQZufqALG/HJAIGDPlrzZNDIg0bvFtspOBLC\r\nXcUYU7Aesxu0OtowD62jFy2P+HGJx1PH2p35sHVysdhlYlyo8HIdAng0wZJN\r\nf+p0P9svbMN/UNamd7halfwCCJgY++CFdeDqVL528Vof40qN0jS5CNSdVF2W\r\neFFOzuHsdFeqEiCU0jt34FHednBbp3Av1i4=\r\n=rpr5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6a6d53aa84a0c0a10bb15c3cfb596881140bddb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d96330c08.0","@material/rtl":"15.0.0-canary.d96330c08.0","@material/base":"15.0.0-canary.d96330c08.0","@material/shape":"15.0.0-canary.d96330c08.0","@material/theme":"15.0.0-canary.d96330c08.0","@material/button":"15.0.0-canary.d96330c08.0","@material/tokens":"15.0.0-canary.d96330c08.0","@material/animation":"15.0.0-canary.d96330c08.0","@material/elevation":"15.0.0-canary.d96330c08.0","@material/typography":"15.0.0-canary.d96330c08.0","@material/feature-targeting":"15.0.0-canary.d96330c08.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d96330c08.0_1678275792601_0.6705306662897008","host":"s3://npm-registry-packages"}},"15.0.0-canary.c99cae77c.0":{"name":"@material/tooltip","version":"15.0.0-canary.c99cae77c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c99cae77c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c1f03ea420cf6f57fd775e2dfc4b10e485d18fca","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c99cae77c.0.tgz","fileCount":36,"integrity":"sha512-x4o77dyAa9smWChcv7KQYij8rYQQIk4eUDd0iEpPd8Qjlr+MVNj9RY70j47LWukovF56LSUszlQ3XjbR/WcI8w==","signatures":[{"sig":"MEUCICJHBu4Hz9SWxjLHERPPVzpWQJ8/d3dcwagG2D8oa/tOAiEAmhgnTtMbA436mZ91VD3A91ejpFl0a8foBpvR2VZpGb4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCR3PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrh1A/6A6ivX4moOQm/+P5lr9HbSgvRcpwHQel4jBIW2omTU48H+2tG\r\nkqs9X62tz0SU/pRdBKzop5A0FO+xSysKZLVwh3ZUn3F8VbGt21Tawg1SOX14\r\nKdPY1YVV2dsHI/1mjegYuyKkIkNbI2q3uZyPw1FFKrfaXBRYrV/Psoshm12C\r\nxkd5opitTqDnuwu8xd2csgCTtXnzAknG2Im5dHfLhYXJahT2vtwJ27W63WnP\r\nuvNjH5O184lRJHyVRO4DRupAwdfy2f/02kDayXiy1GGHW1TjjkZsqwCIAP9q\r\nSZogB9M7d11KYua24u2oAiCA6BjiOYRZJaoYFzxf0ZrYMY5fSuPO6+9EkA/o\r\nT7sArqtN32RLK/vsYxFyPd+EIZMhBlW0MIekqDx++Je+++CNKPU2ugeiJdL7\r\n1DOJyQWBqR4topfwngsexxRSr+Wf3D4JMj/dO5/Yeywj1vgZxzdw6bwynfyV\r\nvclN4PfdTv78/RV1A19WM9Bp6AMj7W7wbyjNHFdv9XPEylyuoghAfEbMqvSm\r\n1Byxdy8h2oSSaMsBLHxBFSQMLedKaF5aO3mSRpGVLQClR7R+BKTEPeXf1Mt2\r\nuXhY92tRSQCxKBz+pXLuKlIsc2R5L0OEjPMkdEIcyi+UXVpIxziyny83Wmuw\r\nc2dBZZzhkhj3FtIzIAKAmxrjnhEndTTRkuk=\r\n=AgO8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5b6a7c1a1c133381bad395ae040de00c64b62e42","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.c99cae77c.0","@material/rtl":"15.0.0-canary.c99cae77c.0","@material/base":"15.0.0-canary.c99cae77c.0","@material/shape":"15.0.0-canary.c99cae77c.0","@material/theme":"15.0.0-canary.c99cae77c.0","@material/button":"15.0.0-canary.c99cae77c.0","@material/tokens":"15.0.0-canary.c99cae77c.0","@material/animation":"15.0.0-canary.c99cae77c.0","@material/elevation":"15.0.0-canary.c99cae77c.0","@material/typography":"15.0.0-canary.c99cae77c.0","@material/feature-targeting":"15.0.0-canary.c99cae77c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c99cae77c.0_1678319055656_0.695702648895052","host":"s3://npm-registry-packages"}},"15.0.0-canary.6023b1cd3.0":{"name":"@material/tooltip","version":"15.0.0-canary.6023b1cd3.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6023b1cd3.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"055493559101b4501effa9d32b5b5a3a45883241","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6023b1cd3.0.tgz","fileCount":36,"integrity":"sha512-/JBrI24HvOgzxE8Bp/MKyDnKslObhWrAkQz0ydnM+pidc55EB5dW+knmm5T3S9dIBPmcioUfzp0PeVnZoHVQyg==","signatures":[{"sig":"MEYCIQCtiEfA0SIXI8bOs1OtN9BmdZoZlHZ0uCG5OwCUgHGzqwIhAMl7swrjdVqw8xLtRsMBiZqqUJdKYYTiL96e4sBsXimd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCezeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqF7w/8Drkrsffq52sk3ena3VP85SvrOIKzb5qQ49SY8TwAxAaEgSHR\r\nqOfgBsPOO3uqagrARgt7QpAhXLVMDc9jXeRtc0+u2JmgF3N082iPRJKrEmy9\r\nYdcijNrj25pS68ccIRbOIdW357XNoGli2xANw3SXaBm7C/LaBoayLEt3fLYr\r\nnypwbqa7RP7P/QicsfS4x/zSLxw3in0TsgXY0hp7/JhTgpvyrM7FYiF+OURi\r\nw/QXWqMCZ9rvKIHfMf13b66bGHstWzIy5R5wUhbEUKyBwiIXuVECZy79txPr\r\nAVjKzo4PcMphq4+9s0kPYcwWnYLmkPQ+qt0fM31GMjf1QbKHFJpjOc7DwrPc\r\nma97N/6vsYBWw+qOdZ/YgqJt6rhHyEIalMP2ZmUUMVEu3EFlcfNhXsd+HTqs\r\nPPJwL0JCSSEDEuDcl18yAXFMrID/2N1qvYFqmL6P2PGKcSd8n2L1UFBqslrq\r\nt9VaPepfJvADDx1Pb8yGTzR3GEfV/fb8rr1DskQpQgj/XrgAST6DhTvKwKUq\r\nqYl7+Qj28fkWEa5S+oVac16DPuQF3eBV1UoUY0eDNmacEVUTbdNvYO+ZOXDY\r\nzzbNQYWV5XpMgzGu6D/xe2t6uYvoezwba8dLEPNhNgxN20jCIUgaq84zjCAO\r\nL2rHnayKvSBeVBVvDiJdyZgP+1FFnD6zaNc=\r\n=GXba\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4d11f175faeacd8e5fe534611afbad84efceae77","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6023b1cd3.0","@material/rtl":"15.0.0-canary.6023b1cd3.0","@material/base":"15.0.0-canary.6023b1cd3.0","@material/shape":"15.0.0-canary.6023b1cd3.0","@material/theme":"15.0.0-canary.6023b1cd3.0","@material/button":"15.0.0-canary.6023b1cd3.0","@material/tokens":"15.0.0-canary.6023b1cd3.0","@material/animation":"15.0.0-canary.6023b1cd3.0","@material/elevation":"15.0.0-canary.6023b1cd3.0","@material/typography":"15.0.0-canary.6023b1cd3.0","@material/feature-targeting":"15.0.0-canary.6023b1cd3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6023b1cd3.0_1678372061966_0.46557039886804197","host":"s3://npm-registry-packages"}},"15.0.0-canary.274610c77.0":{"name":"@material/tooltip","version":"15.0.0-canary.274610c77.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.274610c77.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3801368f6312c285458a4b9cea589683a1920346","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.274610c77.0.tgz","fileCount":36,"integrity":"sha512-t6VUWqeXiVAD3Icy6JuzPRlWAu3UUGkc+7unvVVLBxFcFmtSe5sYZCP871EeVnxJzqRSg2hca422QNBIMztdBg==","signatures":[{"sig":"MEUCIBuYCVA++vFojWs8pMVTo24gtTpi/wDWZmiF6M9UsvIKAiEA/2hN4G+YPPqcfSjKlmX1HJ/dg7JQOJsy0qZY+82R1Qw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCfR7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqh8g//eQ6XuDULIopFTMn9M6VSxWxiu2mG9DUk4QYExE6ZWMRsX1cN\r\ngfLc+6jk295b33ax9p/fbU0jn3/rSttZj1BRnQtllxfAM+B/xoJVe+wXnvLs\r\nQYo7MlwR0Ln3BfpXz4HpuOX/qkZVJWOuqkgP8BFjOZeIrEpsJYJ+gmdt70nS\r\nK1xayAnXVoy11bVGNsnPuw5PNf7snCd44OWcDPAqAHzaE8bSZUEqB9sb55OG\r\no5Ue57RzUU6aB/SoSeplIrzyla3eop4+ToKRKkSFGZgUcmbVHqu6XLCYA2tA\r\nIeCNgx4gjC2kc8pVcvrUSIAKxVvXKj9MZPyQn3iiDV8rWeNeAPD1SoySfIDH\r\nGf+XXwrhAP2tOIOhGvdinUiDoLU6L3L88NCTsEF/D6owbm2hmyG7L/9EnHJZ\r\n6QOsHTA5eUEyYFNHKpNQo81ozF6F4p6Eq0g4a8SGdQQO/1xmI2MCT/sSRHFQ\r\n3hH9HERMJ9rdOKzLSRs9ci2zcNeMfTZNtG8nZt9OixGDmC6/V+oTfmSiNrqu\r\nCX6Xx0VNMzK1ZiFrlxn/d0FoutlfzoiqxWjaiIDnhWida0/FgvhWRjHFQ26p\r\nYLyemj1TqyInK2xwwiTFCWvTYQX88dtqqtq0Rpu1otRb1IEsricRV/e3rhCE\r\nDxOrK/Fg92+7swO5mkIWOxhF+LgnUqatM/M=\r\n=zORm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7a2b02c682ee73deba431503de1a6f1fef211c10","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.274610c77.0","@material/rtl":"15.0.0-canary.274610c77.0","@material/base":"15.0.0-canary.274610c77.0","@material/shape":"15.0.0-canary.274610c77.0","@material/theme":"15.0.0-canary.274610c77.0","@material/button":"15.0.0-canary.274610c77.0","@material/tokens":"15.0.0-canary.274610c77.0","@material/animation":"15.0.0-canary.274610c77.0","@material/elevation":"15.0.0-canary.274610c77.0","@material/typography":"15.0.0-canary.274610c77.0","@material/feature-targeting":"15.0.0-canary.274610c77.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.274610c77.0_1678374011217_0.747260912170058","host":"s3://npm-registry-packages"}},"15.0.0-canary.a274583b9.0":{"name":"@material/tooltip","version":"15.0.0-canary.a274583b9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a274583b9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3c6b6f9b458bf71b725d15996d9fe6d87174f280","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a274583b9.0.tgz","fileCount":36,"integrity":"sha512-2HR2660geAoZjh48ivx48MzRSxsVTsEOL+VCKX44Y3KJiJljo70B564aCGbEH4GRgOsxLPixzjRF2DwgBQAiRg==","signatures":[{"sig":"MEUCIQCbB8g6Ksu042VhlNMULOdwUUyyU0EckHaxMVvJw4jfWgIgGJ7hdxhz7KqhRGJGtqFjjyjAw9ts7mQebyzM5ntlio8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCjlYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJ5hAAjxyz0qJRvElOPQXd2wlhtfClVWHpx3sIL400HgctTwKQhb+v\r\nyteT+ra7Rkmc9YkvF7EB9bYpT1LMr8AWWmvZY0DWNmI0iy444jWirefA9ssV\r\n7s1JqnuhwM0dJVjy6KuKE7G/eqv92wTxld+CZe5tBoOxsXh4aqcolmfKHTS0\r\nM5fLfrKlUsuCmVFCCGv8IWA6JTGNQnSkt96IeF5O4M2ma+9sv4l4bX+eo2fP\r\nAmQobHdEU+XRwmxQEQY+bLGpm5ZI3m6Bk6zqq0HJGIqAICtSTKh5oUrnTjni\r\nDyYPt7ImjsYBepL+lKbqvmAKnIYzn2BmDAuQtymB4oomR3UiQbSJnTDEfOro\r\nhbwhjHOAhm2ei4sObFOaY1M1miUfMEKq0MILJO9BCjR/QMdaxL2EIe+UDakS\r\nOY820Hk0A74YxXZYOMBgWjdZaqK97wba54d7YwqWllImX9+uSc2QjQ5DzGxG\r\nXAl4HpTubnp+7xLy/GhrQ9dY5XmpiW64ryk8NmjTA6399X57UyIR6+PENGqK\r\nwgipY1jegUch6yNEJ2k6LP9QUvyokxa8ZdxgTVj5OSSjk/EnzZeVbE+R4z8o\r\n+AGMcrKaiJQCgqy4lsByll+rYfEFO6tqVdD3QZCi4sYpw5d/0bJ5jBu8qfgX\r\nrAm12nCrNL10+23Jb92J7NLkHI40ntFezTY=\r\n=YbkE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7a7c8184214014c45d0ba8b4723714d1fe91f266","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a274583b9.0","@material/rtl":"15.0.0-canary.a274583b9.0","@material/base":"15.0.0-canary.a274583b9.0","@material/shape":"15.0.0-canary.a274583b9.0","@material/theme":"15.0.0-canary.a274583b9.0","@material/button":"15.0.0-canary.a274583b9.0","@material/tokens":"15.0.0-canary.a274583b9.0","@material/animation":"15.0.0-canary.a274583b9.0","@material/elevation":"15.0.0-canary.a274583b9.0","@material/typography":"15.0.0-canary.a274583b9.0","@material/feature-targeting":"15.0.0-canary.a274583b9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a274583b9.0_1678391640290_0.016563904693974507","host":"s3://npm-registry-packages"}},"15.0.0-canary.da22ca960.0":{"name":"@material/tooltip","version":"15.0.0-canary.da22ca960.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.da22ca960.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"536ae272061711d7528c65d16fc1d6e726fed1f7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.da22ca960.0.tgz","fileCount":36,"integrity":"sha512-yZ+j0gB+m/FcBbD/m1XCvu4tdsxc5X+EISsyKrUhwdbZkXpl7VvkzzdN3ckNRNX0Gb8rCFWSG7e0pvITYRcZ2g==","signatures":[{"sig":"MEUCIEUcnG1NWlJizGIrb1MYSo+c+EZm6Ly42LTOGbJ2aD26AiEA+4up671hfFHDTJu+g1S6KdVMn99DPZyKesjplhT+5fA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCj9fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpM2g/+OKp7eeYJQji6KiWfr86H8ilr8F+jT9S9NodEZymLQE5UhLx7\r\nO5wouIQQE5N3vhU05PSxupE74ON69LIKkp8u4IFMZ9N/QKI4KUMjx7JjbaJv\r\n53T6aXqcu5NCKY1p6U+BaGGd7ho/VXTGknC58XslUG/BDrZjqlFmmwmZoOIn\r\nE1BGrQsrLBOJ7J90PnmsiZ/Uv4nyJrHbqkc2KJiJsuj2Zgvizppyn2J7eRrM\r\nl1F/ksKBQbq9sW32QQkth30ubmR5pXR4j0dlzfzIKjy/6gFUeH/Ua6Q02KAN\r\n9TLrqBkwrIA/Mec0l8jEr4sUIjJljjT1P7NCWP45DS62/Bbbjr+KnhXfk9wX\r\nOlE5KxK/uyV+0lom76omqfCdkCEZZ2g3uLTrAgzN0Ac+DKDy6VB4uIYXQoHI\r\n3J7aeZ0lcifHNnU4slnNhLLUsKTD6TzJQYtEk0+1OHjxrOyFUPmTiuPpbZYQ\r\nYMnnUuI1EHEnL0zL/Va9p38w7LZ2gjNiCpYXMEmZ9lsshzRDmGqIEPaHHXSr\r\ndv8BNil0419uuAmgd3l+mg/pKffbPYVcjWkOSBcE6BJsfL9cUQHDZxyJ3vym\r\nlWujFH+t3Yn5ZmxM4WMAqJp8AG59uw+fNOnOztSMzmwEgshQqJ6B1565uv31\r\nnKpe0LxbuVvx41V14ej4l5p0qqgmCasPH7E=\r\n=r6NR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1b58f37865efc4ba8ba06e1190cef502dee9f902","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.da22ca960.0","@material/rtl":"15.0.0-canary.da22ca960.0","@material/base":"15.0.0-canary.da22ca960.0","@material/shape":"15.0.0-canary.da22ca960.0","@material/theme":"15.0.0-canary.da22ca960.0","@material/button":"15.0.0-canary.da22ca960.0","@material/tokens":"15.0.0-canary.da22ca960.0","@material/animation":"15.0.0-canary.da22ca960.0","@material/elevation":"15.0.0-canary.da22ca960.0","@material/typography":"15.0.0-canary.da22ca960.0","@material/feature-targeting":"15.0.0-canary.da22ca960.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.da22ca960.0_1678393183196_0.3547929937308645","host":"s3://npm-registry-packages"}},"15.0.0-canary.304a94e8b.0":{"name":"@material/tooltip","version":"15.0.0-canary.304a94e8b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.304a94e8b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"c12674f2fd9c33af7c671fc1665a1e4297ddf3c9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.304a94e8b.0.tgz","fileCount":36,"integrity":"sha512-pNdJBRPsjwYL5Scp4vZYK1vRr0RjyPN//gnYsP7YLHcSzrDCr+y+/iFXmar8Z0I9aFCoYlARR60x8a6npQBCgg==","signatures":[{"sig":"MEUCIQCxiLmbQb8wtZ23ID+nSAIaxDSzrvtiXcmBvVNCq3ILhwIgYos5ebzOvEhHi69xx6cxNKUF0yX2UvATQt3cdn4h0xs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCkWcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGhA//T4X2JiU1YOAj/dgHg+xSa4+k9QEHmKsa23/IO3xS1iRrgPW1\r\n1Qcwzg9Z/03xXzB6cGu7aGIbpbKrP7bs7CYvGrlVUJx7Hdcq2fZTVErFKTt5\r\nRtMiFHYgH4Zb1jNzWGzmDWLukiV6fb8EpidwEA1NJltmR9wruO+8b0+oKpuP\r\njffJtLJcflYg12vb1DYSzqEFSV8LvPSakP0BXK7XNxAy5xNWTsu1SVBvM5QJ\r\nThbnz9RYRUkcZbZVZTem9733J1+pnTh4EP9uhqPS8VDZ90xDYrDvszAqKN8y\r\nBZJHPcajPP45ERppEwI+QjDwHRPTn/hKfQXKI8LzvyBpGF9W96C+st9nWfHi\r\noQCBQtyQH6xB80EG9/sqda4PxAUscMHniFRi6ZXAMhOPx6nt/47GxQxRG0iK\r\nXq8LitfzWC6Hs4taz7oEMDdMiAgLAy6LLXTmDL3PBQM7Ap0QbR0iBolwFScV\r\nQFCaMfTLfMZZYEw9KrkbHON4j4DIqIBQGjd2jZw7YgNvQ1RvCwCO9RJYND0P\r\nC7OS7MnBllYMG4+LUTYqTVskuYDiCUkI01WyNYkTa0oETN1tVh3i2jq6REV9\r\nPGRaTiR9HYdeI3oPiv6NPWPA8hfP0d1dBr7w4mezqbXVFl8bgTz2moSKLoTI\r\nWaZomXg07mcMjA2SVTUofc1QDo+CaFkVSfo=\r\n=b+sj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e7550e10d6a01c606a6dd78c58c4ee6e44c3f062","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.304a94e8b.0","@material/rtl":"15.0.0-canary.304a94e8b.0","@material/base":"15.0.0-canary.304a94e8b.0","@material/shape":"15.0.0-canary.304a94e8b.0","@material/theme":"15.0.0-canary.304a94e8b.0","@material/button":"15.0.0-canary.304a94e8b.0","@material/tokens":"15.0.0-canary.304a94e8b.0","@material/animation":"15.0.0-canary.304a94e8b.0","@material/elevation":"15.0.0-canary.304a94e8b.0","@material/typography":"15.0.0-canary.304a94e8b.0","@material/feature-targeting":"15.0.0-canary.304a94e8b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.304a94e8b.0_1678394779766_0.9072551741058883","host":"s3://npm-registry-packages"}},"15.0.0-canary.6c265915c.0":{"name":"@material/tooltip","version":"15.0.0-canary.6c265915c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6c265915c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b3f12fd241835f6ac525012349bb8fe1fcf072c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6c265915c.0.tgz","fileCount":36,"integrity":"sha512-qM+dTiWkSRXaL/B85nj/Jk4xJ38yle5PJB/Bx/spbQRrf3VSmTss4VFMvG9RF4ZzhIK7FhPyqRo4IuM767SVog==","signatures":[{"sig":"MEQCIEq5yc4dVa57IEmA5sr2Ny4AMk58ld6Af0I9JUdVt3xuAiB4TA+GEK9TYWQXV3NtIhgM9Di+pkbqBSmplvfrX2WZqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkClQ2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSOQ/+O1yewVXvusf8ghi9Q7KFdtQ9NCVuEjRLx0yQw+pphk84mebP\r\nBjqIH0t2H4B/oqV7FGc0lriTexLOuh75CvmDfn7hRhn19EuT7ZIfkEKp3HMQ\r\nooyAAlIMWLtbLnKeswa9nTx2/tOCIBc4uLfVUBrtcVJU024cQDx7SkB8VXH3\r\nzYjVNRQPY+RIl1IQ5Mz75L84vG5kA7kj4yk7qzrdGCobaLcZFWYTKBGnA+iX\r\nKPAFrDo5edVN9L9DvoRYWoIod9Qvq5D56XOOUkV/st9ttGompnIJXGHO513u\r\n4xcEFpkuELBkhSvXsM8I5Slgg/uOv8uTxAjv5GXloVhfLPGfVQ/sAG7hIfPx\r\niepFnWkqxnu6h1yi7nwOKZYPFNXvHphl6bymB56m0/QuIE4dzR+GmaPJTKuS\r\n00VmPvgBdUBlCeDCZjGvMwD8RL60ZEYk18ya18KjNCn6PK3yLkPRY0P0h1v9\r\nSJmyOnfyBvHjMgZVgu7eDmvt7Qn42QvlYGKLoyPfLm63yMFnJxvz/yx2bRNH\r\ntTIm/53XB2R0y7B0rITdwvTePgYC3qeaD5tg17VRiR15Mt0wQw/EW9GfT/yh\r\n2Hi3/2+QjNEKQ0O4CyQq3ntSJZNEy2Wy76+vcAbOfyef1ZeqTyqBPJ8+3A54\r\nc+jMcT/CHPJe/RxuLYEpEAITeIbJqLphH00=\r\n=8IqX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2226d2e658d88eace91ac63729977eb6bd7a9af9","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6c265915c.0","@material/rtl":"15.0.0-canary.6c265915c.0","@material/base":"15.0.0-canary.6c265915c.0","@material/shape":"15.0.0-canary.6c265915c.0","@material/theme":"15.0.0-canary.6c265915c.0","@material/button":"15.0.0-canary.6c265915c.0","@material/tokens":"15.0.0-canary.6c265915c.0","@material/animation":"15.0.0-canary.6c265915c.0","@material/elevation":"15.0.0-canary.6c265915c.0","@material/typography":"15.0.0-canary.6c265915c.0","@material/feature-targeting":"15.0.0-canary.6c265915c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6c265915c.0_1678398517903_0.7002561203602775","host":"s3://npm-registry-packages"}},"15.0.0-canary.de5224633.0":{"name":"@material/tooltip","version":"15.0.0-canary.de5224633.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.de5224633.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ebbf6b8051d12247c8e75e103b7abab3be4bf3d9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.de5224633.0.tgz","fileCount":36,"integrity":"sha512-sog8npqqaQMP/o8H29E2gtM0W9co/EN0X8znYixSiXEPxXqg7uoMMkzvhxOow7CM9jvpZz0W8OVpGb0vomhG0w==","signatures":[{"sig":"MEUCIC5dUjHpTh2ZN/9Hp7MLcKRKS+JT2Cdv7jfT3rIr8YoRAiEAzRkdzx5ZDW2qQLK+F/ljZ2WbBQZK6BClw4d+ETY3G7E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCnJQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNLg//UOxRuI2ne9avVDjRdeqxw5EvjWzKiILSMcBF4svxiErs1/kM\r\njFAf72604+13BMGruWK4va+trRVPaxmBHzF97nX9/alZo2pNaX1JddHPwepU\r\nw5B90+0/AdkVWnz8S9Jk2/ZLhj0Bn3F07qZd5daRy+9imfGLplZ+6clBAtL2\r\nOIn2ews+C3FvAK6cZD1Bme8K3Ug0a/9cSaroi0zUEjnkWs3RlBVive6DNlt2\r\nSfSJ6zBTgdNwBE5zI6Mbri5WZhoX4oWg6eYYbjG7RFa4120Jc/EQUByDgrEU\r\nYrtqWwRpCtAuIlxr7Ro0iAmr+Pze7WuwbN0UKpFoRzEUu+aU/Xb1yUuRwveB\r\nnr4TBvQq/jW2AUWkZhrvfHK+KlGs9w1qK+JzRacOQjik0Qg0Bu3Pq7pHpzVe\r\nIgMR7Bt3bJ9NBUmhpNHKE+3CiaY5U/BwZA9yFFu5bp0ubsTRPaXtRqHbo1lb\r\nD+xbwZICd8aHsYhrDFcTDtCHW9E01qqatyfTjjZuoQGJdQIOEyuB4LwoZzAV\r\nFHpSqJANMZQ0+9pLfLIVN8JB3tk9DO+xEvFy3WyqNTW9FSR1cjuu6Q/C6G07\r\n4wqg7YnUKbhaGjKjHCExF6D0y7BN+ZLuyQGTqTXTD05Wa07VZDE3DucctLtb\r\n/5GL/QecZC+nLHE8CcVeVMm/IGnD5nTwxvY=\r\n=+n0F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"994c620135276cf7948cc54b286c6c306c3ac01b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.de5224633.0","@material/rtl":"15.0.0-canary.de5224633.0","@material/base":"15.0.0-canary.de5224633.0","@material/shape":"15.0.0-canary.de5224633.0","@material/theme":"15.0.0-canary.de5224633.0","@material/button":"15.0.0-canary.de5224633.0","@material/tokens":"15.0.0-canary.de5224633.0","@material/animation":"15.0.0-canary.de5224633.0","@material/elevation":"15.0.0-canary.de5224633.0","@material/typography":"15.0.0-canary.de5224633.0","@material/feature-targeting":"15.0.0-canary.de5224633.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.de5224633.0_1678406224514_0.7629440340400959","host":"s3://npm-registry-packages"}},"15.0.0-canary.8879557e6.0":{"name":"@material/tooltip","version":"15.0.0-canary.8879557e6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.8879557e6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5874b87226f3e70765a6025442b9ce6b670f66c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.8879557e6.0.tgz","fileCount":36,"integrity":"sha512-GxSDWUN1oSbZFGcis1R3k+uaxSboFuC41GBv1Kqy5duFIigjpMD+rTylKTs54vUZ9PTP4bGprlamod3A0JPoaA==","signatures":[{"sig":"MEUCIQC0ufsoG2z06E2IgcK/CAKJUb4B9hyAV3EfYUoO/8vIBAIgVxZapX2dw1x85SfmEJLL9q8rKY0gKMwB6n2U1eGdB8A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCzoKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXGRAAnhoOZ3QRzavSWJR41iIuifys3NxGmbJNqFev/4fBFT/qR4hi\r\n3s3i6tqcyUuNOgDaJ20FaIbbf16S31VwCcu4rkOFfOYKDiENF3P/GeNSX1eK\r\nSdBApcZkMZpkmBLoG9/foOv910s9fotwqFR50axfjPcvbfVfSqfutj/uexPh\r\nrkK/WhYv/LcLQ9drZf6X3YMwvE1vNp1fPuQyZ169vQruNG6nmjXJZ28CVZB3\r\nq5aFpWbdGJZXnKv8CqVi2jOYO2z6gxl3slHWZmgRNmCvx02fxAIn279S6apF\r\nw10jORRNHRykklAzXkygGTJ3llCf3jbg1/Gy/QacnAqdxm81W82gHauObNSP\r\nAOToSmDE6Kn7rqhukOePooehK95TDrf8OOPrNPzj5YPj76jBk31Bvtkl0lm3\r\nj4gLNM0otjEmATb80FdHy8ETKVE+89IYfhgAUyYY4XfBSuXmH1/oPLs2lIWH\r\nUZuFpX0ajdM6qyUpRsshHMBSONW0PtgTgeV/TFoQvW7ifZm1ODszOCLSiQWx\r\nZr1G+bjhiJEVhOt3DeL1zA4SRvStsnXLyFV+xYLB8PmM46cL4BV0IQXdooBj\r\nwZJngef+CLHQaKR8EVkeRBC9prO8Ahmv3VJX+T8hKKlTI2Qi47XUT8MY6vgX\r\nhRdMUh/VNNoT/BiSG4Ec1ihz6LneHSMHZEY=\r\n=eCMf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"28f7c223e2bb4a686b970a425d14b1d1edd70546","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.8879557e6.0","@material/rtl":"15.0.0-canary.8879557e6.0","@material/base":"15.0.0-canary.8879557e6.0","@material/shape":"15.0.0-canary.8879557e6.0","@material/theme":"15.0.0-canary.8879557e6.0","@material/button":"15.0.0-canary.8879557e6.0","@material/tokens":"15.0.0-canary.8879557e6.0","@material/animation":"15.0.0-canary.8879557e6.0","@material/elevation":"15.0.0-canary.8879557e6.0","@material/typography":"15.0.0-canary.8879557e6.0","@material/feature-targeting":"15.0.0-canary.8879557e6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.8879557e6.0_1678457354586_0.3070202692878614","host":"s3://npm-registry-packages"}},"15.0.0-canary.23073a303.0":{"name":"@material/tooltip","version":"15.0.0-canary.23073a303.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.23073a303.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f19ee64e3271c8a3710520f755601b7e39cd0fbf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.23073a303.0.tgz","fileCount":36,"integrity":"sha512-ZiN5DNW/9oJARsTBJM40oItjTpr0XuD9oflmsDFsxXk4xGkYBWwwCtu2jesP2mTqZdQvKoCyQ5EFZLwfZrQQpw==","signatures":[{"sig":"MEUCIAOlmUsau8JLiz+rpN7+oal7TSo29dJXLb0wtyZWdy/uAiEA74mNg42PHAavITFMbcBK5k0sk0eHS4N8dWdoT4zrJoU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCzu2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2aQ//SltwQbunBkbStOepI+Cs9sXhXqJhzHhvXejklp616SdqGWud\r\n3aCMUsewV2c45W2nbUdV8+oQMyVlwpzXNP+/VwmuOhPMH+Vqahu8nDo2ZkJH\r\nE+KTVuIoXcKJ1ASXRPimQS9ODutoskqPblRfFa6mFH61l3jh5HFNIR9wZVHD\r\nKMdEXfsWtUviwNtvsl8OzLy7A11FiITa83/HZBIuZmuAcMMv9VTEML0bUpnp\r\no1hE04BTwyLBzJGishUNb4728OLWcbpeja2P8dRWoXjHDuUOMPekYbrbZ1mf\r\nOaBN5rNhf4OH1D8OfgP4b3i6+1jEklHG1BHBxh0l2FCG6eQ3SS8eyDN8k7RX\r\nmn0H6FjFh2GjtKb/hHHsT3wxGRw2U6FDVll7MkrLwRBG+l9tTxcrYUcPnDhD\r\nKVRzLu9xB97JKWWe5+7Gdqv7EEB7auZ9wExuP6L480xVCbNy/FzuRU9WIquO\r\nQH3wXDLAPS01BYk4Vf1CaJ2uzIiMvnEyknkCPJQn3JcwalgDAKkl8noQEoDe\r\nTUc2xPXS6KPlNZeJQTdGwr6Do/UKXnIDwY0QQTCR9cde/OvvK9jUgeiJiefM\r\nkqvMGLlLgmwaLATwiBAu/HkdKIaVeln2GRKMWLENKXVxKQg3C82noxZIVXb9\r\nK0k4iRAdkbI6CTdbj1n6+MJBtuYFeiFuUkI=\r\n=iMKF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2d7826e2ebf1c1fde12f47b603e66ec0df229a8f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.23073a303.0","@material/rtl":"15.0.0-canary.23073a303.0","@material/base":"15.0.0-canary.23073a303.0","@material/shape":"15.0.0-canary.23073a303.0","@material/theme":"15.0.0-canary.23073a303.0","@material/button":"15.0.0-canary.23073a303.0","@material/tokens":"15.0.0-canary.23073a303.0","@material/animation":"15.0.0-canary.23073a303.0","@material/elevation":"15.0.0-canary.23073a303.0","@material/typography":"15.0.0-canary.23073a303.0","@material/feature-targeting":"15.0.0-canary.23073a303.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.23073a303.0_1678457782336_0.5247826195087595","host":"s3://npm-registry-packages"}},"15.0.0-canary.51c7d4014.0":{"name":"@material/tooltip","version":"15.0.0-canary.51c7d4014.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.51c7d4014.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"fe4cbde2a47f033b2e3db8a6a9e8175ae0685bb5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.51c7d4014.0.tgz","fileCount":36,"integrity":"sha512-z2Juhws3WsUdhr21O11PzC7B4OTRe0aduLP/1RZ40846tB0LcQopMPUgtCAq5XD8oRNgZ3A4J6YtqTV0Ezz76Q==","signatures":[{"sig":"MEYCIQCtfA3U0uUSFvrEUj56CsamvWLCYsmV0LfAI+C54kP/AQIhAOIX5XgPnQjDqGVXluq/d/xQPgXq8LSeB/vw3tvts2zm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC19tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqz4BAAgt0Bl2gZ4xLG1ZJVEYDG3CE6qJPGAgE4msTI+W4MXANq1mMO\r\nTTKYR+3IzvzJjXPxQUswa0YsYr40nxmRaKJIki2JWZmbPdla/qApJwxA4SKB\r\nHZ9FAqrqv0VTmQ5FSzW3I3dnLUrZ+R4o8J8bahN1cSn96Th1tuMKlfsunq4E\r\nyh7iMgio1RjAmfy8GzZay+LU8XoIg8yeh/Z5aFGoH2z28Y4+9OfV/zhjBQff\r\naCIVNZnAabw/71abFMd9tj2EJNE9MjglqFZiPAvWyoXEtB7+Vxpw6K/9vhiB\r\n01btD00uda+XDvQCVX3VpBwHh4R5GpnqN3LPOl2UKj6xywIEDNAS0a2GuagL\r\nsSLYXG9/8EzgihxZ6C8Oq4Ex8gSRnPRatKG9MjSto+aflTkM0EfuaJBUApoU\r\nhyt7Agp+KB5K1FPNv9HxuHf0y4FUzZBmWOA20ey8BFaxdMK+6HPpW2ptn8pe\r\npVsJ51AO0nVDgm1IyybXAuIW878uUZq48//8TE5U/kGuDMyrK115Rba3xQdz\r\n4FG1Owa4zrPj99JF9RPQc2Cbfaa5+WaiLbSbSWPrMXuc8AAOlTbLFydbSpYp\r\n2/SCwumfefEgXcxPyP1duxPjUVXXpvltFkMldy4EVg0FIa5FeigwbMKSpyb1\r\nPV+EwEHpI47W3vRAwezC7Otc5nSPKj0RQHg=\r\n=xQKn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0485e6059d69163f12d83408c09b1d41f6cb8dba","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.51c7d4014.0","@material/rtl":"15.0.0-canary.51c7d4014.0","@material/base":"15.0.0-canary.51c7d4014.0","@material/shape":"15.0.0-canary.51c7d4014.0","@material/theme":"15.0.0-canary.51c7d4014.0","@material/button":"15.0.0-canary.51c7d4014.0","@material/tokens":"15.0.0-canary.51c7d4014.0","@material/animation":"15.0.0-canary.51c7d4014.0","@material/elevation":"15.0.0-canary.51c7d4014.0","@material/typography":"15.0.0-canary.51c7d4014.0","@material/feature-targeting":"15.0.0-canary.51c7d4014.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.51c7d4014.0_1678466925548_0.05774121666043941","host":"s3://npm-registry-packages"}},"15.0.0-canary.1175a5be0.0":{"name":"@material/tooltip","version":"15.0.0-canary.1175a5be0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1175a5be0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e2d227c30d8261bba65f2086ace6b99fcb5e33ea","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1175a5be0.0.tgz","fileCount":36,"integrity":"sha512-hc84DSEdZ64p9OOpNXXKprf9O72muIBcoukTeMn31USjqX5hCopbPMg5tcSODnGanNHT3k5VAObqIFcreeTPDQ==","signatures":[{"sig":"MEUCIQD/MqbuuD3xSTqyQ9Ek4kdSjoJfOXtUShwcM+eLNKgBygIgLKHqU39WdrwcdlaiqfGPt4SBdD6DK8UAv8utcpCoy6M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC5fRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3HA//YUf/u3NklQoHayMZcQeNRH+WEvpu8Sp50YbqrimeOej2feQh\r\nJduYyNIEF7FCzGR5N/mw0/jfTUilOAwWmTsEltvx4l5aMMQqsTDe1bW8RNj7\r\nxt52uY2f/mfCBAJDTgYnUvoFCYo5e8KIvHtZ8FPEw+nu8ezd5PiQc9uNZDP6\r\n2tL42eyFS8Ov2K0larHVxyLMR5TBJ2mBwy1vM8mbvoqoNmrIg8H/Cuzvw8Wn\r\n1JGHi757dgtjVnMwKdosNLx1O5IDq71Pdr2qcIf6Ib1F2bgNGvoozZ5ssXQ8\r\nbGl/ZYrq8I0LqEWLMnFmAaTiY0n8oZuWMX1lVfybX9FztVmUDWDvocn99anZ\r\nV/uVPsvlIKIFcWREJ2U+8/hMddI2qDIXP5Iuh2UOENkA3ojj5M9RETxAS+Ot\r\nGKmGbMYufiV80n2Lo+tJ9z+aiKEQ9E2/VAhSdrh/keKimMhUruLFMOnwOKTa\r\nzrf8MxPy0DKtrz50VyCaTKEz+d2FtWFIk6SSLj8H6wxGyLxw2gdhGcgPzfjS\r\nq/g68L+TX+2HQaBtuOKmDCHZxCWOJwTRE2QtyaNcLylrUZkNKOhF0+T6pDqp\r\njm1qmU4X241AoOvQZjsVKEtp/N9a2BGxnFZFmB3cPP/BaibnGN1iR6ZA3vts\r\ngtggF+ZfdhG0GIF/9EPdiA5FtlDSTnlEpOE=\r\n=PBK1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1fcae3e4ba7c60c6a51ee8e61b01e26a324b1ab2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1175a5be0.0","@material/rtl":"15.0.0-canary.1175a5be0.0","@material/base":"15.0.0-canary.1175a5be0.0","@material/shape":"15.0.0-canary.1175a5be0.0","@material/theme":"15.0.0-canary.1175a5be0.0","@material/button":"15.0.0-canary.1175a5be0.0","@material/tokens":"15.0.0-canary.1175a5be0.0","@material/animation":"15.0.0-canary.1175a5be0.0","@material/elevation":"15.0.0-canary.1175a5be0.0","@material/typography":"15.0.0-canary.1175a5be0.0","@material/feature-targeting":"15.0.0-canary.1175a5be0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1175a5be0.0_1678481360945_0.9744364174590816","host":"s3://npm-registry-packages"}},"15.0.0-canary.7adf3af80.0":{"name":"@material/tooltip","version":"15.0.0-canary.7adf3af80.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7adf3af80.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"825e0e3fb1264e51ac801e398eaa903194a5696e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7adf3af80.0.tgz","fileCount":36,"integrity":"sha512-6t9KKY3fH367ba9NU5Rrho/Qonkh4ZbviaJX8l5hprRh5TRfrMb+TxXqxBN8PRetLhSgcgInNWKCcfsREBAeKg==","signatures":[{"sig":"MEQCIH1VX4p3nEb3pnY2BGrLi+yoA6V8ujNLHM9jQFdMJwFuAiBFljC1zd1aaBIgfCwrsAlMkEBcTz9DHYzyHNAjjYuxKQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC9i5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXjhAAiiOSkSsqTGrD8Ztykmiya76F3RPCj+b61Jqv4sWvTINeFZm5\r\n3aaE7lKwArH4vHfY9gyVvSsfCsxZsz+jZIyVcfWYcgzJkUlWr+62OhHSSypo\r\nki+oDPjR4gOWYSYbl8pIRC4S7c9uJ41h2w3etIq2lM79w1gQ1Y2WnABnz8ve\r\nYnJ4uYzwQg2j8Lt4J2QnHMo+lT9/C1c/VS5uhABeLKUu7JsOTHOM8UHa40+b\r\nYdD76CZ5R3EwU3bCBmx6PDFcniM5/Rjl897sUCl6nygsjxTr/LuVuMk9dgAQ\r\n7Hkt1Nz59OxzevK19WA43ofm2tMrAx12WIzCxSUIq/o/BbDj3lxaEjx2MA+V\r\nihonCjmoxoxVhTV64NjztDaL+e51lPzM8LzhtxtaGLGEt+ivj8ol9icsHvHZ\r\nfdsl6T2fqUJs9FTLfBLAlm97eNOIuZG9KhGPUxm+rPjERz9cnajMgS/R3ZOG\r\nTROgqD0++wzmYQnpeshEfkknlnnFRMou+11Trpghd2qoapZk/T5KKMVkASJb\r\nF9TmKkm7HcsFHBZkzp8OFsk75gh7kZmH7YWwuXcoINi8FDquPGZLG8sw8KD5\r\nFunWcwA87B6h3/DaI695Wg4+SQujO1Jl8bC05KJfGbJnya/obU1wjfd72Uh6\r\n4ewemwz/On7yo5EypeTSHFV1o55Be6MFhjE=\r\n=MpYR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"57b0835838a903c8ac3ba6c8edf79add958481d7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7adf3af80.0","@material/rtl":"15.0.0-canary.7adf3af80.0","@material/base":"15.0.0-canary.7adf3af80.0","@material/shape":"15.0.0-canary.7adf3af80.0","@material/theme":"15.0.0-canary.7adf3af80.0","@material/button":"15.0.0-canary.7adf3af80.0","@material/tokens":"15.0.0-canary.7adf3af80.0","@material/animation":"15.0.0-canary.7adf3af80.0","@material/elevation":"15.0.0-canary.7adf3af80.0","@material/typography":"15.0.0-canary.7adf3af80.0","@material/feature-targeting":"15.0.0-canary.7adf3af80.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7adf3af80.0_1678497977291_0.9293805147802667","host":"s3://npm-registry-packages"}},"15.0.0-canary.82554d770.0":{"name":"@material/tooltip","version":"15.0.0-canary.82554d770.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.82554d770.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1211067de8b704edfec36b04e357ae6b846cf48d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.82554d770.0.tgz","fileCount":36,"integrity":"sha512-WkXFV6OkD5MnyAE/0pPh4dxOIbT87DXwQj69lNBSdiioRLHeDhD1lAl9N49zUAvTUArzjA8B0gc6lgdS1iPJew==","signatures":[{"sig":"MEUCIDdUcUxQG42POI9R/CToLKe49zYGu8w3Kp5t2dR1fatBAiEAyKakSMxhk7hhrlhzcliyuCrH7qk0caNCaAnPEdinvC4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC9uYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrc/w/+NBnw5eycAUM0gAVWzMxir48ZbeBj2nig+Qq1TZUBGooUchlY\r\nLrI2LJGCApIwLgUuYeqQusZXW3UgbO/0FC90h9ZmUZsOfPtyWM5EEobq0aP5\r\n3pm2rGk2NIloXRTKSlwNc+UHgDw9zVG7/6GcC87siYNhqi07cmkdm9kofbyL\r\n694l9WGN1WJFk2dkFZGLPw7You5kK30xxOYxoioF1lVXCVdZ0kF5ofdsi1Ae\r\nqxpEzWWF1yb4fRFnNI4tEVmQI22wED4rYykYfIY0xBQSXbOSTi+RXTL4ObOy\r\nGiQdxkHe9wAz/lh4bmCbJtUgpfeiYw43t2EfN6XttfrBOOeRm0I8CBvd0jhF\r\nLKhfVtX98s65GWK9RZ5dmo1PZrCcq1P4PxJ25GwCSP+N/3lbEptsc0/D1K7D\r\ns1ZzWIvZ7+3Uk8INdpmV0BLr1vZdH+hLprgu/TKipJ468Sqwfk1bFnG7lN1S\r\nPHIgwTY9GMlN5sttVvmzzmho3aAb0qO8Cldd7y1Vs26UQgyDnIj/dE75NHDh\r\nRnne+qhJw1d3gbsDR4vJM6NuWeXGFwdbNv30fVneX8WGG7Trc6NCXL7eeG0T\r\nv6aPgYdQhLz6ZUTPkWxxCGLIbxYZKN95s4flhePIZDn5y+WBZN7BXDn3ku4S\r\nPELkFoHtxbk1/1pLGBBRS5JL7qXfMS5a9eA=\r\n=KTw4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"500cec655918e97ee1edc3c86ebccdac24a28f56","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.82554d770.0","@material/rtl":"15.0.0-canary.82554d770.0","@material/base":"15.0.0-canary.82554d770.0","@material/shape":"15.0.0-canary.82554d770.0","@material/theme":"15.0.0-canary.82554d770.0","@material/button":"15.0.0-canary.82554d770.0","@material/tokens":"15.0.0-canary.82554d770.0","@material/animation":"15.0.0-canary.82554d770.0","@material/elevation":"15.0.0-canary.82554d770.0","@material/typography":"15.0.0-canary.82554d770.0","@material/feature-targeting":"15.0.0-canary.82554d770.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.82554d770.0_1678498712188_0.6364747009217429","host":"s3://npm-registry-packages"}},"15.0.0-canary.93fc524b7.0":{"name":"@material/tooltip","version":"15.0.0-canary.93fc524b7.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.93fc524b7.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"98649725df842392ea6310f52b9d4f66014457c1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.93fc524b7.0.tgz","fileCount":36,"integrity":"sha512-3RL5hrCXOlQFlrdYSdPkJGtYmOPwZ7HhhTSkXo1gckZMHC6WXw3EPY1v8liAWa0a5cW4IurDyGNvFziRgBXUmg==","signatures":[{"sig":"MEQCIDlRE76BZtqLI7Px6iXeLdZDxs2sft/12N87pmn3hjQPAiBMrtWJQ6ELvkSC83Ia49DqCJLuaa3X1K0d2LRXDH2q9w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDuF0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcrQ/9FWr7PE1i4wqyBnZQfPQ7sr4yawMT3N9MaXUtfzKKSP+9id9H\r\n1J9T/2J4nLrC82hJdKFbMPt3NQnwBK0OjoEQkrznqQlyyQYE0wynh/cy6JLj\r\n9C8yLgz7dS/OCnJe1zqLCwRwqyPFA0PI0zabfrzVcotJWknamxzPyBdbl49z\r\nc3WSVFsm1thuHWJSlLE5xP8dH/2J2n6qLWBU/a/ikxp/Xf8cXRDFrlJqn47N\r\n2iHvojLUw2F7uJNsBAI9jlZoxfrLV1MWfaMFNHxWoPWQCzJvVI+rA+C3EioU\r\n7xeIf6WcylXGxisdVHq2ia5c6e54w4CqkcxSTRjVq9+2wDWgfM7i3+RiWQ97\r\nQH795ki7UPZg2uFgTV5fiU2K8tu4lklAhhs8LAmiD4nyF0QXG8jIHVVwjSUt\r\nApiFz10FAqFlGf78iCWhiBFv38o9v5nYnFwJ2D3gcJOD2CgQMzZ+fyTsEAC0\r\nC9qiKWoqoNHeR/RNEuLCBefinPNry9OYdIvyM7ShL21F9vOM5qq//c2xmQfz\r\nPs3e8sYbIzZAF0KC2EHxKwVfhRL4EubvGhx0I/p2MLJh3OMhcpg+MFjLr+QT\r\nDQGk17KW2RUNxVuASAOac7gMPfXawi/tPIDR/hYsRkkvR79HkGspYvLawup3\r\n2fzOFWURFVdeCsRQXr9BoAWccey6uv06KZ8=\r\n=NUGu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"338daa93529c874da1af6eeb4fafb935e014e096","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.93fc524b7.0","@material/rtl":"15.0.0-canary.93fc524b7.0","@material/base":"15.0.0-canary.93fc524b7.0","@material/shape":"15.0.0-canary.93fc524b7.0","@material/theme":"15.0.0-canary.93fc524b7.0","@material/button":"15.0.0-canary.93fc524b7.0","@material/tokens":"15.0.0-canary.93fc524b7.0","@material/animation":"15.0.0-canary.93fc524b7.0","@material/elevation":"15.0.0-canary.93fc524b7.0","@material/typography":"15.0.0-canary.93fc524b7.0","@material/feature-targeting":"15.0.0-canary.93fc524b7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.93fc524b7.0_1678696819865_0.7023809106182135","host":"s3://npm-registry-packages"}},"15.0.0-canary.50be0fbae.0":{"name":"@material/tooltip","version":"15.0.0-canary.50be0fbae.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.50be0fbae.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6fcfd5fd5e9f1eb8fd9a413c55d21c7552449d9d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.50be0fbae.0.tgz","fileCount":36,"integrity":"sha512-6P3PGOUXyBeayBJ6CJkB15lO+g/yTee/JoFGqBw+DMRe3dlAeb420Z0pZRTh7eblgWKkCXIda1Cvsv/p9WlTAA==","signatures":[{"sig":"MEQCIChoJ8V8liqcRyLDYSN5VnB+Wr+ZBIU9/1lja81bHmMFAiACyObyvE7/aova+k4vn2a1Z0GlqUBx+vh2tB0e7Sgomw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD2E+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBEw/+ONVBtgU1Jvg4ulSLSkkoVRQGkzXGSOAQcQReczBt5a2x4oWl\r\nmmhlYnc1DEGGUssA0ORlWPXCCivJSup52kQxfTAIjk7YIAPvcmZUwero2wq0\r\nD9r9B7GCFxphRM8aWjNCd6VICQZt/9EkrJFIxUkwV6tBWQxvbBJunXHyjw/d\r\nnynYigQY0398A4jAxzpELAH/KIYqrydOw+xORDGkRpxP1J5BnginuoVGxxQB\r\nYaO6GkMhevUSTvhFealkaPHu3nANx5fgE2Pn0uveK0ssJoXJ3U8Mde+wkjlj\r\n3DWgGcMSu0ZKFyt+ml3XkdByMo8O07fYA5kZ7vOh2Hpd/zOxnZAGfh483fuq\r\njzCq+7xG0Va8nfgK4asTq6OszIDrcWX/vHtVh0zmwvQGg49vLbMNtWELdflp\r\nnRXEJo9q/n7mkLxnlwUr4SJgvgU2P9Ca9YROTh2khBSBNzYWuv8PPOLLnMd1\r\n2hXXDfXOBoxwar4IR5X1g0pMz4M8HLysgrDAOn/vO8BICKaHg78nOGhVXSeC\r\nLZJ7OG7h0uFQBYjTdLlWlo/Zp9B2KtrxZmCxiOVjJTvZ/xh5dpgoeUUVbglX\r\np99nayPtrqU8ORkoiKzU9BsNymiztZbBIYofMxLn/7cBYgLN2/pXz/XEyreh\r\nPeAO7aMf6+dpeHWM0P0AGKzYd2Bx2ALwPyc=\r\n=TuiS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"405d98c2882461cee8d47ab1b16a4666ccf7129c","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.50be0fbae.0","@material/rtl":"15.0.0-canary.50be0fbae.0","@material/base":"15.0.0-canary.50be0fbae.0","@material/shape":"15.0.0-canary.50be0fbae.0","@material/theme":"15.0.0-canary.50be0fbae.0","@material/button":"15.0.0-canary.50be0fbae.0","@material/tokens":"15.0.0-canary.50be0fbae.0","@material/animation":"15.0.0-canary.50be0fbae.0","@material/elevation":"15.0.0-canary.50be0fbae.0","@material/typography":"15.0.0-canary.50be0fbae.0","@material/feature-targeting":"15.0.0-canary.50be0fbae.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.50be0fbae.0_1678729533834_0.94933087967493","host":"s3://npm-registry-packages"}},"15.0.0-canary.6b5ffccd9.0":{"name":"@material/tooltip","version":"15.0.0-canary.6b5ffccd9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6b5ffccd9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a95ef5a51b8e2a12d51b22ffc795e3ee9457763c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6b5ffccd9.0.tgz","fileCount":36,"integrity":"sha512-iiBacbrHm0MSuNnStwr8+nUbC/4oCm85bab11kIbAGmzCFcVYJpS8D7mUFym5TTiOsZgxsL8+v/m6te6dEvThg==","signatures":[{"sig":"MEQCIC2zwWWlJxiQDISuxYp/0o4tTmJv9HoIBO2Mhpa8zkt0AiAaqalg3ITROoGT1QP+nHiogN3wJ6kHqWpfS9T9Jn+uAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD2IKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpjvg//TrjHgxhbBH77F09yjHOSTCNs5wG+v1aVqapWFzuacPT9PvST\r\nRCXtbvTjC9mhV0YMovOG0bh0l2Qo+TtVINCBOSV+mPC9vb5M5/BqWsN2Dza3\r\n9TADMrXIdHqQfZyf3FV3ylV4KLdDu+UnzBc5YlmvoVwUTI7SYuM3YPsv/gR0\r\ndR/yIvI//EkRlj45YAQSLfyxWUgnBLPcuM743bsovNThQBw9XY4pSJLqebI3\r\nNzWPlKXm1r8b5eFc5CUgPfzpeUAbXjox2A95hHnAXu0sPbXpk4ybjXYdrvAE\r\nrrO4I7nK0XocgyAsH9q+nDwEkc661fEytEOTvv5s5zzeMarXdbNmB1eJD6OM\r\nUgG0e8OGOzXVyDr/L/8vHMU0oemGS6dTjPSd7KOY+SSL4gEXf4b6CRr3lVnY\r\nON2jXUgWP4V+ZJxUf+a+L/wQrH48y/8O+he6FXEF6tOHDze4ye4vjCRKS1Av\r\nRytnKOmhzj5XfNyTDlt2rHxYE9UflDMISyIDCCQhpHNphpF7AUIfXp7Ks3nk\r\nA+ira+L2xRi634YYxMyg4fMe1IqjATM13vTLjCSzg41TrIufZkQPWCMONIhi\r\nTQ1S8NzEgPtKTzn/Ke9+ufA5U/EC8POj/VXhDM99IJT5uM4sXQ5Xs0grKcop\r\nJ1GQuPGqMHGubPj92iMehXgfZNrosbOMT+c=\r\n=yy+b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"d30761453fd80caeae042d8999af672f9c3eaa28","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6b5ffccd9.0","@material/rtl":"15.0.0-canary.6b5ffccd9.0","@material/base":"15.0.0-canary.6b5ffccd9.0","@material/shape":"15.0.0-canary.6b5ffccd9.0","@material/theme":"15.0.0-canary.6b5ffccd9.0","@material/button":"15.0.0-canary.6b5ffccd9.0","@material/tokens":"15.0.0-canary.6b5ffccd9.0","@material/animation":"15.0.0-canary.6b5ffccd9.0","@material/elevation":"15.0.0-canary.6b5ffccd9.0","@material/typography":"15.0.0-canary.6b5ffccd9.0","@material/feature-targeting":"15.0.0-canary.6b5ffccd9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6b5ffccd9.0_1678729738643_0.4773696688108473","host":"s3://npm-registry-packages"}},"15.0.0-canary.1c8013f4e.0":{"name":"@material/tooltip","version":"15.0.0-canary.1c8013f4e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1c8013f4e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"faf322636a68a967e99d99678440cc8a8f8cd2bf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1c8013f4e.0.tgz","fileCount":36,"integrity":"sha512-D7sdM+NQA+JBP58AZHkOB0WPqYlTJQwL5kc2JA2F+LcMepY9Bvix3/qEKgPW1vDozFfYaXkqE1ft/bTq0YyKLA==","signatures":[{"sig":"MEQCIDb5IhTxfVRDRk9zJ2mC9t5d1ETw8q++GiuTULIQwmhbAiBw9HwQVuA6porcLQbd7n40HUaApPbpZV8rHC6SPeLxlA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD2WhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdNA/9Fs0USB8240S0IEOl0BEMrPTzAoyg+hG3eIhSx057g0vFlBn9\r\noKUANzFsRw+kE8HDGWxqQmqfdDFmdmRIYNgZeRyGmVuoj0yWSjxe3eclm0AB\r\nv68AZteaC3GUPXsMvEGNsNG0sHbkVPfsbU4R8lSgR9G60HVHC/VcaMtUgFku\r\nk7fKrrtx3R5Bf3Cbn1dAEjmYvs8vvFCudJPqFPPgfNWJfvmSZNL3cCczt5Av\r\ntiNcjlFctesRJ4WWXzgJ2iJk4z13XcWLJq14NmVXVi2IkVEXKtfq/GXfslgY\r\nLO472iZ/yohB8+C5+WwHRQueaptkxn9rHELvmKF63mWbsnBBY7n4eH+4nMCP\r\nlo3bSnv4JiAtG07x0LTmr+OPPOZhvvTCJ9BxbDzwCLw03dQlBMqD+3UbL3PH\r\nXAiWZ8QM6V2iFfbxrculY2Kh7mgUvwRknxMRMyq/pom6kcUSpnZ8D8GBYFMB\r\nC/JliXrkMlOa40IYgI7azqslDdKQxoD+YwHVJRVJMHtL22lydvFKRe29NqhZ\r\n4Dc6A/UjvTs739hqMkk78Uu2nmaSndoKezSouzdyEKb7ymaPblHDjFGklRUf\r\nPmnVR8h5KXOvubkBw5Xq2mjEozla9Y3Xdn4RtKicL+R4zELF0Mvur3OYIXhi\r\ngCC2DctvXfkm5PVG5yk2aIuBX2a+gT/0Zc8=\r\n=xYYB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ce86f06ff0c2637e8cfa4965aa614efa6bb86046","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1c8013f4e.0","@material/rtl":"15.0.0-canary.1c8013f4e.0","@material/base":"15.0.0-canary.1c8013f4e.0","@material/shape":"15.0.0-canary.1c8013f4e.0","@material/theme":"15.0.0-canary.1c8013f4e.0","@material/button":"15.0.0-canary.1c8013f4e.0","@material/tokens":"15.0.0-canary.1c8013f4e.0","@material/animation":"15.0.0-canary.1c8013f4e.0","@material/elevation":"15.0.0-canary.1c8013f4e.0","@material/typography":"15.0.0-canary.1c8013f4e.0","@material/feature-targeting":"15.0.0-canary.1c8013f4e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1c8013f4e.0_1678730657583_0.1429695814356875","host":"s3://npm-registry-packages"}},"15.0.0-canary.112715df5.0":{"name":"@material/tooltip","version":"15.0.0-canary.112715df5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.112715df5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"41e9c2f5c7e64d3f060ba82ba8e6a3c600a0496a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.112715df5.0.tgz","fileCount":36,"integrity":"sha512-fyB3ebJKaqfb4TU+MYEpdrl75E9rryJIQqNVYomOl7pNYwmkUDw/iH2n4nLE7G5VPeyhQ8osuczTAMf6r+bBeA==","signatures":[{"sig":"MEQCIHLMCHZgXykD+pa6p6nBiTtRgGPJ1PzbpB/qV6cNS7C5AiB/fOUOLBe95QxMUyCgEH5lWxA8UFXdMuovqFCewSwCJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD24mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/pA/8DzWxJK2BeZLexroGc6/7Db/kTHpmoURlJRL86KcXVO0eH9kw\r\nU/5lZdZQpZ5XBo6U7m2ss/7UsdfQ06NqBpuxD6skRvLLNAZGdH7+DcIu4Vi/\r\nvST0iytRZK8B4b69lFe65/sGXJ9mTLQIeK0vFbIOG2aqK8T4C0HlP4ZFxJ/i\r\nRZXQNwnAQ83b0HueF17Rz3qWYLDrPASnJbDH7j2ZjwxdMgWPb0gXR04eDBnN\r\natmH+zmjVg/K4AziltwK3dKKWGfcOZ0V9iZvhNbrC0f8Ct+hNT60+Hx88+LJ\r\nv8cBbE7wd2s2hZ6jcl2MuL5/NM/tn5+XP5i6XkfNrad5awqAvUCeIlq9beB+\r\nMVZ3W3DDPiLUFjnKNAoK8KNcf6yA0KQm9XKeD9h1jCKspokEAjgVECunUKQ+\r\nCeT5cmcYA0SAlHVtgs2A0E1ED1rNth8tUWgXTBT5QAxzVS1LPGxRVZtBSk+E\r\ntf3cGztIGvHA0PheZPiK7ZkrZKGDFVvRdPkbrqAHBXmi/xGhG68XlOs7jysI\r\nWWbQwxg0A6jq8x4jth0gYUA6zNjVC1QYzUh1Vo72rzfKM/PWGoblbBHRXtGl\r\nZfBiwDXdYQ5uUoMS0h++/HFlg5dDUDeXZ/XQLKwJGTi5i7u7cKdnBR4bItgU\r\n6aXlJfYTCSWRWfiYlJSGWjNWlH+14JEh7TI=\r\n=vPc6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3894873450b9dff1b92031fcd1d00ed1ec3ba9ce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.112715df5.0","@material/rtl":"15.0.0-canary.112715df5.0","@material/base":"15.0.0-canary.112715df5.0","@material/shape":"15.0.0-canary.112715df5.0","@material/theme":"15.0.0-canary.112715df5.0","@material/button":"15.0.0-canary.112715df5.0","@material/tokens":"15.0.0-canary.112715df5.0","@material/animation":"15.0.0-canary.112715df5.0","@material/elevation":"15.0.0-canary.112715df5.0","@material/typography":"15.0.0-canary.112715df5.0","@material/feature-targeting":"15.0.0-canary.112715df5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.112715df5.0_1678732838570_0.5626046352178562","host":"s3://npm-registry-packages"}},"15.0.0-canary.d250911f2.0":{"name":"@material/tooltip","version":"15.0.0-canary.d250911f2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d250911f2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ce245599df3ae5f35317bcddbc33f8aae1c98ced","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d250911f2.0.tgz","fileCount":36,"integrity":"sha512-n9r8fsHucl0TroC++ksmmBwZEzXJqAhyAmOEYABQ1ny1M7uKjfjIf2BpebK6XTnWYuey9QyS+Qhcmaxr+AfdCw==","signatures":[{"sig":"MEUCIQC1Q3pgAz9dvEF6/wXCaMNquBI9oFUHhX9UTyG4pFWa+wIgRPNrBl9RZsB7QCHfXXAkSbysv1+sLy9y2H2qmsAkmW8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD3pqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMfg/7Burqvi+ycA+Jm3wKmJxlST/lxX3oprM89C0CN3dhsEz4idxs\r\n/82/NkLjqRTQkBuD1BLVkS4K1n1tj40cU6q9SQ5WbNK8iuCETxIwsXZoCbx6\r\ncMlrxa6DG1azBGqJfmh8qSvG5JE7Ji3DQLQ/nwlIsAFwwmhap2TYyjkagmlo\r\nbDIkecCg15dB2eD97O/M4glRoFASohwi9NdUpBF8J/ZTZzkgjb923vzrfbuv\r\nBbmgSNr1e/WeLPF1jwRxXK9XbzCeiKjq9OlW64Sg6M4lcNG3Cf42IGY/iNxe\r\nq2/M0usSvS24zjdyFDXSkBm4furReVgGQWm/1otF/4GJ7EDcVMeaQhIdfMsj\r\nrwSaM0TA/FkQxWZutBCHzKe3jBIqnbKuxNkNGMARya+3eX8FsT+ggteYH0QD\r\nnG4oCnhg12j0cXvevgg3TWexpYD92R6EDFtnDOpCX/CEHl+j+zwu/fF6CO3H\r\nzGsyrd41TeS8B9jJEqHazYNVF0AnZPwF3ay9P+/hosNpAt5KpOZylK4mY4In\r\nYHWa7RLQkUkTrWI/beazDGG8eyF/4qQhOTtQj5UkiOxfj5iS6+mcIlRi1BnX\r\nri/YudEmDegaedRfuG1j1fh8AMJ7zak+AEFdkkItEDSadz2YiiMfVBTXdZYp\r\n5W3aQAXntvSj2EYT70bOoDCfmREiZbVBgBM=\r\n=pe1C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7b4ac246b31922fb4beb9ed168dba262e499c271","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d250911f2.0","@material/rtl":"15.0.0-canary.d250911f2.0","@material/base":"15.0.0-canary.d250911f2.0","@material/shape":"15.0.0-canary.d250911f2.0","@material/theme":"15.0.0-canary.d250911f2.0","@material/button":"15.0.0-canary.d250911f2.0","@material/tokens":"15.0.0-canary.d250911f2.0","@material/animation":"15.0.0-canary.d250911f2.0","@material/elevation":"15.0.0-canary.d250911f2.0","@material/typography":"15.0.0-canary.d250911f2.0","@material/feature-targeting":"15.0.0-canary.d250911f2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d250911f2.0_1678735978396_0.2402266095826895","host":"s3://npm-registry-packages"}},"15.0.0-canary.7cd925c12.0":{"name":"@material/tooltip","version":"15.0.0-canary.7cd925c12.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7cd925c12.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"84da1147c595d9a14fcb10ca702f081259cd63ea","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7cd925c12.0.tgz","fileCount":36,"integrity":"sha512-vNl4OXfh8TsMDyICkmQqNFTP0ZBTdll4amTvQvxuNdYpIkyP88thnM9iZ19mA5ZE+Pb0pR7Ns8Buf/lVJugJxw==","signatures":[{"sig":"MEYCIQDNy2WdUyvWObWZdkCZ013iodK0AvsKy4W40++HveOXBAIhAPZKVVXiCrUT+3Ay5K9YXtz9JreuX0tFk2XRfEg4G3In","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD3wsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqonw//RIrdR7ZWuGBlfO7zepTJO1bRaI/g8FD6E/6iWAaywQntm8Y3\r\n5fjS8rRhMSJRWTgoSV/nNL1jQ+T+7URQo3KYldtN2xK0U+Abx3/e1uIb116O\r\nrwwWfYQ+qd2fRJs2BX6Biad3TOJgPrgP4vCPE/DhtbIND0qvwvcKs5ZtIxmg\r\nM2AiFd8daoidXkwFx0SzS1ePG56aR+nsEoH2lTNzheSCU8i3GfcQ3yAMiUCt\r\n7fiBw0a6YD55/0NlFSATyPhoL7xyOnfH5KlCa05SkwyKRycGdM0EvihBvo3U\r\n/HNIIcJk74q1qA0ddRq1iqJojToG16B4HzSrYWH/dDdoAPCl+ODZnGFxPJcz\r\nCCF0FU4YViZpEam9DMnuCV/XzFfRC2AsguCIcmoiHC6eOSdi0vq/gdYtIEg8\r\n04zYkqfLLOe/eGpOHqDsDQrHs/yHjMxEPjymPCqypJRAEKJMwsyuTB7oYb+9\r\nRG4fsIrJciNLxl0uiWwM82PoOWtviGbZJM+l2+B6fNvYswH8meud2slbay1n\r\nLldL/38V1s5OhOVsOGbpZUmx6OulpkwLGScPt+Z1GqmYEzEUFLdCtb8A6xaT\r\n8sEW92UirAoBA08SDhk1vrHqWqVsRLdJ/1XsmoI/Hsjg39d6Tv8tE0FPgaVB\r\ncN2Kk82ffi4i2xFH8ma+syIkNwJ/gqdiQkI=\r\n=+y/P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"96310a5c80e3e92695b6d6e2933e9b0c82e58a20","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7cd925c12.0","@material/rtl":"15.0.0-canary.7cd925c12.0","@material/base":"15.0.0-canary.7cd925c12.0","@material/shape":"15.0.0-canary.7cd925c12.0","@material/theme":"15.0.0-canary.7cd925c12.0","@material/button":"15.0.0-canary.7cd925c12.0","@material/tokens":"15.0.0-canary.7cd925c12.0","@material/animation":"15.0.0-canary.7cd925c12.0","@material/elevation":"15.0.0-canary.7cd925c12.0","@material/typography":"15.0.0-canary.7cd925c12.0","@material/feature-targeting":"15.0.0-canary.7cd925c12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7cd925c12.0_1678736428074_0.8841965819089559","host":"s3://npm-registry-packages"}},"15.0.0-canary.b2ddacf73.0":{"name":"@material/tooltip","version":"15.0.0-canary.b2ddacf73.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b2ddacf73.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"940ab4e4ebf801a491c8e79485cb04ddf6e06274","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b2ddacf73.0.tgz","fileCount":36,"integrity":"sha512-ZN/wYhsdKv44txHFF5n1wiVC9RVBGEhCkQvLU/yo6lYudbXxJ9RvDtI5fnSLnrecLjGAcowHusbBS8WJ/igwBw==","signatures":[{"sig":"MEQCIBX0clcEz9gc5hrVHuCuQWbJv04bsyPwCwxUvCQvWmHzAiAhWUS1+hx+psGj3XpAHUx1WplglBZJazK5qAUroee0SQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD30vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtDQ/7BBe4K8uYD8fSMMbDaRH8+j3DA0p4n8c67uM1w2bYHhadHeA0\r\nWjBPSTWinMuYeOhxh2e4o8+w/S+FR0Hxt0+IXh6O6baFlfLyWbHUBE4C312Y\r\n92xz9mbQYH1wic8PWYzwb7jD4hShEH+/g87utEhol/AsBvy3tfPttDEAhWAQ\r\nXun4bhqPQFOjvo+wxpOP6yzO5wkLY40r7d9jc3+4rGR8zOfhv3FEDCafIg23\r\nSZsB6Uu4APM3GypLmVYwnxLAzFA/QJMlQcHg8yX+zGIu7mXeGr8igQQZgRq5\r\ni1uCpf1/+HT6hqxnZWFd7dSLz0YWVzFREF5gtr82fEbSx9wusHd5biBrfZbu\r\n7qxY+OPEKXWPcK3dhiL59p6FRysBvI5Fh6cS6TPC/5DRUyfQhOxW5PVMYoC3\r\n6gImgVGRMD+0HBn0EaXziX7Mo/+o9HYVYnwsVfbjULvOfvvr3SE26sRioJPd\r\nXz2bHWwxtPYPyCNY5LHUC/P+gbz51sNSoaKJcmjYFdzL1fQlvbMNWEIb9TlN\r\nwF26fv49vtJwZdtkxNqIvrNLSCCJGgCKNbGaTxKZSPHmQKjuiKtj0PEXYnAS\r\nxRW377XiTLfMvbBzLRKhG5HnAoVE9753O/t7ty0gnYc9oQCPasghYshROvnw\r\nYZfS6WhW+pNcAN4u2SIn34tDLZ89lpm4BPo=\r\n=N9FP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"860a6f0b439760b894931fa6cb354412764bd21f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b2ddacf73.0","@material/rtl":"15.0.0-canary.b2ddacf73.0","@material/base":"15.0.0-canary.b2ddacf73.0","@material/shape":"15.0.0-canary.b2ddacf73.0","@material/theme":"15.0.0-canary.b2ddacf73.0","@material/button":"15.0.0-canary.b2ddacf73.0","@material/tokens":"15.0.0-canary.b2ddacf73.0","@material/animation":"15.0.0-canary.b2ddacf73.0","@material/elevation":"15.0.0-canary.b2ddacf73.0","@material/typography":"15.0.0-canary.b2ddacf73.0","@material/feature-targeting":"15.0.0-canary.b2ddacf73.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b2ddacf73.0_1678736687165_0.29765803392460466","host":"s3://npm-registry-packages"}},"15.0.0-canary.989ae2ecc.0":{"name":"@material/tooltip","version":"15.0.0-canary.989ae2ecc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.989ae2ecc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5189c862f8bcbbe61f11d8f1bfb3cff351db22cf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.989ae2ecc.0.tgz","fileCount":36,"integrity":"sha512-NXShNigNK7ruSvQ5cHd3PfVNawc2PaipEozRGRjWKBWaGP1v990D0uZlNPYPUsEIQ0d+b0j3k7DxvsOBKkUfbA==","signatures":[{"sig":"MEYCIQDxi8GisUaUOxbzODwvTpLyWMOVozIyiFIn6ctPKiRKTgIhAOlOmWhMat+Ed73Uc4Ne6lhpt4FVav5Gm/UYs4iLwRdq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD39aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr38A//ZWBINFdIpq+MLat0TuCcX5VOH2OtB//MBQmtThFbU0O1ARi/\r\nL/bhZ7glyEFccKWB5inGpP7+/UZCcNPswbDM7fivQ7oVGOyU7SDZP6AU1U62\r\n1HR1D5ltAsaz2OaUPoeYK6erhwf6XS//+JA6BkI0tglAnmql/6nYP7Pv38da\r\nvCVxq2HdmR9yXjBH2v53HJKSc0MdR4JpLn+dg0VmnNwKaYqhA3X2ulvc/e3x\r\nzvWBWPAqWDNX2oxfrIBtgu6uVwHmwq6IaRYC1p8F1wFpFeRPPoVMOWbxZBGJ\r\nBV+Z/16fMkShV01vau5SLT1S5M3iV27cXt/HISfbrtdu6SRHeRZREXyxjFMI\r\neHQMA6h7b4Yh2ZLVhz+ppqk/XFXw4bhZD9c8xLc37kFb3ihdUMm1dfmIpcWQ\r\nRccma4nv+vb3f7epSh8R32BZJ4sa47qOKdJGQcDf4egMsyXNgCn1Xk0XGct3\r\niJaSOandjgtSDqXTYKkZPrfkBfxXdWe+LMcAzoEYJg9rVj5eNAqKp3kZPST3\r\nxeXdwW8Z2R5cjxgJ4rMduujxytdjzsv44y94EfcoFRrbkJNaiqyFz3etStDJ\r\n8WDVpCREUmoRbCWdPr3BypUqJ6npwzwaGZTyIs0HNRguE1gmCPZh4HjhouxF\r\nbsWUGuucwvD8l4R2e/6o7JKAAf+FBstHqW8=\r\n=1JX4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"52e0f05ff74ddff1d986b27e08df13644c056b63","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.989ae2ecc.0","@material/rtl":"15.0.0-canary.989ae2ecc.0","@material/base":"15.0.0-canary.989ae2ecc.0","@material/shape":"15.0.0-canary.989ae2ecc.0","@material/theme":"15.0.0-canary.989ae2ecc.0","@material/button":"15.0.0-canary.989ae2ecc.0","@material/tokens":"15.0.0-canary.989ae2ecc.0","@material/animation":"15.0.0-canary.989ae2ecc.0","@material/elevation":"15.0.0-canary.989ae2ecc.0","@material/typography":"15.0.0-canary.989ae2ecc.0","@material/feature-targeting":"15.0.0-canary.989ae2ecc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.989ae2ecc.0_1678737242078_0.6632968890389834","host":"s3://npm-registry-packages"}},"15.0.0-canary.89c66483a.0":{"name":"@material/tooltip","version":"15.0.0-canary.89c66483a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.89c66483a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d5fe18f705636ab674206f9da57689f61a36d0bc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.89c66483a.0.tgz","fileCount":36,"integrity":"sha512-FDt/EF8mk9nXletlCi8hzTJ04XffuFF9ZB0KcEPAhK6KzZ5n1zjD13uIbXeQZVQudqqsu3Rhi0/qG6CXK3Lidg==","signatures":[{"sig":"MEUCIQCbnMG7QhKP1NSvMykcMdZKcf9p0Fzj04eNcp/qtSnTqgIgLPdjB4IHpsRdVgx1Mg+5G5qKZLgJ04j67ZgwUUeddrU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD4TpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7bg//cZCKRWSXlJYt4b+M/2TzAW3k6GWQ70H4BB0XocY9Qda7Tzsy\r\nLGvwQo7vSgdMVcMFpLph2IbMVYPN7mvlaJSh8rMsnqcOSD/I6yKxzhLQnR9z\r\nXCXYXCKkywMg+yn2MiBhO+fL4Y7pWduFkrPyOdzhcCbnJ5vW8FxbaI0+vBZA\r\nyS3+zEY3HWn1+OF+7YU0jo7RGIo69DY7Hvhi8FP8xdZNDB+xK470f4Bnc3+2\r\nTTwd9OJnv7l4U8HuZ10zr4+/T1Pq8lpZe28BsxP6xU8gHp35faJxT8zN5TPg\r\nJ4H5BdQhqe4hnS0I1bNhg5vynyjz57B5A8tsdl9wURQemT0hBMnv4pxpfF9Y\r\nMzNyUqzzop4BAZokfHtXGbrEy1i40cKlWcobbKaKqGhLmBj/FbiUeU3xUmUp\r\n5OnsGkUgzD15EusnzIIUuPNIokKTsz59dQD258Gn0fT8BSkobEayk1/AY//j\r\nsoGRBTlIAZmefyEMaWSmwypxhboZ3i+ZmfbSMKnQX1q23dTLZmittWfqc179\r\nRgXv5xhk8qaivqepD75vlLqNAMUy2bprtWa76SOrUkTWjVeMCvzN7mYDdfR4\r\nFDXWrL0R5v1xwNnlaMneMCmjZeEzsyNuK09g4Yw1opwIjMFeZzLWckyoipR2\r\nOFDkBSVLUj5++OfzJ/vx4S8iD6fus1sa9I0=\r\n=hTUw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1e255ddead4716271020e03e9b0b302eacbc4153","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.89c66483a.0","@material/rtl":"15.0.0-canary.89c66483a.0","@material/base":"15.0.0-canary.89c66483a.0","@material/shape":"15.0.0-canary.89c66483a.0","@material/theme":"15.0.0-canary.89c66483a.0","@material/button":"15.0.0-canary.89c66483a.0","@material/tokens":"15.0.0-canary.89c66483a.0","@material/animation":"15.0.0-canary.89c66483a.0","@material/elevation":"15.0.0-canary.89c66483a.0","@material/typography":"15.0.0-canary.89c66483a.0","@material/feature-targeting":"15.0.0-canary.89c66483a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.89c66483a.0_1678738665563_0.5104534436334403","host":"s3://npm-registry-packages"}},"15.0.0-canary.6a85742c2.0":{"name":"@material/tooltip","version":"15.0.0-canary.6a85742c2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6a85742c2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"573252d88636859eea4367eef28c31c16c867b8a","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6a85742c2.0.tgz","fileCount":36,"integrity":"sha512-RWyCI+1eV3VPPi3kLELLPw8/9XJ2UhMIyEIJjdtaBoE9ITBqcy8GfGAblyTTbZIxjo6p6L1KG+w6hwoi+drD1g==","signatures":[{"sig":"MEQCIELKK0HKh3k+jTCZsdvVfejk9oWQLh3HaVhN9OuD/W1gAiBCrmQHkeP8LMfJFNSoHaAc5ApnkRCq2Amxe51fFBv8wQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD+CJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDfg//QtT3fRWmHHVgEu2gpfMif9kubeuGbdAKkvl899djBZ/lnsy1\r\nKip5vS5qiee5DYnynZVBflelGxutJ177+maz3fa0oSiCS5AcNQovnTHcIdBG\r\nvaJrXyeu8jH7ZrQ0aq2N03DuiyAvePpzwPaHO04REfQbvHbmUTZx3Be7X1zv\r\n8FpS+XdgJ2hG2c5SHNCnolCCDZNqUMzlJ4iCeYwL5pcb1rZ+4BD+T7rBVEOG\r\n8tohseQiSbblbPov46wSab4iAbhOVloNxeg0o8etruQooGfPxPAaOrw2Lj8k\r\niGdD/gTlKXDER7KJx1WWDeLsh88hxuNQCpIBURDJ0fsESoHguzUqjLBM98ZU\r\nAyemtGRJMzB3KP4kKGHJm0sCw+aP+P4zmojieZPioPVUxLTsLMOTj857JmYO\r\nvYUZThPVqCZYDT6+icEjS9ZRgVjgx7Y2NOWXGx1+WyX8VtgbeKw3HCtD4blm\r\nN6dCPjRhL2SPK5g9e78iUejt8tqWXs+Kpzmf6+7UvbBjjGKC44irxQXx273J\r\nChY6QAw0sUaT9u96bOAmfC2VjFWCxt0XZ6X0xJOMBcEJ+LoaXTPxIGRkVvhr\r\nRvW3eL9cyRC0ss9mBbw+9sP+V2xIXwX2PTHnMGoaB73yO0iDrjwDBE6wvJo0\r\nxjDYK9+p8B6/X9E0KZoiM50mNrsZINx52aY=\r\n=j41u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a2a15aaa59054337e585758eb160d9cab97224a2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6a85742c2.0","@material/rtl":"15.0.0-canary.6a85742c2.0","@material/base":"15.0.0-canary.6a85742c2.0","@material/shape":"15.0.0-canary.6a85742c2.0","@material/theme":"15.0.0-canary.6a85742c2.0","@material/button":"15.0.0-canary.6a85742c2.0","@material/tokens":"15.0.0-canary.6a85742c2.0","@material/animation":"15.0.0-canary.6a85742c2.0","@material/elevation":"15.0.0-canary.6a85742c2.0","@material/typography":"15.0.0-canary.6a85742c2.0","@material/feature-targeting":"15.0.0-canary.6a85742c2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6a85742c2.0_1678762121613_0.48379678679483074","host":"s3://npm-registry-packages"}},"15.0.0-canary.bb6cd78d5.0":{"name":"@material/tooltip","version":"15.0.0-canary.bb6cd78d5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.bb6cd78d5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"579464c05e7feb7982c7cd428b1d964cd6f24d10","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.bb6cd78d5.0.tgz","fileCount":36,"integrity":"sha512-z0ZUxNlKoPO/nCh8VDNhvaCCGEhnfUaALGYFVbpl30qn8qnpfHI1P1CEmdKZsDiGmRPODFW6f/98PpEQs9x05A==","signatures":[{"sig":"MEYCIQD/kaidS0hw2P2BUfNXxiyrKAITI04k0S6amOUbu01JNwIhALciJrYeuzfWC0ng2dzYafbPIrtdMsRDOTxYstIGLmRw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELpnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoo/A/9F1jH9x7dToJ9AL3t1ESdiA6isQ1iGhUet4Ydmfqdf0n2jc6U\r\nAoGU7WNKUDGGU1g7pN3Xf6WNiqbKpuxX80My5rN4hi8FuOgEvBS8FauPoKTJ\r\nC394AjNkFbFW3A+I2JlkkfoZYxs56jl8cEwRHBehH9UA8j3FC5b1Ab/vBmBs\r\nRydKXOeYp3afWEh1rSQJpSSvNzZNk6e2+1PkOGU/OxTB7G0zc6nFx6s233u+\r\nH6mXfkLtSCh7eNj0vHh4JXSrcpeQ0n6WzWkIt1mFH0Ovi2kkj587tEabOHUJ\r\nimtfoWaifPUSuUUXx1sic3/Rrc5FUpw4eBZJHxoMgAVR518CidL+Pvojr/DB\r\nQNCRSoJIUwbxst+pfeWIuawJAZO9bv9x7w8Zw/gDJuD3PcYoWIkyEdpx+i48\r\nV/zFb3Ubd/gyufnP7WvByI7oWutBJblCbUr89E1jpFXNZJbK1NqDT1OiiChl\r\nsYW3xiMDMm4z1B/9EqXh4blLNSUTT81u3GtXCotHohQL2rRbXS784ywijUZe\r\n1+IyFbZA74p0dJM5Z092rH0Dq95O3H28+FfDoRnrPI7X5/XTzfX1qwE/b0kI\r\n7utFBihlKDbqZj23pq50UCGhvSPZXObgx1HaP8ppWWoP6vdjDr92A4bNNmZ/\r\ntAv9+XI2QAtXZJ+qbEV0K/V3up24S/JcQzg=\r\n=CMHC\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"fe016d599b297e4e276ef5b37b829b25f0607b93","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.bb6cd78d5.0","@material/rtl":"15.0.0-canary.bb6cd78d5.0","@material/base":"15.0.0-canary.bb6cd78d5.0","@material/shape":"15.0.0-canary.bb6cd78d5.0","@material/theme":"15.0.0-canary.bb6cd78d5.0","@material/button":"15.0.0-canary.bb6cd78d5.0","@material/tokens":"15.0.0-canary.bb6cd78d5.0","@material/animation":"15.0.0-canary.bb6cd78d5.0","@material/elevation":"15.0.0-canary.bb6cd78d5.0","@material/typography":"15.0.0-canary.bb6cd78d5.0","@material/feature-targeting":"15.0.0-canary.bb6cd78d5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.bb6cd78d5.0_1678817895592_0.2306349830596437","host":"s3://npm-registry-packages"}},"15.0.0-canary.5f94aa37d.0":{"name":"@material/tooltip","version":"15.0.0-canary.5f94aa37d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.5f94aa37d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0159aa73ed6721032da8478621d9966f0998a0ff","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.5f94aa37d.0.tgz","fileCount":36,"integrity":"sha512-IPGVzdL94YAz9i3lrxSxnVwQX0ZvQrVB4sqNcBkaBoS9YLjqhxTNk0bMqce1OjT5bEWHL0VEOwvjP5HWONlzZQ==","signatures":[{"sig":"MEYCIQDwT5cCQrqEBA/fWzQJGiBQgdMiyh2XOGizIpk1BzrunQIhAINLxRMre9DFF/Yq0XOl8nrOkxbCyeLcxLz3RQIQLLuQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELsqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNyg//SGaBU8tkIlfeCu9vWOuzyYYJxIeuRmjD1RFjo4SN2R1RS6BA\r\nDiyzgi2HKst2uJqEbLXWTb8NydGXJTXLwTVBWbbaeLRZfUMwcHynLSjFJXVb\r\n1sggBrhQWdhafsM0aPKnVOw5ZZKmBlB7HvHinSNdSTM03GKuY72lRqFViAuP\r\nZorNKI0yyMkCs3+BIvAVtDwCr+I9GQ69fx23+nnB6lt/E/RjpQJWlYIPu32X\r\npMWwT8K5MukSbLRNULQUw5pH1HOyn6ziIcrVitDEhH12RM5zJobPk1qdHqUz\r\nv+K24hgzfa+AJ/i6DizUMv11KU2adFcS7YlA2hf1+HJmXIeSChfnaRP5wTtP\r\naNNVyNX9s1acd4ioro4zqsTMzZJW1XDLMM4QY31WUeY8yXs5t3zvSyLLkLTJ\r\nB+aPWifIpi1Cy80qxxhbKOU0NZZg6dCgaMoTbq8JlSeLl2Vo1izdO2yzVKxC\r\nzGcj3qFgrz/qSEBijsXbUon7pD6Zl3b+MKf1kC/pnDYi8b2vM96BIlF1HZn2\r\nMIzHct7Eh6t4FPW6w4UA6zIzIHB2ZMkrmr5wi9Q5mG2n8Qe7w2Np0oZiuRj3\r\nAC1pkpLPzx3nuDYpHSU9bWAMIeYwgtqpQzNQM8uJBm7zXcdjpZVmY/ILLT4M\r\nfWieFK9jnUksNCuYhROmLgMWN+3nAf59mdA=\r\n=nYu2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"95db647ce856eab6b1eba2fb1794f3b0dbc3dd08","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.5f94aa37d.0","@material/rtl":"15.0.0-canary.5f94aa37d.0","@material/base":"15.0.0-canary.5f94aa37d.0","@material/shape":"15.0.0-canary.5f94aa37d.0","@material/theme":"15.0.0-canary.5f94aa37d.0","@material/button":"15.0.0-canary.5f94aa37d.0","@material/tokens":"15.0.0-canary.5f94aa37d.0","@material/animation":"15.0.0-canary.5f94aa37d.0","@material/elevation":"15.0.0-canary.5f94aa37d.0","@material/typography":"15.0.0-canary.5f94aa37d.0","@material/feature-targeting":"15.0.0-canary.5f94aa37d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.5f94aa37d.0_1678818090137_0.9467013613514514","host":"s3://npm-registry-packages"}},"15.0.0-canary.1bd317240.0":{"name":"@material/tooltip","version":"15.0.0-canary.1bd317240.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1bd317240.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"428c5168a2d59fe79b61cfb6b25deaa5efdfd050","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1bd317240.0.tgz","fileCount":36,"integrity":"sha512-OwpQTRv3q50xvj2eOXVFdCXHRSpVYtd2P0cgnsLu2O4JhlAkra1McBNsIAinOV9s57BYa/6+v8Opu8ZZRqNOHw==","signatures":[{"sig":"MEQCIF5XPnru5SquS2PfFJZqhrYEeBz2PcYJVcQwZZNyn5uEAiB6fuYF0+pTvKDCVDoCwL5YZxCYNfV4JqEozmoAMm0+bA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELwTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprTRAAgwEd2YsU0S2+ei7hmVCOsfoAUX78V4Qf97z2NZlIpWtvjUTA\r\ndB6l7Kr9xz7O8rxCNoCJs66mj2AA43gRI8CTQ7FL6O9LZgkIOg317Ho0pyYY\r\nAgYydwDC3S913FfQ47pLmNivmyaiEx+LdDVjhYcK7si02rtGdiyCfOpGyC86\r\ntPOzyvPtNzOzuA1XKSx4RnOw1xoMb30lumSsLehUlQR4WvFQ2kdpzRJezr4q\r\nhmtHLm/HGksCc8Ma5vaAU1hdB8cXo8Sh1zMU0lsF1kA2lFDsHRaPVZufh0Gi\r\n3dRQqjL4vc/Pm94K260LAqlz7ZmCakLkgYU3Zb9+Ezs2uSUhfOf+PZeOXckj\r\n6WmANP8RST+ZhbN0j1u/caXH9z7TMuP3RLujMAVa2m7s1y5dlDM1oFFYlVis\r\nH1b+ob/WFidQXw+WUEBuX34WnbV2NqfRGB8TUY1akc4bn5dofyiQg7cd68k+\r\n62gOsl3yPzGl0hYp6U2TnWwKKKkUAw0R0/ENLQtgAZSOxpfRUOqgzawFDDqK\r\n7heTOj4Ux9c3pgm9gnv2gDypeMzaYJnSeEynTaXplJ+54Ggv9yGaFzvMtu2k\r\nDfiord8AeW9FveUslUjnu2C9VKuONi5/Keu28y0QpvLJf2IZiftNH2sarWs3\r\nX5yGPCoRdb/e29F1wK2VABVYlkqwBD+QQ2g=\r\n=wfDP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"eef3d63106c71dffbe823b04d07e86a84dfd4d42","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1bd317240.0","@material/rtl":"15.0.0-canary.1bd317240.0","@material/base":"15.0.0-canary.1bd317240.0","@material/shape":"15.0.0-canary.1bd317240.0","@material/theme":"15.0.0-canary.1bd317240.0","@material/button":"15.0.0-canary.1bd317240.0","@material/tokens":"15.0.0-canary.1bd317240.0","@material/animation":"15.0.0-canary.1bd317240.0","@material/elevation":"15.0.0-canary.1bd317240.0","@material/typography":"15.0.0-canary.1bd317240.0","@material/feature-targeting":"15.0.0-canary.1bd317240.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1bd317240.0_1678818323508_0.06629739690385006","host":"s3://npm-registry-packages"}},"15.0.0-canary.d441d2a2a.0":{"name":"@material/tooltip","version":"15.0.0-canary.d441d2a2a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d441d2a2a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ae7964094a016a13635f10451c7478cbd41ba2ed","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d441d2a2a.0.tgz","fileCount":36,"integrity":"sha512-5japfDQKOs79yzAGibHEd64GQYw87BPgOWXj9y4UuRFCdpiUaWzI3L5nitRnRwqi0DVKEHBlzMET4YF+o/DmEQ==","signatures":[{"sig":"MEQCIGy3ti8eIDxNJefG8kAlyYwef0Nr9H7T6n4wrPr9+/oFAiBm06yd+nnfVs/WR8sxxz7ANHkP56KmE7J2vbg0QFK2mQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELy5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOMA/+KHLzNc9gvb6u0VWTdgF9hRWFnDVsDtjuaMwUSrPBJzP5a8QJ\r\ncPPwmTUlni8Qw/sIUd+1wWcVG+OJsruoEyWFctNjQOloPNKQHQ+O+iTgTvpx\r\nHjX44Xlsf3kNwSZsS8r4yNwteQpRwNV0cDNROUwqO1v/Z/QoXMZZGTWQlX6O\r\n4UDek9zJDPBI7MtoEiPuy6/jR/juFD0yvJ3NIP4s7oXKoYLQEjdERcAj5m4s\r\nJaj14vCV8iK6vZV5Qt6ZIbudYWtqBCZV+yGtA1tqpAHOSgVru1QJDzrA4BjA\r\ngzfc5mhBhFJmDEeEcxdig+f98cXVhVyVINL5gnRvIIqYh/JdwfbcCn/KES4k\r\nqfy01luUVZ8iWJxMndoAogHAM/esF5u0tOSULDuMcCln8/iwd6s9YUkDlRlh\r\nwEwApK61kjLJSO/KLFVKuY59rn5ttiUZqtxgNClfd18UcbTBqGe99GQKDgbD\r\nQS/SN2wsCio3LSsL+MN8BVvRVSN/b3/XAlGahI2j4ZJLh5W6lN4Uq72p97ze\r\nsWpS+jydxgaw+FC8wFHr+FhnUVIGtfptmjf9qPJ/HRORp6RVM8cFtWLepnBW\r\nw9g96FVOne9V4Sk0w1Wt+nR0ih5nyqygHmUEwkbXIONkZ6FFWajeO0ZS3deA\r\nNrtL6uwPmZ9iNpIOSC2K+P0m+0gT8nXlYJE=\r\n=SXRy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3a1d95c90b2fe34c5c04e44571f94badd66748b2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d441d2a2a.0","@material/rtl":"15.0.0-canary.d441d2a2a.0","@material/base":"15.0.0-canary.d441d2a2a.0","@material/shape":"15.0.0-canary.d441d2a2a.0","@material/theme":"15.0.0-canary.d441d2a2a.0","@material/button":"15.0.0-canary.d441d2a2a.0","@material/tokens":"15.0.0-canary.d441d2a2a.0","@material/animation":"15.0.0-canary.d441d2a2a.0","@material/elevation":"15.0.0-canary.d441d2a2a.0","@material/typography":"15.0.0-canary.d441d2a2a.0","@material/feature-targeting":"15.0.0-canary.d441d2a2a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d441d2a2a.0_1678818489122_0.6796558256668643","host":"s3://npm-registry-packages"}},"15.0.0-canary.fff4066c6.0":{"name":"@material/tooltip","version":"15.0.0-canary.fff4066c6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.fff4066c6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"95c3ac82c9e9e85d0f593a1991bd891746d843c1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.fff4066c6.0.tgz","fileCount":36,"integrity":"sha512-VN6uRwn+XLbopZKjcgIDQ6TUbbGTD7RRuv4po5GChTCKeVRrI2dnmSjtPE7JZ0E1qu/7Nq6oT61N9yfnH+a+fg==","signatures":[{"sig":"MEUCIFZDf9WO14Ui8ZioFADb7ZegSitH48smx3xzVEAbBJygAiEAgl4PjOmtE6w0rGEtvENzoB10Q0tblEcsdi2IzE10dHQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkELzfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVYxAAovKIwfTLOBNreUgb3apid+Xhg8aV+WnTKR0MTT/r85FesXZA\r\nTp8P/NDaZ5PKyJcuQPveML7p5tCiySyVO14G/ErwP2SKZJoZDVTcJXK95YNX\r\nHqaOvKIlcV6n+btk79JpkMVtJY5CgoQEBGL6/s/aeiSZlwwn7EyIycAgVMYC\r\nDSzR+2N0rhwvHqO/UQQMz9/fNjRAc8WvpPkHULRON7zgQhy53GNthTpxIU8/\r\nzp/TiC5oqx9Na9XXwL2cGLuEu15NTtQ3e8VQYvCp6LI5VZusWCItwqlHCpxi\r\nfZOATvRUP5gZIHO2VQKQ1okFIBP77D7+MIjX+uWlf79Z7DeCbQGlvByHhFiJ\r\nZPsKBgJLtcP9oUb7GikiyTsqZN9v/Lqc1U4jJ+mQS5bnxGhW5e/xsLR5RZip\r\n9VLrWZdYJ+hdmK27MG2tVbcQ/rFG+vTi13tNAzKuoKIqessKRlj3h+7Q2slE\r\nnL3sfTe8hTSjoQRhP3XNMDMJauOJ3yIA9fvvPLhhT1x7C8j+Ebng1JB+DITh\r\n+JqMJuiq0IDHCX7YKQufR0joluR4DQU7PIFwWmEx2q0rSaCvjnqllfLouy5N\r\nqnOGgV5n5SGY/JfEDgflyk1c+q5NfNOETQGBKZ1JFHYJQb2qVAoxLSOb6AqJ\r\n4lyIv8l+cjRqDcljuhvqJjc0kwuSTdFi6Ho=\r\n=us5Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9d24b185ab8c87061ad27f4e7791690a12e10135","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.fff4066c6.0","@material/rtl":"15.0.0-canary.fff4066c6.0","@material/base":"15.0.0-canary.fff4066c6.0","@material/shape":"15.0.0-canary.fff4066c6.0","@material/theme":"15.0.0-canary.fff4066c6.0","@material/button":"15.0.0-canary.fff4066c6.0","@material/tokens":"15.0.0-canary.fff4066c6.0","@material/animation":"15.0.0-canary.fff4066c6.0","@material/elevation":"15.0.0-canary.fff4066c6.0","@material/typography":"15.0.0-canary.fff4066c6.0","@material/feature-targeting":"15.0.0-canary.fff4066c6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.fff4066c6.0_1678818526801_0.67597685159664","host":"s3://npm-registry-packages"}},"15.0.0-canary.87809c710.0":{"name":"@material/tooltip","version":"15.0.0-canary.87809c710.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.87809c710.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"282ad25ca9661f8d3de4052c30e913016de9ca4e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.87809c710.0.tgz","fileCount":36,"integrity":"sha512-ifbDgJkHPnbbaHtCoe+0UvacN2ZldU1cdZBOYvzv1+PGRBqQ/BSsBfnmU7K60n3vDiKeFa+K/I3fIF6cgEKxCg==","signatures":[{"sig":"MEQCIEmlzGt00q6a0e1HAv6r1EOL/l0D29C/lIMDJ2yY//lqAiAEsEoTkLWpoIWJi/lZzFFVgfR5tsO+KYqHJCSSDddwdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEMCfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNoBAAj2cQttT1OnCyK0flEEIScK9Twx4vGXiiXkI2nnmURD0fikiI\r\nbITr9LTuLNTAzHTwZhMIlTCvMPynzdn/Ogg2pv3sNT1D32ojOfUYprgQZO/3\r\nLUtQkouaTkLeqU/apuwCVyDehHxxoxZDJWbmnqmjy76GTIRurtL68a/SEmZZ\r\naZo479F8LbXmMn4p8aCWsSEHId1BH5jGu5FV2vwSQ7bNQpgBEgKfOf+PVSEK\r\n93TAXpL00ITA8v1/DOckC+5iFfYG9z9x/xurX7/X5Mmg2WYnuw/j8iSQhTza\r\nm1YEbX6RyBsuXA49AwluGPy3GbIkkyJUpxcZG7GBPnY5kqahWKCYjR7MUu8J\r\nqhruZjePqHUqJTPxESwz35C2Rbw16hj1IoagMFg/fwdokXRfc2y3SFFuyegM\r\n8uv0wFuDZW5QLk6YWTS7KrlUpGE/JpOsFZ6H99pLK7SWlWadl2tHkN0kVIFJ\r\n38zVMmZ8H2CxNnp7xFfnIWJad2Zk7hNakcnBK1Iht2xV8AVho1Dwr1c59MEX\r\nba6ZQ8nT0P2PwjPZ8fIx/k2TAvT4vI7qIXfNONCdZytxrpFRS9YGivU4U+8G\r\nOcbqk6jLb1jeaOOYc7/mtYS4f+mDF+lFsaoJineZMBBdBhGi/pwLR98fOPl8\r\nE5PiwSHFb/JQpFKnaFv+Zqrr5cKNDDyZg3c=\r\n=8EPW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ac65d4def7491c4e414883c6cab7e075c7374b4e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.87809c710.0","@material/rtl":"15.0.0-canary.87809c710.0","@material/base":"15.0.0-canary.87809c710.0","@material/shape":"15.0.0-canary.87809c710.0","@material/theme":"15.0.0-canary.87809c710.0","@material/button":"15.0.0-canary.87809c710.0","@material/tokens":"15.0.0-canary.87809c710.0","@material/animation":"15.0.0-canary.87809c710.0","@material/elevation":"15.0.0-canary.87809c710.0","@material/typography":"15.0.0-canary.87809c710.0","@material/feature-targeting":"15.0.0-canary.87809c710.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.87809c710.0_1678819487059_0.17734747574275023","host":"s3://npm-registry-packages"}},"15.0.0-canary.48d30012d.0":{"name":"@material/tooltip","version":"15.0.0-canary.48d30012d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.48d30012d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"dd7c63a26096680218fdd5571fb52af21c97cc53","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.48d30012d.0.tgz","fileCount":36,"integrity":"sha512-P3UQJfSxyhYmQdswdkAoWbHfYDPQrePwZDaFOra54P7QTGoVz7xdb4laUhILs/3SDUIvzmkEmQnVPBPKAtd2Bg==","signatures":[{"sig":"MEUCIQD1IjfO/wC0H0FG7TbkOaoxomDvRbn7iv4xSIBNokL7RQIgeY660rhuCosldWgAEwgxSR5OMtZjOWl6NTQ+QnAIEFI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEMGiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmptvw//WyVNHaJPJa9kcWayRhLRJO0BUATcUvcYKgH/+2tXDrtjMrnC\r\ndvQTDzRzuJDR0UG+qsRV8XmZwGUHL/c9PDGC6glkM1aFCmIpmsylVEs8MMI+\r\n0qhx4oQLSIFGQsxEIc9OrZhEyk4ryHanbWY6M+Lk2X5x/vF3rG/bQtH3j2zt\r\nerczpQvaOC7F7GVbXcKA9Cj64HtLHoojVX1L5FRkwasHVpFXNdmmFaShgljQ\r\nbG44LDRFC0gcUpISrRDSCQeorkwKlWsp3C0JpGNc/SzzHz8H5eSb9XVJ5gTR\r\n5GLO1QZGfIfxPd5i3VagsPurFVmQQhoIlpt2JWXFonJxHqGpA9xRbvoDLknf\r\n3QSpQ994Pmjdl/rDWIwiRismHHRVP9Rpzbh6fdA6Q2ZU46vxw+mYhN9LZs6a\r\nytVcvpH88aryrQlseWzk3c2tWqkt/gN02Bm+wGAjCKSkyD7Od1UNKUrldxo1\r\nXvPnd6XAtCORZP+MDR0GYS3+uCk/RmdBUn/r3TqbdUZvdMAMeq5RgvolwAT6\r\nWSx+dEqRF9UywJZPZZy89JU3QMb81YAUdmP1DngceTwP0PyX1zFxLMXdkLCh\r\nGj+3Ro3/IYcM/7S5K97loc/kF75h9XbWEI2xT3llh5olqaj+wJzROmJhTZ9Q\r\n8sCfs5HM5X/HOQ5ESVWoGQnRUPQYqV99Rt8=\r\n=J9TT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"f2e4b43d20ea58b52a223d31b8dcd3f813d1babf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.48d30012d.0","@material/rtl":"15.0.0-canary.48d30012d.0","@material/base":"15.0.0-canary.48d30012d.0","@material/shape":"15.0.0-canary.48d30012d.0","@material/theme":"15.0.0-canary.48d30012d.0","@material/button":"15.0.0-canary.48d30012d.0","@material/tokens":"15.0.0-canary.48d30012d.0","@material/animation":"15.0.0-canary.48d30012d.0","@material/elevation":"15.0.0-canary.48d30012d.0","@material/typography":"15.0.0-canary.48d30012d.0","@material/feature-targeting":"15.0.0-canary.48d30012d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.48d30012d.0_1678819746113_0.2944869860640402","host":"s3://npm-registry-packages"}},"15.0.0-canary.419b23cc6.0":{"name":"@material/tooltip","version":"15.0.0-canary.419b23cc6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.419b23cc6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9772a6532f914501e6f245434be010643ef219a0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.419b23cc6.0.tgz","fileCount":36,"integrity":"sha512-lvccgJohqc0FwmETD5LMbgZeSlENf7XvRB0rFuryH+W9SLb7gnNam3cX8zmkeRNxLkfDnx7th4NZysFx3ubEMg==","signatures":[{"sig":"MEQCICzJWx4Wxql4egUnqVrPZq8mbCAVEqg9KKrofvRUef1VAiAggyL5tl3rzKTbRU1V1h9IETMUErhc6enmb37Kf3IP2Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEMQ5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWeQ/+M7UnEAaY4uOEZ6zF7CxHWoxxkH37UEKResuiFIZnsybZFJhw\r\n5ryDXG+ei0w4TUNVEOoF+mBVO7ImaAWJwgBEXOQaBVovtKliwzR55l2jH9Ly\r\ndp7HjlJQRqO63UClTwtvv3eaESuXnruWtbjeApUZc1XFgqe/5u5acPRaget9\r\n0nDEzoik3P3xDjhvL469bcj3+3Azl2i5v/KTZ/SnI/VO3vvW4RcMYujhnffw\r\nIAN+BKL1hmmCyzRLy+x6SfiCfrNUWAyQueTC1zzFtCcKSzCCX9sIxYchjK2o\r\nD/byiyUUNMugoUHoUwPawOSKQouWSyiQUttVnY2LaVFgHdFGUSGR3vv0j288\r\neZZhlza6R1x03hDwLEOeCqo7KJECf1T1277FxoStzIu5VKi71bDP/aetcB/3\r\njDjXApt6gPMSF3C+N+yqZ9Ru4zEXEvwW/ZQ/XJFi5xeANUjz63huDDoixV9n\r\ngWoVeq2/EzTqmWavhVWBSoCPvmFF/kU/NAf7Kgo+YZZd701WHCvwC0qoKfU7\r\n6eUTs3E4mYTKWqKBKt0Z1dlle61ID5FeLyVYElebN7Ea/K2o2N8tbLAIyYTa\r\n4/rFq7XhqRui+R0O97v3CzDEfGYfT8eyKhZC3BJRExt0r+CbfB48/0TJCI1S\r\noAQg3qD538XqxYaVfeDm22/Kcc6P9UywfK8=\r\n=Zcd0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3b1188210d22a02ba5ae948779bf92655e47aac3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.419b23cc6.0","@material/rtl":"15.0.0-canary.419b23cc6.0","@material/base":"15.0.0-canary.419b23cc6.0","@material/shape":"15.0.0-canary.419b23cc6.0","@material/theme":"15.0.0-canary.419b23cc6.0","@material/button":"15.0.0-canary.419b23cc6.0","@material/tokens":"15.0.0-canary.419b23cc6.0","@material/animation":"15.0.0-canary.419b23cc6.0","@material/elevation":"15.0.0-canary.419b23cc6.0","@material/typography":"15.0.0-canary.419b23cc6.0","@material/feature-targeting":"15.0.0-canary.419b23cc6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.419b23cc6.0_1678820408789_0.15814210225647285","host":"s3://npm-registry-packages"}},"15.0.0-canary.bf86521f4.0":{"name":"@material/tooltip","version":"15.0.0-canary.bf86521f4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.bf86521f4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ef8c8102514dbbaa4472e201523925119a20d095","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.bf86521f4.0.tgz","fileCount":36,"integrity":"sha512-0K6ueb8Z8/4zOj+gxCfjMoDUFAmupH1gYKLv0LzcsASBnGFYFl48RuPNGVnvhi7fFsV405MN31Po0T2gLKGNjg==","signatures":[{"sig":"MEUCICiEjjcJ8RELkcs4s3q3fAXRdg0X+yHGoosZN9oz1Cb8AiEAw9xGGETRLMaO97BEfMyAuh4enFeFeDxICqX3SqbJQl8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEP/nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopeA/9Ewh06oQuEwrKTYtlXi8wlcKj0x057MRzi4uDZD0+qs81DJBP\r\nclv+y5uK+xqD6Hd9i8VkO81g6ouSSnNUPZXZZFF2atnldnataPUygRA5G2C/\r\nfFcm3OwCXowALgRu5HLVCRsSxcsL8nrxrbqMfRxkTEJG39hFmdKUGYOl2gVh\r\nCT630286QDeLOgZR/nf585yt03vZb2wEphpH4tC2GvJUbYynC97bZCbuIDyh\r\nx9fprsr60i0pBt2ZP/uHr0CLZqYfh1vtjUnQMRt5+EJ91HgwlbvXE6tvaYok\r\n90YKHXZn7sVU8MK80MCn2Y0moyACbXRP1e7dhOewBuseBhpbQs5IgpEA0K36\r\nN2rdyHI8Gk7i0L3pu4XFh1TjK9Gju1n2j/1vk8NBLfHokHdmK9oxBGR7gtrb\r\nB8xiClAOFLS+D2BH4cpB8P9ovVDcU3mBPjrOkKk/VBNGstHUdL+Re2n5to/H\r\nBZ/840zHSaiH8wH6BXiBvJl12TB9vhWRzVtcUfxIx6RRnqbqmdANa/nQQs28\r\nouP+ZVFN9vNCqtlgBokerPnoDRq/yxdmBfgIfeESPKMdtPGCf6kdKQN3t+iE\r\nmdOixQxJBd0TOuiy74LJS2ybm5nFTQhu1YTHd4/IVv/4VBACLFEWm4ZCdc7Y\r\nvwiGTjGKGgGJVhjMtLeaaK5cNLODyYlbH8c=\r\n=7cGl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8f5c1bf1449cde9c918f51bd033762d247655b49","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.bf86521f4.0","@material/rtl":"15.0.0-canary.bf86521f4.0","@material/base":"15.0.0-canary.bf86521f4.0","@material/shape":"15.0.0-canary.bf86521f4.0","@material/theme":"15.0.0-canary.bf86521f4.0","@material/button":"15.0.0-canary.bf86521f4.0","@material/tokens":"15.0.0-canary.bf86521f4.0","@material/animation":"15.0.0-canary.bf86521f4.0","@material/elevation":"15.0.0-canary.bf86521f4.0","@material/typography":"15.0.0-canary.bf86521f4.0","@material/feature-targeting":"15.0.0-canary.bf86521f4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.bf86521f4.0_1678835687673_0.8999785702245495","host":"s3://npm-registry-packages"}},"15.0.0-canary.11f3d280e.0":{"name":"@material/tooltip","version":"15.0.0-canary.11f3d280e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.11f3d280e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"715a10ebdbcc1ea4c00885db9cbacde62f84238c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.11f3d280e.0.tgz","fileCount":36,"integrity":"sha512-MsNk7s+dpS2mAZMGg21DK6H4qIuKAQ8ugwc+Orn/gvX3bBr+GlAf7RLB/AmFYP9aTlUXHQGUqLX29lueXuSp1w==","signatures":[{"sig":"MEUCIEjSAC9Jmr+e5Y3QRl+cluzyPIzfA6ly3C0xaIIHh1LtAiEAt3/cZaiAVVtViIzRNSquPBC/+VhlkOhqQMdkXZZ1ZqY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEQ12ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmor6w//fJR/5qJElowFtG6SW95KIwgMrzpOK6+DTa48QSB1L2O6lQSU\r\nWlIVkggHM2PCHryFq/2RW8BZKg2XtLCoG9xVRwYLW62jiSzAurmY14XZZ3wQ\r\nC6B6fBOJFGsu86E4P18xHhdxGO7WZzNFcpMdhn7vkWK037deAgPQ388F9jSu\r\nqiNz8HJQlvfZ8pPUV1Oq8hFsvgpy3QqSIaXq6uDOAe6mRKLt4XNdiZnL3L7T\r\nMoL5nib9eTtp1KsN6m+nGgsks3CZ64jLwLDB8mQahx4xufxeqPgcOuH37m0B\r\nI83yNdMy3u/Vw3AQPj10NPiHawQemAE+73liqaFac8hJa/BrNnvgHsMBeZ3f\r\nWKCjhZHOTBhP/YCQdx42UH+pGJ+YwnTBd6LhB803J3z2RfmpmmeCuH69v5rw\r\n17YgWuRmzp90DTlElJb6LHAF6WmfnM1N6G81RJj+cVsYL/qCXKTcvKhiPAPw\r\nxLU2+pZXF9oFBmaHaXXhHm6oL+obmN+GHVSDL7BS51OxIKunOfHDIRuvfa9j\r\n7zVrCWdeqAFqxIUrHr4z/ERug7Y4T7u5ZhKvUDLA/7niq/50uWBQWXWs8diH\r\nS/bnpO96G6N+QlN8XKGfVZ12fJCB4UXbVHoMxvgdIaoAZmATmK+RxEf0TeWj\r\nzEqrwYtfM8EvDS9YQbYp6O9MCgA4cNyrU5w=\r\n=6/vh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8e5a0971e8b535be016fdfe963b22dbcf1353e53","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.11f3d280e.0","@material/rtl":"15.0.0-canary.11f3d280e.0","@material/base":"15.0.0-canary.11f3d280e.0","@material/shape":"15.0.0-canary.11f3d280e.0","@material/theme":"15.0.0-canary.11f3d280e.0","@material/button":"15.0.0-canary.11f3d280e.0","@material/tokens":"15.0.0-canary.11f3d280e.0","@material/animation":"15.0.0-canary.11f3d280e.0","@material/elevation":"15.0.0-canary.11f3d280e.0","@material/typography":"15.0.0-canary.11f3d280e.0","@material/feature-targeting":"15.0.0-canary.11f3d280e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.11f3d280e.0_1678839157813_0.24965360447854845","host":"s3://npm-registry-packages"}},"15.0.0-canary.b281a409a.0":{"name":"@material/tooltip","version":"15.0.0-canary.b281a409a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b281a409a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e729ec5b78b6d8c89a2bc802bb6b9d7d176942c6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b281a409a.0.tgz","fileCount":36,"integrity":"sha512-F6jH2ijybSFZSffEGnRfHiReHiZpl5B14PNcpQYuRVqHstc4wivJ65y+oJctR42JMYFJA4e6h4tPUu5rZSei2g==","signatures":[{"sig":"MEUCIQCX1jMcoD2HKMK4bKR8LUnfFn13vR3s33ACE0NZkj4swQIgWPp9oC4y9wbdmvYXYDNmiPAt49wXkbR+z1Iy2BBn/mg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGdB+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrj0g/9HL+0p/Ki14J0ZzGGxgdxPqAM4wLPMtc/1dB68dR2WpK1OZW3\r\nFFbzKIkmfO1YRFcDG+znT9nFFSOrcto25fYaFtGmKQsfpk2y5U6VmO0W74hf\r\nM9FLh537y0+8d2aBjiCQ4fx+6e3g7hND0IMQgXjka/iw3WgEYISpHIIbXU1x\r\nsCr+ecaJuHgjI8sOcgyLfHbiN8QOjzzNlAAxlOzBplfnp+8HqrKekbqGJUuh\r\nRQwNwEnpNRYu+l88OanLEbdTqWw9KNHDFooSD8nDa4KTLSJOj3Vpq0S4HG+T\r\nP1DK8SrU1CL3ZlOvvfPiXK6sKNPZ+v1pw5JUvOXv9p42Gn+QoBGhH9qoFZb+\r\nHc0cKog/D3x9my/4fHNHnOAhgVKgucL2tDO257vhbnzVqztdYRzCOcSxV+l9\r\nIO/P67/A6emQ/B4l8+nSJF9ezYr88hL8I28ZEzx7ULPWa2KDoJlQfjjDERjJ\r\nLfhLiJmpL4ps+RM4q4fr2YK2MysNkmrTXLBazbc8mIqkQ7ZND0WoH4GTXbWS\r\nrBA8K84E1v2CJQbJSt4YZh8okg2p0pSCazguxmluRqAUeM5KteL5hWn4Q0aV\r\nhpz7CypnZSfKvIpWx9BZkmC8mtHddL3yt9kl0Hvg1NUNn+/C6JW/OIPmxaOa\r\nPZMPrXsTinJ0fMvNMMdJFFFdOtFQmYejk/U=\r\n=MPaz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b924c47aadd36bf60d7c29e466ab3899ae4085d6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b281a409a.0","@material/rtl":"15.0.0-canary.b281a409a.0","@material/base":"15.0.0-canary.b281a409a.0","@material/shape":"15.0.0-canary.b281a409a.0","@material/theme":"15.0.0-canary.b281a409a.0","@material/button":"15.0.0-canary.b281a409a.0","@material/tokens":"15.0.0-canary.b281a409a.0","@material/animation":"15.0.0-canary.b281a409a.0","@material/elevation":"15.0.0-canary.b281a409a.0","@material/typography":"15.0.0-canary.b281a409a.0","@material/feature-targeting":"15.0.0-canary.b281a409a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b281a409a.0_1679413374307_0.3517641835603047","host":"s3://npm-registry-packages"}},"15.0.0-canary.39e473690.0":{"name":"@material/tooltip","version":"15.0.0-canary.39e473690.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.39e473690.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6226276233678cf5125c59f5de286cf2df306f5f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.39e473690.0.tgz","fileCount":36,"integrity":"sha512-KtPGdP5/wRWRDEG9KuCA0nBiu14kYrTydikx5YXT5PhBC7KQl5NjbjdGbnJ3r/DtMzhMBVf1911H9aH9uAvK0w==","signatures":[{"sig":"MEYCIQDZbtd0xNLvxFsE3ciiqRZl5JM6FJXMSqhrtp00S+FUvgIhAMIb9oCGOuyoQVbiX5Wesl5sZV6QMZ85IHsf/p2AFTXN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGe7zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnJg//Z8K3GVSpo1XHIKuKSAeooSySkkgzen6WVRd0GmQ32dCa0U/C\r\nuPag+pi9uMbfkzBp6c9aW6b52sRXFYRCYPGLURGy6vZbhxH0pTImMuVjIS28\r\nlggcqUcSdzNhPhiq9bqQspDwnrORpP+higPrid7hz43wdssPl38399Cl4fzr\r\nvmDSiGROMuKLHChg6zgzDWxJaxPKp0H/Jd7E9JyCmGMr5a3UI+GMbBjNA0C8\r\nYADuGQAC5OsNZZJtZnCKR3NQC7tJWF165rK+CM8Fx4j2B07jD+9hXFASoy9q\r\nywp88aQzxOLrIt3+rNqtkXv7IquVdjOh4ihyrrhhGPibnEqhusVKOS2vT/p7\r\nW8vXjDfj6Dwqh/NguDeVf6Y4ogDkYnogugw9zfcDNmC4LojUqTTzdXJojIiV\r\nxi1KLP2lxxd1fX6Hrl1Vu3L/cIW3UMecIc5kkW46VvaPI1tF05FEleKO+WDq\r\n//W+9igqv4grk+GncCUuyeLzUEKdBh6f6/QmFZqinKdGhzRigchL1RYORwoS\r\nn11X5bUbzE/N4EDgvVcyxyrJyQ90wrcUKNgc2JDaemSDDqNX7yVQPy7YfRTi\r\nUZfgDM6O/YHpr9oH3iVHDTJjL9mTihFuYgAuzN3JqmRNbJ1CqsTtvUf916bH\r\nHnRxj8gSxL/0B6mI+C66Zn5w2yZElf3qQZM=\r\n=iPG7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"2d372eedef7c583c60aff8d4cd51f8de971cb93d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.39e473690.0","@material/rtl":"15.0.0-canary.39e473690.0","@material/base":"15.0.0-canary.39e473690.0","@material/shape":"15.0.0-canary.39e473690.0","@material/theme":"15.0.0-canary.39e473690.0","@material/button":"15.0.0-canary.39e473690.0","@material/tokens":"15.0.0-canary.39e473690.0","@material/animation":"15.0.0-canary.39e473690.0","@material/elevation":"15.0.0-canary.39e473690.0","@material/typography":"15.0.0-canary.39e473690.0","@material/feature-targeting":"15.0.0-canary.39e473690.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.39e473690.0_1679421171103_0.14967266214390618","host":"s3://npm-registry-packages"}},"15.0.0-canary.cedffb44c.0":{"name":"@material/tooltip","version":"15.0.0-canary.cedffb44c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.cedffb44c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"03216a989b490b62876bc47dbfed0fc481564927","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.cedffb44c.0.tgz","fileCount":36,"integrity":"sha512-scY6Qc6Cf6QcAgUnKTHIDMOCXf5jrMBoNd6zd8Wn9UIXV6qBUZ/wfY+5JVDAf1F8L6mOZRF/NSuXQYahkiivLA==","signatures":[{"sig":"MEYCIQDOjDFUbuBkk16dpeobmBSaxHcRRGaU/XYdDIj/s8rNVwIhAJqBfHAvHz1wDXm4tLN8L4B5D8BHyiBdCWNWb+58uPRB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGfCVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRyBAAkd7tzi8c6R1nzoh+jK+XmsNQwl+Oi+SNa/PzCJglFoXfCjg3\r\nlEIvIbM8sNHXUiCgwvcN1qOSzEhW9zOM+w1hogS239dc2n1qjIyK1q/RU5s3\r\nYOHoOnMpoBq7no1kquNft7w2H6r24ZYV76JkIwkS7EGXY7XCaT4xPq5bZ2bX\r\neZYtENY9G7bbLyoxrTpn50006ul6GqylvRQ8EH/iFc/2Qxmn5a9Jkzq2ajJO\r\nzi+3IFxm4WAd4lHLhjQ5y2scSoGokAE1xmPIwb6wUlJNHSFSiPL5HOzKTj8E\r\nUjy316khkc+C+XvU5CjoNkC19CotPVIJihTNVFNQuP7lDctRqU/mD6kE26N4\r\nu0emLKPEQNu+nqhCXwQls77oD0RWd+JPt0z/F/nfsRIqePt601FvVFZuS2ux\r\n1dV2eXY9qJZo7RlHzLTkAmYC8Jytu5ivNXVk+c8l4lmeHBIM8Ww0BklPrvlK\r\nXaqVEAk9k1kRtI2+t0CgCFVkAPZzqDOJS/hcM89LS3yW4oMOQvhZx+OoLohy\r\nKMtgMG2DdYzP0LSjKDcNabm+JmbDjw+zoCrV7iriRC2OjNN8JugdBuP94qCA\r\ngh2ZQ3B+mhI5N5oWLjnsoMWgskTZO3zKbxqanGVA32jqD6Q1muCR8L5h/s60\r\ntDJRPyyvDo+CTvzEoCsUsXnnvq+9KvnrvIE=\r\n=6lMW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"37783644942291b0c5d41f7499a79b5f61bfcbfa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.cedffb44c.0","@material/rtl":"15.0.0-canary.cedffb44c.0","@material/base":"15.0.0-canary.cedffb44c.0","@material/shape":"15.0.0-canary.cedffb44c.0","@material/theme":"15.0.0-canary.cedffb44c.0","@material/button":"15.0.0-canary.cedffb44c.0","@material/tokens":"15.0.0-canary.cedffb44c.0","@material/animation":"15.0.0-canary.cedffb44c.0","@material/elevation":"15.0.0-canary.cedffb44c.0","@material/typography":"15.0.0-canary.cedffb44c.0","@material/feature-targeting":"15.0.0-canary.cedffb44c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.cedffb44c.0_1679421589558_0.16186114412831665","host":"s3://npm-registry-packages"}},"15.0.0-canary.36a4cba99.0":{"name":"@material/tooltip","version":"15.0.0-canary.36a4cba99.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.36a4cba99.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1de07652263d47375aea2859a4ff1f44d1edaf9d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.36a4cba99.0.tgz","fileCount":36,"integrity":"sha512-9RdccVMZT79aDqkGebnUpUauR4o9byF/sbWRVh7WUdMpdsPyoGwWNBwmTifdm5TDPBB5YN780fR2Oe4zsn8tCg==","signatures":[{"sig":"MEUCIDU73yS7rhc8JTSYZNZH+M0qBhVTChc3sGCnPeB763GdAiEAsLeanyy1H/2uIByG1Iqwd0hJ+jRc+xrk9kKgTT8rZMw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIykhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq78Q/+LXIWPfmbRNWw/3FDFs+fxDdIcFHB6VEMA13NUz9nVIIjB2ID\r\ncemkeD2Q08l//dURG8AJOrqEwJBy5VogN2iMP5ik5DeyEB8A6heVIGlQcWDe\r\n8wkkRREIAOCQJ8QdJejoXR5xuR/znqVj5NpVv7v9djGriQObEiOj+DE02Kax\r\nhagWzOscYN3smW81WuDF/6VvKGqfi8T7iB0N3LNRHdVHvwJG/IbbrGsRfS2w\r\ne0CXvYDSbd8ogZg4hQ1CbNvSv4w1FveFh0Ql/LOo902C656sX0ZTxNmYzVcU\r\nPYgCbq5GaZMlK5yaQdBiGSBQXEQUHKjbEC0w75NQrqLgspoH5ozXMUSgRXkJ\r\n/u/ZQNd6ghZAAOxNCU+bvo4AhXcJSQCqe4y5dTgVgZSGnCPZ8tFfjwfYTJuT\r\nNJBa+z3rB5dSptxsjeul9KhrkOZlUKTh8PsbEHBNIJf8CQE2a9zWH19iTMBa\r\nM6YODF9Ry+AeS66qXpyZdbn3QyisW9aKlQ3VJvttYfRLWQrUVAps48zusHy0\r\n7aT7ehHH4kIQwfcbLFhWw97ILrb75DfVp73dwDoQTVe1KwHucxf1Qn/y9Eks\r\nlo+oR2zUSL/6tvAKlHHhfPNHtWoZnzUOoNI7Hl4d4cX0qDYDqUXhG8675GQv\r\nkeK9zbNYjin2YZ/dK2qnJUge2dcUvOAm4Ho=\r\n=ogti\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9895102e50a9e7eda73e0b0039246bc56c79a7bf","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.36a4cba99.0","@material/rtl":"15.0.0-canary.36a4cba99.0","@material/base":"15.0.0-canary.36a4cba99.0","@material/shape":"15.0.0-canary.36a4cba99.0","@material/theme":"15.0.0-canary.36a4cba99.0","@material/button":"15.0.0-canary.36a4cba99.0","@material/tokens":"15.0.0-canary.36a4cba99.0","@material/animation":"15.0.0-canary.36a4cba99.0","@material/elevation":"15.0.0-canary.36a4cba99.0","@material/typography":"15.0.0-canary.36a4cba99.0","@material/feature-targeting":"15.0.0-canary.36a4cba99.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.36a4cba99.0_1680025889593_0.18586728307843892","host":"s3://npm-registry-packages"}},"15.0.0-canary.ed7e82ded.0":{"name":"@material/tooltip","version":"15.0.0-canary.ed7e82ded.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ed7e82ded.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b86396e3ae1d88babcc7de2c8f28fd40742c36ff","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ed7e82ded.0.tgz","fileCount":36,"integrity":"sha512-LQvXbYPtjdk9DBAgz9jVmByzqBUr7z+lB/sQQy94IM1xxBmTceWUCZ2n8pXGvv/KD/KK4pqyYOZbMmUfZD70zQ==","signatures":[{"sig":"MEQCIFsLhft21elPkLSDHkq1bcMSjaGzWrGE9UNsFBJ/JQ6GAiAoQ0/QzEpgO20HJ6MO9oV1yfeP35AHkc5qKdf/J6qNLg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkI0+5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvJw/+L3TAZDyh9tXmvhb/fE30fLTHIc4LEpVcYS+TTVODOVZdwntd\r\n1xoPYpaWbW3FiWKhv2LZWpO3c8fjd2mQyAjaNoRtBPO3zXGPkDxfRUS4wFFn\r\nl2qQZq9vfmJZsEC4QfJ0v4coSobdqqCmMpnSIB9fdozvPWrFMBOzBAgSe62Q\r\nXdNsvoTz7YSbnkb/RPTM3yiU8+L/UuiZJEXPUWijdP1wbT2CMndSVN92NWWm\r\nLJS/GPhO/21SXr61C1915wTMmoJdG6FA9aG9cshSvN5PrRda0WuSHN/zienF\r\nWY3/sXVJHuPlQSgrs+/DfgixQLKd2ZEX4vD6jHJrgZS2uELt4eNJP8UDvK5M\r\nO9KxBgICuRKOOUItI8zILbSSNW6psC47RF2phSVszEc7znZkR12tryM251qj\r\nKgCQyplg1SJQK4iYCJtTFt+AvZ+kcxgahH1zchnRF+6XZkRawloQFaA5GHqf\r\nOekiwVKS7jan+XPVCC2c/2ZXJoMZZm/tmtRmgE9/cOxvNT03JrmMPrL0Xtnk\r\nWEN2r2dB8GzTRcYFvTOjINt7ylAHUJZn+VPgTBuBJRyhiqrBCXzM1jkTM6MO\r\n/5wPn1S2Px03AXC1mZQYoMHD3IVysPYTCBRadRNZpvru1ZDoB4ovqx5nPMGH\r\nkGVkXxV5/ngaTx0EOZkS3pYYj1QETs8gaTI=\r\n=y0g3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"037c17ed14cf732acefb4bf7cb0a6c61f643b991","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ed7e82ded.0","@material/rtl":"15.0.0-canary.ed7e82ded.0","@material/base":"15.0.0-canary.ed7e82ded.0","@material/shape":"15.0.0-canary.ed7e82ded.0","@material/theme":"15.0.0-canary.ed7e82ded.0","@material/button":"15.0.0-canary.ed7e82ded.0","@material/tokens":"15.0.0-canary.ed7e82ded.0","@material/animation":"15.0.0-canary.ed7e82ded.0","@material/elevation":"15.0.0-canary.ed7e82ded.0","@material/typography":"15.0.0-canary.ed7e82ded.0","@material/feature-targeting":"15.0.0-canary.ed7e82ded.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ed7e82ded.0_1680035769059_0.6506840227875412","host":"s3://npm-registry-packages"}},"15.0.0-canary.55093ee1e.0":{"name":"@material/tooltip","version":"15.0.0-canary.55093ee1e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.55093ee1e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"39b33f1325ba4836b2f99943f363f27252bc9760","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.55093ee1e.0.tgz","fileCount":36,"integrity":"sha512-2vr89rU3lpLtNqCfw7IMV+3ztWGs5dewfmBInW1iDg1r0FUls157YsZHFc60DlgxDfFtGY0q+BYxH1tFEJfYDA==","signatures":[{"sig":"MEYCIQDZOHdj27Ka4gdRENSbFvi3QVPYHLuvJ94gx9HtbrvmbAIhAKMG2fN7NfxAcKY7Zm/AJmWJDIhEajFWY5jqIuyXxoIO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJIhsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+gA/9GSygKodr1sQkOzv9b4qfHoiINc9H/vmEHL0iO/AJ0H2fretQ\r\nSEwbgo09/UF14nM3YWBblMUn6XTm0hCvCkwkfj3m23ES64ScdKTQelep6ing\r\n8eBwMsApoLrH7lJOHC9LzWwou9KgodzhOmU7/svt5FT8XE6WveOy/e1iavm+\r\nGG1DvQvLXDhSr5MykOB7DvG/wg2VsMDrouENN7OgyBcocSz0wpmeeLcoJnC9\r\nuv8kGIORoRPSNs+Y/EfLQpy95Y5hY0hpUR21Eji8urrwOw5TdQuujXdW99sK\r\nUFLIAB/h8wkUKBHcn9dedbmMUMKB9+xNCudlS//FNT4GS8WXf4EJhaGOH8U7\r\nJRarKYgqq2Co5zfLYCpVseL0/8aLUwPgXtZhlj5xEVY0Wz42YAe3AO3Q4I6p\r\nnjkfBMGb3JNPzePsu5lOgZnS5BD8w9s+NC8o5vVz4aLqembKbfMRrgwJ79tJ\r\nDQ+ZKjYO42qaTyOwg5GKRbLrN4npU3UsuMmHNrXOOFUMl9AcWbarjK/0x22n\r\nkAkGMcJWIhGaV4QmWJMW2ST4cWuuhHeJBGYIrW8V5m/m017eENpRGAXC3wK8\r\nvqYfD9mYWRgluwOL55PPblX6CBRJojK9ObYVSLheaaK77SP1+dZ1M69mY5FU\r\nHrdidftGRpAqA7CPjae/xhf7BsBkQ2qVwb8=\r\n=C3dJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"98de61151738b5091fc2b0e261c18efce05e87b8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.55093ee1e.0","@material/rtl":"15.0.0-canary.55093ee1e.0","@material/base":"15.0.0-canary.55093ee1e.0","@material/shape":"15.0.0-canary.55093ee1e.0","@material/theme":"15.0.0-canary.55093ee1e.0","@material/button":"15.0.0-canary.55093ee1e.0","@material/tokens":"15.0.0-canary.55093ee1e.0","@material/animation":"15.0.0-canary.55093ee1e.0","@material/elevation":"15.0.0-canary.55093ee1e.0","@material/typography":"15.0.0-canary.55093ee1e.0","@material/feature-targeting":"15.0.0-canary.55093ee1e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.55093ee1e.0_1680115819847_0.5943761824165787","host":"s3://npm-registry-packages"}},"15.0.0-canary.0c53abc81.0":{"name":"@material/tooltip","version":"15.0.0-canary.0c53abc81.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0c53abc81.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f5687a5de2427e97bb7a4c9528fb48ad12969761","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0c53abc81.0.tgz","fileCount":36,"integrity":"sha512-5HAqV2L17lp9N9zBhklunbK8Y5ALs1wXCzLbf+gX0+1ehd75ZYoCOm/3yapEqS9k1nobOsG9En7ZfhVRlQh8ZQ==","signatures":[{"sig":"MEQCIELB+y6HVJGxdgXbg3lxbjHv/Fr+ECNQpBIJ2lwsyffjAiAGwoEMeHpAHisEm78z6kiQQ56fFYaM4oH6aVX3E4VJ7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkL3T+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTyg/9EC96ScDlz5KhovVLbHAVZ9eWyJhbWdWb4ZS+fOQM2YBw8Gtn\r\n8esToM6Em6VqsF46oaExaI6FsFLM6QLOmY0XwSe3/ZmYCGwFNNre6+kybgIx\r\nboRwSP0e7f3ZyXFq4CHW0m+hIz1iDFpmxq5G9NTJEH15tMKzkUZ5d0wd2MHp\r\nK7KybhlEVG4qJyWyWuN6/ZwTSzjGA+RWrz7UHCwEvNz6TtYgIK/bp1K3kalO\r\nZCPGM6gBEhRyoM6nvmXm2n6UPRj2SnG5eFweumVhFC/zLirK3ENkqNlH45aX\r\nASQ1HsNytZtHabSuCEdrd8RY8vANOpz4+LBggSS3l0KVUtjjjLFM9prZQcq3\r\nOiz4Y3IHbywobWlI/z12UBWbmqv449yswRqiXZzG/rYdbKLZTAdRgTf09aj6\r\nBJINgy4mdDqbBwiJLHMCqZLiWC5NanQgpqRVzU7ez5CjuRAMSIfNqFgk3Rdv\r\nOKQa7kGXAPJGrc5GtcWnc60rosLSlQuaEnExT9tLXDrugpvFGVU5ZmhCS3wR\r\nunRc1+8yvz+/n9Z5MBPvuP61IeLDQWI0yxuDSaQSR49TPHV2uEKh9dCICvoV\r\n3o3iiW+sHFLY+ZokgixKEoWCQxCwJrN52LdQoLjbd8vLuF/w9XsuIic2/SWz\r\n3CaHwSWWwN9HdN16O3hekqAsaXx4+dGWpQM=\r\n=sENc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6f7be5b2317c28dc06c5b0bf4a8cd44df591750d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.0c53abc81.0","@material/rtl":"15.0.0-canary.0c53abc81.0","@material/base":"15.0.0-canary.0c53abc81.0","@material/shape":"15.0.0-canary.0c53abc81.0","@material/theme":"15.0.0-canary.0c53abc81.0","@material/button":"15.0.0-canary.0c53abc81.0","@material/tokens":"15.0.0-canary.0c53abc81.0","@material/animation":"15.0.0-canary.0c53abc81.0","@material/elevation":"15.0.0-canary.0c53abc81.0","@material/typography":"15.0.0-canary.0c53abc81.0","@material/feature-targeting":"15.0.0-canary.0c53abc81.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0c53abc81.0_1680831741776_0.14110953755087263","host":"s3://npm-registry-packages"}},"15.0.0-canary.51311e69e.0":{"name":"@material/tooltip","version":"15.0.0-canary.51311e69e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.51311e69e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0b4eecd64e097b5a3e066ac0f0f4bfbfbed2cd23","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.51311e69e.0.tgz","fileCount":36,"integrity":"sha512-ykffUyyu0tJXGOHn0sXA5vABIjBaAK/9yh8ZBY+W2/O3yAkTdWQMn8OYBxKzaRJgCDjA5Cr/NO1reomcC8ONnA==","signatures":[{"sig":"MEQCIGpXjV6ubexKtF/DBdrl5nAgeahPpXwcmJBsNI4ToA8LAiBu02nade/XjN1nCtoHUCQeQJn2F/aJ2YTdS+vFTYEWIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMFxEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6YQ//SdyMPm6x52nvH4T2fNr080DBXjkHgllN1E62Ybt+9YD+RhnN\r\nW2Gl4DrXKjmsKtzAS2nFwnY/o71GAIvluaM7i3mISmmZzdprBXHc3zeg4pub\r\n23t4vRGIUsrYCx+1Zc3QZq1UXvb3ItTS0Rf25GAMl+hi8PLBcly3i+Z/1aKc\r\nQ7P8ZL1aFO5IG2aCFYrT+yGFYlf0RsEFAJ+sSUOdW3ea83YWGtD9pBZBQxRn\r\nXVcr7MCa6vxdyYpJ+B2UOJXwjTTidsAvFLm7udhxs1+s2Op70/nLXMeurFss\r\ng9xMocLMsqiYz0KbnB1nSDQ0rX9ru41UChubCxeJ0lhpcTIlAZWrQmb62zIG\r\npZk9mNniXa1G12cc2cvSTTyEREduGVUylagTxpPjmNBz08Pm8KvQAE+ECQ9i\r\nSF8lQgC/8OeX8BGBNEDaXUR+pv8B+lNu6kvRdBj6cW2YfP0VS+dxwYhAl/wj\r\nhhnkBTnY6pGEv8iLrvuWxnSnjIyDMi0h0wTtESS8dYEgq3EElTdGU6K3yBCt\r\nXCzzVg76XTXqyiZoY+ijRj5c5nHZG9HY1GFVwyQk+eaqrJIxcYPz/ezqYXEu\r\nHz8TVUeeqIM6RSSd12iQmcjhzKXICsSOuUVt55ST3zwWxHRPIC31WuzNl8B0\r\nqchE3bc7UrzTaQ0eyhEfZpOeNXmMH354yVo=\r\n=SeQo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"20cdc4f9c3bc9046fb111c8b65ba3e9609585dce","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.51311e69e.0","@material/rtl":"15.0.0-canary.51311e69e.0","@material/base":"15.0.0-canary.51311e69e.0","@material/shape":"15.0.0-canary.51311e69e.0","@material/theme":"15.0.0-canary.51311e69e.0","@material/button":"15.0.0-canary.51311e69e.0","@material/tokens":"15.0.0-canary.51311e69e.0","@material/animation":"15.0.0-canary.51311e69e.0","@material/elevation":"15.0.0-canary.51311e69e.0","@material/typography":"15.0.0-canary.51311e69e.0","@material/feature-targeting":"15.0.0-canary.51311e69e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.51311e69e.0_1680890948078_0.7608537873407859","host":"s3://npm-registry-packages"}},"15.0.0-canary.113b1a38e.0":{"name":"@material/tooltip","version":"15.0.0-canary.113b1a38e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.113b1a38e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2a95e90e8aa9fee49982e7cd6b7ef5e0a010ca92","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.113b1a38e.0.tgz","fileCount":36,"integrity":"sha512-tk6Br8iSyoYHclSuC8EkN8m/ILSEVAEiIj74Xc58TXNGZygpi90Dx7OSmf5SJhEAQvGesF0+3Wd5uLR2I2TFfQ==","signatures":[{"sig":"MEQCIE1JrA2OgCngcL9CeKLlhQtY75CH/B05zHolflA6JSW/AiAweLIIImkbSVTY4k3BGroKQvSjJCAdjP7hLSO8RRQ6zg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNIW4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWcRAAhsIOwgxcimCxjPRogV1Zx0wFYfsIBtF7H68eAMAg+jpUWcxg\r\n/n/0dH46f1Zac4kZ3x0ubpnTcWmH1xsUmoe4h1gDL/jtjpJK4ind2KgRwYV3\r\naBbhdQ63/07j6N2IDHnSi0y1LSM3XWCKjwdmSrBK6FFaKm0AuivodaDydpC9\r\nfnVXxaO60jt60UYOGX+Su8oE6IpWq2Zv6nK7THy3C2YmpER2+dc2ie2q9daA\r\n+cpQnpA1ykkr8AeuQnzGNfEFFvxtmin5v2rGiUZKXrlTwVMmK1g5Y4LfM3El\r\no0I2OLTniTZ9x84jPibomSHBESoQTmm7rQzkA6pIYadhmdEkW0OFUMj6rcKe\r\nqXnhX7YMRYOMjia3axnBx7c2jVQ9fTv09cniOJK60RKBA+Wn9lkr9qt6stLN\r\niXLIg/0dD4tLvt5FnKZu0givuxM8uC+hxVsq87CPvxELAzN2vHTQQp3yi4n1\r\nB56cYtoKRE6MN8gMf7Vu24pnFd/vIuIRKOX3Bnz3T58y5ljAngb/B2SNkWI4\r\nZ8e5wgs5m7beonJz2k2OpPva1bfJGoboIhchyX5Nm9e7deN7yj5lVbXOUIHU\r\ni0u+lzoCJ0zr9OctJlokJMYTxH9W/dTs4AyJgJdqXf6ySeoOgzjfSy5q//S5\r\nRPTHCo5QDBaf8mtsAffjNQszCN426nqCwEY=\r\n=Y7BL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3613349b6481f716239e1a73c710c0d5fe44df72","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.113b1a38e.0","@material/rtl":"15.0.0-canary.113b1a38e.0","@material/base":"15.0.0-canary.113b1a38e.0","@material/shape":"15.0.0-canary.113b1a38e.0","@material/theme":"15.0.0-canary.113b1a38e.0","@material/button":"15.0.0-canary.113b1a38e.0","@material/tokens":"15.0.0-canary.113b1a38e.0","@material/animation":"15.0.0-canary.113b1a38e.0","@material/elevation":"15.0.0-canary.113b1a38e.0","@material/typography":"15.0.0-canary.113b1a38e.0","@material/feature-targeting":"15.0.0-canary.113b1a38e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.113b1a38e.0_1681163704262_0.49408437892458856","host":"s3://npm-registry-packages"}},"15.0.0-canary.ea2191426.0":{"name":"@material/tooltip","version":"15.0.0-canary.ea2191426.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ea2191426.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"47134183f91452c2680cfa8fa0f10be4d8a19e85","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ea2191426.0.tgz","fileCount":36,"integrity":"sha512-GOWcDkqWOzgI2mxzNYNBIHpWGXucr6H4ESysJW6vR0y0kpY4ObFec1WRZCib4lwuJLKkMKQZZUbTvHI/P7dOTw==","signatures":[{"sig":"MEQCIGoheet4WoXCE+OWLO/AL9Pb/tKLTOJbV4/mlJyTQFaYAiAmGdJ2xDfkoJkUIu9v6xe7xo1jinkVpNDWRi4S5UgzRg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNdfBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrcew/9FNqtupgeeWkTHfa0e9hQw2P2DHsiW/+sTvTdlo8ovQXbKSAX\r\n2MYYVTa6s/xWF7O162fquJ9iFmPjzQKP2GUsVBAd7IyOY0mKncDWwnUCRw3A\r\n+urnQ7gt6CKXru/pOEu7x0nB02V4ipAwzANOPAXReOb4AagBxrBXsc+/GOdW\r\nQLDOIcpsYV3DP1SjjsZHK7MclhXVnsBXLE1MMl4fk98FxB1+D7sB+SPg1XK0\r\ntQsceGqmVCoYampqnrrLV0nEVvBIrLv1UrTO9TXWBt10cYj15j/fJwvuW4QG\r\nRXqJplpUlfk2gT3BvemmG5NJ3OV+QwnamEHZqtB5qmFNHhjQKUV2CvH/dEx7\r\nyOXSiznVzvSpYF4Y7HDNgglt1RJkGqp/5rZrBLzoAc6cYynQal4QeVWsA8Qw\r\npty4VKiiO2V/47QXPCMuAFpBRxjfKhZLBpAfUlrYEA+i9+V5oszdYrawyEG6\r\n7ekkJ8tY3GSXrhMGm8GFcq39gLK7xWfIcNPN1wXjRJZDglwaXlI8oC/EbY47\r\nVstPhu44oDvYaDPI03EeygqRPIIXigwdvhemZUsTlV+jY8pbYZ8X6DtxNyh8\r\nNR9Ambve+zlTjlr82kDJ5O3Ivr8l+MR8WnKek6EeW1cOTP/n5mo0JQqRd7cN\r\nAM70+lrVvSfHh91KJdzOxyd1XZgbSa+I+Dc=\r\n=vV+M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8723a8c5fa13530d57b1651464ec28e9ed1d4bb2","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ea2191426.0","@material/rtl":"15.0.0-canary.ea2191426.0","@material/base":"15.0.0-canary.ea2191426.0","@material/shape":"15.0.0-canary.ea2191426.0","@material/theme":"15.0.0-canary.ea2191426.0","@material/button":"15.0.0-canary.ea2191426.0","@material/tokens":"15.0.0-canary.ea2191426.0","@material/animation":"15.0.0-canary.ea2191426.0","@material/elevation":"15.0.0-canary.ea2191426.0","@material/typography":"15.0.0-canary.ea2191426.0","@material/feature-targeting":"15.0.0-canary.ea2191426.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ea2191426.0_1681250241143_0.16325436047781006","host":"s3://npm-registry-packages"}},"15.0.0-canary.5a5c38538.0":{"name":"@material/tooltip","version":"15.0.0-canary.5a5c38538.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.5a5c38538.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e75e693eb80ad56c3dbf775e3b4d4df2d1e6d287","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.5a5c38538.0.tgz","fileCount":36,"integrity":"sha512-tZAxEBcnQpHM+Q6uo/q0Ev35a9cVCwJ1QIVSa/pFHwSf6WfHrceql4w9vf/uWntdDQxkFK7iKq7qYKsvtYzLOQ==","signatures":[{"sig":"MEYCIQCFSHQ14Ait8xFXaRgXlc1ZQksEMWRn+G8b2GCoNQuDkQIhAPlu9ItVWzZ6y+8/niv/WYjVoL0TuxURT9l3mAhy6BUw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNd/HACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqjjRAAgf6t2pzLWSvbOzxjRK43u2T4g4lczVKMv4O9TSBu0S9d6ZGy\r\nanSyL57oYBp7bOrxkIh5sLLm/cqALhmoA/E6vS7jIaYIK31yweVDpOvh/4qN\r\nQXFyWEkjAm+FJJTqTCndM/b/TDsdYEUm6M+VakFE1FqgqcxIiGVYv6phGCnZ\r\nFnfCOMd9g2sjM8aqCafak2ys0dWPEUqMMGL5Q9gl0sdt3acSNISFJGZNKPRT\r\n3ouItRg5dKJEJ7pSRY0K4+A1OKm2AyVMEqEltOEdFoMzEPdPEGO/+apKNVxM\r\nyI/SZasDZRCuYdKJPEHDCgv+5tHVqYUzCFtaU2OF+jzpNftPth3I6Wqny0pM\r\nwBt+9IjhUFli15R2j28litkJSEgsteOi7ooPPQhv+I5IVCjSEJANNUyl8NaI\r\n3j88MA3kOHCx+v8AcgKiBK5fLLCKxqUD+zkDkdVNvybGG5++pq3aPxWqNbBd\r\nywRw6piFKvYwgcMDIDiu7/eT2PbahBRg3QV7mg/Tpx885M3BZAaGU/xv6wnz\r\nED8xFnNoJByMblAbM9JBCZ5M605I5/xhXtL4ddlfzdNH7rXnQIXDkJvHGZXf\r\n7gQFdUQ5RMyaQPnYkBsApJZ1R/QF1Aj/ekoVNWc55OA7eDriIsMPdHCLFj5M\r\nXa0VIkFDxPpKga0k3/jjZy13Fn6tNOexHsQ=\r\n=AjrP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b05f00c0040fd0d1250297d4fa4236a5b6b00b9a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.5a5c38538.0","@material/rtl":"15.0.0-canary.5a5c38538.0","@material/base":"15.0.0-canary.5a5c38538.0","@material/shape":"15.0.0-canary.5a5c38538.0","@material/theme":"15.0.0-canary.5a5c38538.0","@material/button":"15.0.0-canary.5a5c38538.0","@material/tokens":"15.0.0-canary.5a5c38538.0","@material/animation":"15.0.0-canary.5a5c38538.0","@material/elevation":"15.0.0-canary.5a5c38538.0","@material/typography":"15.0.0-canary.5a5c38538.0","@material/feature-targeting":"15.0.0-canary.5a5c38538.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.5a5c38538.0_1681252295364_0.06367323872204755","host":"s3://npm-registry-packages"}},"15.0.0-canary.e4b5ea7eb.0":{"name":"@material/tooltip","version":"15.0.0-canary.e4b5ea7eb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e4b5ea7eb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"bdcaac95761f3e639ee6fbc68f85ce33ce509a91","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e4b5ea7eb.0.tgz","fileCount":36,"integrity":"sha512-i7Cgeurc843JQI8fG95kea/gyih5k3B4std0IyjGIZaXfLZOiQfQ/RpnAiIUBqxJge6pxwHItV7VRI/oiIeytA==","signatures":[{"sig":"MEQCIGlUl3qRutI5YTxyEJ8H6jnPFIS33MSpft8cfyTpSJDiAiA7mlD+O6FznDJ8gGhssqC0hlsUESaf+AGJ4EJhY4kh6Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNefTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpT7BAAiJVjdvM/OqtPzTMEAdBHgBvF0lRsNYZ/8P4BSm0ZkEg4nn9L\r\n0WTn4RZNu9dOPEYPuQep6q0jP99AT9B0uAWYOAhuTNv76D9f7zYy8K+4Odys\r\nnRWrEy59dXHdXYVfSvUca09/64/rSPrXhizr/n+4ciKbTfpT3uZFD3X2vKrC\r\nnX1ZyGLMEc4B2E5r5pqYFFkTHOUGNC5qrc8/OW4NyiISeCNhLfmGV3gPM7Rp\r\n5GkEhEn5/Ws+HJ3WQ6MofLTfgybBgqUfcgqlkHn5KEDHzquBuBxTXtgOzyOo\r\n8dx95PijrnPuwr8hRcb6duzuT4UAWcl121UMFe5UAUU06LDJV+vLN8tt0DrA\r\np+JzGwWJJcG0WYt2GGo88b2KyKYB3CYgnup4QtCM8rVs+ClRU9+OyA2ZDSer\r\nUfz8VoUuph5NKdX0m7Pc91eo29jU9+MB72UXA50pZ/LyiEJRKW8FcoJ5qJfZ\r\nK3/PECEcRTEwvlwtbjAOXO+C511KbB4KXb39ZmfpSgvr8GsuzdbExH7q4ObE\r\nMLcS6TLSxNm9MqNa/miTvnxcyf1QnPNmyCQbOpD/2bRJO1+NezKOtquyXwOx\r\nPhc3xI10OOYd+XHUSIK10qcPfChuGh9druXMxBMCTRtNjp+RPCJ8gB7rNMde\r\ny/bl2kgsUidh86zYPtSp6wdCH1r478xSRi4=\r\n=6PLX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cfe1a97277f39a7f96340673857504470245556e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.e4b5ea7eb.0","@material/rtl":"15.0.0-canary.e4b5ea7eb.0","@material/base":"15.0.0-canary.e4b5ea7eb.0","@material/shape":"15.0.0-canary.e4b5ea7eb.0","@material/theme":"15.0.0-canary.e4b5ea7eb.0","@material/button":"15.0.0-canary.e4b5ea7eb.0","@material/tokens":"15.0.0-canary.e4b5ea7eb.0","@material/animation":"15.0.0-canary.e4b5ea7eb.0","@material/elevation":"15.0.0-canary.e4b5ea7eb.0","@material/typography":"15.0.0-canary.e4b5ea7eb.0","@material/feature-targeting":"15.0.0-canary.e4b5ea7eb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e4b5ea7eb.0_1681254355516_0.6312266106918702","host":"s3://npm-registry-packages"}},"15.0.0-canary.a094dd9c1.0":{"name":"@material/tooltip","version":"15.0.0-canary.a094dd9c1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a094dd9c1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6354c5b19f49dd917329c92fe18063f3339ae3dc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a094dd9c1.0.tgz","fileCount":36,"integrity":"sha512-XHrhM/UXY5zdwC1Y9AOdrGyhvEcCnArArWvDUAlhNPcMeO+HlT3c9QREbINh0om35Svl/0MBSG8TNmr+fe5cVg==","signatures":[{"sig":"MEUCICgXniNxrPOOquNF/SLFbiOo+sPrCG1vfjwD+hXCmMgkAiEA8Zs0KBGz/DKu1lrwa+l/7opb2TbVCTKNXSU48II90b0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOdciACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCrw//d/CNBo+VW/0qh0cbXizri0N3WS0E5VDvCRAcCz7dZNLBsC6A\r\nctv70Fk5OaEJxL3fhyDGEX5S1JfnutmaTcd92IHO7+uslEWNjNZA+snPiIDa\r\n87f6z7fHToGC9vIxIGmCIpZZ9dOtLtLv0VTh0sREpDEqTdwbG4I6ZH7g0M1Q\r\nof8I8vLbHB56fcuhHLS4YLJMzo5ZeciFeNSL4BDn4JWYibDkCXm0uf80fVhf\r\nVngijcPM8vJuan8OnhiRIVRX4JbZx9si3PC4648C5st24n983gCLEOW7LDIT\r\nouEvtveJmx1fGLR8rkZLmCRv0o9P9rOs1sW4ott5mvouXg0Qtia5JZbCVNnH\r\nhyuaF0WZ4Tss6YudhDgKyGVSRF4LvCvtjJ+pzOuCEzvybHKlu2InHsGQ8MhB\r\ndI5MssGX4lwMaxWPbpshTohLt/4oEetPilGj6oIAzBeqgjRdJglnKkoBE4Ai\r\nF51gxG397LIikyjSpryB5dAfz6Cbgrv8RTgDyhfbR8MUboA3+iMcMWLIUh0f\r\nLoTjjPW1tvotKq1lWcU7ngIgu0qrtVGZl9tB4+0fZzOVmu4fDdMTBpgk5yKw\r\nwkz1vwyXXD4tkTUoyzM5ABv4K5gP7ED9KToOR33lpgwcXBiCikjPpAmI4/KJ\r\nRWakAu5gpu/7x78FZ26ORbG0HGSqeQwfxjk=\r\n=h5F/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"aa5164e66f4afe6547ceeadc8a793bb4f489ff5f","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a094dd9c1.0","@material/rtl":"15.0.0-canary.a094dd9c1.0","@material/base":"15.0.0-canary.a094dd9c1.0","@material/shape":"15.0.0-canary.a094dd9c1.0","@material/theme":"15.0.0-canary.a094dd9c1.0","@material/button":"15.0.0-canary.a094dd9c1.0","@material/tokens":"15.0.0-canary.a094dd9c1.0","@material/animation":"15.0.0-canary.a094dd9c1.0","@material/elevation":"15.0.0-canary.a094dd9c1.0","@material/typography":"15.0.0-canary.a094dd9c1.0","@material/feature-targeting":"15.0.0-canary.a094dd9c1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a094dd9c1.0_1681512226054_0.44024660602385834","host":"s3://npm-registry-packages"}},"15.0.0-canary.f771b091c.0":{"name":"@material/tooltip","version":"15.0.0-canary.f771b091c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f771b091c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"28e9c39cb08fab1379000d68c67df4b37e1eed5f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f771b091c.0.tgz","fileCount":36,"integrity":"sha512-SxhI6+fP8ToQitKTf+Zlzg6YlZi3A/X7N2W62pYHXvC6RVPhN92CDVAQ/u9bLXHUUIbvFG5ajXXOUQ+Zi857wA==","signatures":[{"sig":"MEUCIA8lSwc+sK2kfa4XE1jheZbAja6TfbTvo11gAvj3TK/dAiEAt9JT8PcRQD9aR8k+/Yyj9cegm4uYrVjIR3ilanX0EX4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPWhHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpOLg/+K6QxLwTTmHrFom1yxOFptXt3fbA5+XE1kzNYrrrnzt3zgtol\r\nSVIdaGQmNfrTp/hbdW201VJCUnf2SR4IDFq1/+Wp39+mVWp81Oxc7+ggL6tG\r\nk7hJknxE2fLwyiD39/hQMtJpk0VsyJlTjZkP9Vgysg7HOZm+ZfvVJHRSqo4D\r\ncyRHRKUbsvbeSo+U4+xX3MKpfCZwkyzJ3VtWYuu11NXkAv/1bzLRP2Ct9wyg\r\n/s8MDvZWinIubTvgAIWLz6ScgyrhPIuyxj554nZmkk2kBRiJkFGlxwq14vVr\r\nJv0mueL+J+3v4d2FEnGrQ6HHhQlwU837/iEYMWqtH1+jRhCBxCS7BqWJoAAo\r\n25DKqB1oVwmHqFUBZmr3rZGOb0WH8p6/XKLh8bjo4ZHPcLG7iH/D3798k15t\r\ngxN3/0dHsLXJPABi33NXNHjJIMg4w1vaE6BJK3bFTcgA9Ds6MndBO1iFON6m\r\nUQad5qMFqXHCtQjmgolQYx6QB1d70X+Zd0t8ysUmtQ1XOVUW35F4LOJQBXXi\r\nk5NRgqRzqRejmq9nuo+Kzme10YMRxQMCKPBsI5iDfKBoVMEED79aMQB2jlt0\r\n6E3TEU2Tyt7Z6xsGKt0zMznFcLb0l0WWju2cE5sjWVeGkz+uDjPyp9o/riQR\r\n8ug55g2VuK6sgx7IjnXE1+SOIslmxIpu3yE=\r\n=LX+A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"de0e292c8ebcab887041fc4a59b3c0172f4d4310","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.f771b091c.0","@material/rtl":"15.0.0-canary.f771b091c.0","@material/base":"15.0.0-canary.f771b091c.0","@material/shape":"15.0.0-canary.f771b091c.0","@material/theme":"15.0.0-canary.f771b091c.0","@material/button":"15.0.0-canary.f771b091c.0","@material/tokens":"15.0.0-canary.f771b091c.0","@material/animation":"15.0.0-canary.f771b091c.0","@material/elevation":"15.0.0-canary.f771b091c.0","@material/typography":"15.0.0-canary.f771b091c.0","@material/feature-targeting":"15.0.0-canary.f771b091c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f771b091c.0_1681745990822_0.2883377588338072","host":"s3://npm-registry-packages"}},"15.0.0-canary.79b1b612b.0":{"name":"@material/tooltip","version":"15.0.0-canary.79b1b612b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.79b1b612b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"15391d220abcd51328bf1f3f6070bae874353dd8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.79b1b612b.0.tgz","fileCount":36,"integrity":"sha512-brY2y+/uRZI8bwRp49RyRtucK41pmtLRN/+BSoj+W2HOyKXbrBrXcJmm8bdzwz0sSOlqQLo/g/jh018pSkWJZQ==","signatures":[{"sig":"MEUCIQCCmtjerYkfc78u0TSPdZSUnT/7CwJKg5c64wpfGI45lgIgDSN9/vyvAVMWj2GeVH7027HQTbxpnA600hEXwslUKgY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQHw8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp0NhAAiAyJwu3vSWR/O1yv+Yki6HgL0P7Vva5x3PRZ5+u74T06s8q3\r\nxJ1kLt3ZopH/6AFeRQQDnWICS2Gnq0RSBU7A1X+6W/vwE8e6CK1RCX0qJxB7\r\nELKnibiGWvTmtlwCXoZhsgRFqGDAC3xIh3zyZ4LyAu7aJJTHVG/QZzsO3BRm\r\nzy3vKpNif1wZt8PgF4kwwyu7qChs2rWpOjub02+uQOkE19JZzGzjrU7FiTbq\r\nu0wCI99RiXCJnTnJ+YQzxzT8f2QMqnBxzHFYefLqLp4pRS1SW+f7nv27OTZY\r\n7z0+nItJpjLb6quCZUdHwQXMQzZlVF1HnAO0nQDfH/C+kHP1F1Pc5vopYWfA\r\nE5eBtUzpt6OBm3Gbisc5iS8PQsGpbeL5g+9+ex0Vl12m2O02kSajQpAEV06n\r\nki84sSbpCUIiww9/AkHOsCXZmJR07x7kh5kZ4EJdyFH2lzmlUZtpCcdegzmQ\r\nAtEz6OnQ8SyRfqgB9RxknmMnZZu3/aGwlpXCx2FEjw1rwXJ8fyAYdHUekROv\r\nlagAToD/uDOn+SecCbhc8hHn8BiDH6FJm3VAYtMz1IRCa9U49chHUA4zdKO2\r\nCh5O8EbM2kNHwD27+JfDg1PRc7IPpK1KrY+jUoAf5Yj2BcODnw4JAzTCzgUK\r\nF2VAYQpDa+MvMiwID6avGqnbQVCxEBX313k=\r\n=dx+f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c8248a1b49ee37b1782b19aaa49b5626c914916a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.79b1b612b.0","@material/rtl":"15.0.0-canary.79b1b612b.0","@material/base":"15.0.0-canary.79b1b612b.0","@material/shape":"15.0.0-canary.79b1b612b.0","@material/theme":"15.0.0-canary.79b1b612b.0","@material/button":"15.0.0-canary.79b1b612b.0","@material/tokens":"15.0.0-canary.79b1b612b.0","@material/animation":"15.0.0-canary.79b1b612b.0","@material/elevation":"15.0.0-canary.79b1b612b.0","@material/typography":"15.0.0-canary.79b1b612b.0","@material/feature-targeting":"15.0.0-canary.79b1b612b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.79b1b612b.0_1681947708657_0.32967481689570954","host":"s3://npm-registry-packages"}},"15.0.0-canary.6f50071e5.0":{"name":"@material/tooltip","version":"15.0.0-canary.6f50071e5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6f50071e5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e7623574908483289951a31e563b2ba72ee4bec7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6f50071e5.0.tgz","fileCount":36,"integrity":"sha512-wok+/ZSOh1FOpMbjnFZhIzUgE8P0UMltJVlSskk+tnm07CCMUX2I5WB3iE7BEAhtlsP+KM1QJs1zhjdAX++rXw==","signatures":[{"sig":"MEYCIQDpnEjo5FRXo6jeFkKnO9jbHC0/QHBlswpS8OUPrWBERAIhAPdMW62XgM7+lKY3Loe8Raxy+vj5ILI4tlUFn16lnWtP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQX5DACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNVg/+IC9+P0gQxdyFPnGN9ScWWAST1Z0nse5/1i1sEnjOxm+cxdtY\r\n7kGNjPr4F63g555LfXy6xPufrGTrTjEifQvGYka81tt6Dewk1NiUZOJncN9E\r\nKxonLsKqN3xPwhrmA/5RAe2Iypk/dEZxztqutiZbsKGimof8yEvNxGeYZZ9Q\r\nnVfYaFb5Vb/97RDEsXdPC3SARAeH4ofP5vcx6JwIgwVyH5/SZD+mrCdbk+sZ\r\nWAOzrFP+U3QLSUK88SRS5Z/Q0TVNgFCn/FAIY7S/8eulRM3fBrjzZWS4fNmk\r\ngwU0uxSIcuu3TJutNdeS001zZtTgz2vlHaIW4aXF6/zKJUOA+REwNzEUl0Hg\r\nfWgvRGQuYQEaeDFz2NFCcJNK/kmD4xeMURgSpf2jNub+Mk8LOLPa5KUPw8uM\r\npcL6Jsumg0YXsx/XyqcaeQUeYOpLvFprv3HfbXaBgBiiUWPdZ3mS/KL76ycx\r\nlW50nBxd/kNXwmIfrFN+bB6C8j5nkspGbZC2CLNw3esJ9ZpMVLKBs9fC3Q0L\r\n2aclTddwaGoHx65vZHAEf1TMafkH5GmXb3yDX0PJ6vPRzUxTycwADwyhbkiN\r\nhCh4TKnUrcgebR3W3G/EBWC46T5rnFLs7TrIyAsyusSHpgDvT/KS/pREK9g1\r\nrWbvUrkz1LEtrz0lwnS7LYOL8OKJWthemRQ=\r\n=n9Y9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0a5eb7e7a96b7f207546983c0f79d6fdf23f5228","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6f50071e5.0","@material/rtl":"15.0.0-canary.6f50071e5.0","@material/base":"15.0.0-canary.6f50071e5.0","@material/shape":"15.0.0-canary.6f50071e5.0","@material/theme":"15.0.0-canary.6f50071e5.0","@material/button":"15.0.0-canary.6f50071e5.0","@material/tokens":"15.0.0-canary.6f50071e5.0","@material/animation":"15.0.0-canary.6f50071e5.0","@material/elevation":"15.0.0-canary.6f50071e5.0","@material/typography":"15.0.0-canary.6f50071e5.0","@material/feature-targeting":"15.0.0-canary.6f50071e5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6f50071e5.0_1682013762967_0.67649308070113","host":"s3://npm-registry-packages"}},"15.0.0-canary.ef754381c.0":{"name":"@material/tooltip","version":"15.0.0-canary.ef754381c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ef754381c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e26df7b840ddcddc31b58e2c9e952749e77de435","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ef754381c.0.tgz","fileCount":36,"integrity":"sha512-K5BjM3pT63AG4AHqdcoEpAj6ldwWhBVpDFEg8njca8NiR8UW5TUZ2q2sljDCeV8fdX6GxjadNuOfErz2GtvuTA==","signatures":[{"sig":"MEQCIGFbbgPJ2KDW7T4mKoYAo6WtudPzsUf5exid2JnGqxjgAiAbOEJxcR6caPuFmf4ThGlSMY9HQpFLFkd35+yTyZQLEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkRuv+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXfQ/9GzjlXJF/zfUojgk1+fKXQqTR1kmweispRJt+aclfrvszEcol\r\n7UkI6zpSEsNpCl76eVtpNLiBsuvtH/FqH9ufFnj//XV1Kh3PkEL220URxoiR\r\nOjYjhbKt/6y14QWSe0uw/5V4hPTr1fj0TAWx5EtxS3vgorR2bz4XzcTZqMr9\r\nWHrhZQ2+xdfOrvO1PE2Ostu3Y2OLS5nFZt3s5727BRvzvP0Rt8u14PHR8ELM\r\nPHR3KbJklJRA0VZn46pdfRFhiQO0xvqQNGCnU1EU6gd/PfvM2ZtU7F11ZcyG\r\n1nT2lNA4351IZy4E4ep4OUM0lB9IpO9zc/WUeERLnKjMaY0x0M/7BK3SEzJK\r\n/kqBWjhJ50EZQP/Q8yVARpK7Hh0m4RM0O3AErzGEtGY3Y6DyIyzC25OjmStT\r\nmOfFuPX3yaVJmVyOmdkxRBg4m8QUl+lidhMuR5dFJniHUC086zYm5yblRR4g\r\nP3rIHSCZYX9kGVMmtqB1KPhIGgXWFg83a+gdXlGsvJCjEdcCaWMenxMsodOu\r\nzC9oqevWkrpr9BFDg8SBE/h6iKgAw0YDfi8Qi5ROYOBxsi58HDu8fTCGbqyi\r\nWIJqiomg9+8pA+DY1qjGbAH2VHZLPbc5Y1qzWVLcx06JPLOa9etrYX6WA9rT\r\n/xPUF3facam71xgVZ3hEvHwLEp36TYIh9GY=\r\n=q4U3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"998bb9432e40056ce6ec836100d9a46f72ace249","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ef754381c.0","@material/rtl":"15.0.0-canary.ef754381c.0","@material/base":"15.0.0-canary.ef754381c.0","@material/shape":"15.0.0-canary.ef754381c.0","@material/theme":"15.0.0-canary.ef754381c.0","@material/button":"15.0.0-canary.ef754381c.0","@material/tokens":"15.0.0-canary.ef754381c.0","@material/animation":"15.0.0-canary.ef754381c.0","@material/elevation":"15.0.0-canary.ef754381c.0","@material/typography":"15.0.0-canary.ef754381c.0","@material/feature-targeting":"15.0.0-canary.ef754381c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ef754381c.0_1682369533909_0.279668068514374","host":"s3://npm-registry-packages"}},"15.0.0-canary.69ebf61ea.0":{"name":"@material/tooltip","version":"15.0.0-canary.69ebf61ea.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.69ebf61ea.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"86da8c41f3417b813cebd7b302e0d79522a72e69","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.69ebf61ea.0.tgz","fileCount":36,"integrity":"sha512-qqiFI2PeuOkGFcNxHQ5BnSyrlVhq/Zr0a8skE8Zjm77axuchW7RHCF08Dc0Du5G0kSzgMWLwE2R6ydjhEQLrIQ==","signatures":[{"sig":"MEUCIQC4mH5h7xu16CvVHon4BlC0KVvF6OD8BI7JLtNqaOxTRQIgM85CX7bn+6kpIstx5LmiViKnuJQg2XG9ebg6nghQ12o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSq9wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7Bg//biYPLFxk4Y+zIjjEIkVdbl5USmYbgjkR+97ZA3hDfv0Xe/LC\r\nANjggBnpm5ou0V0c3fhvJ92aI1/12l8sJHlcsq1i441qi575CL7K/mVP+Cp8\r\navtTcskYXG8Xa5P65JlWuCX0Py5pt0UFEWKU3AU+m5KaiyKfZ1iHX6uLhdih\r\nnoHzPTmdG7Z4ZxbfLySB9ZSRC30nEAvg/7EObOduo/OdKWDGXbu2Np8PUw4H\r\nwPvG6ue1lnuC9BE7D3GUZxhNJWKnA+MTOOzi/td2kzuLanbDYkRXNW76nuB5\r\nZmdQnxCV9J/oyi1xCyzONt3Tj1DNHFIZSiSygBL+5Dowt8hpG2XK/5Tj/WWO\r\nOVU/ZrycUs3nhxVUB9gkUWsO19lmitNfY2Rf7uSS2tcWsY1y/5J/7i29q+cj\r\n+nh8azy8rpzM6C5Jc8dKLaDP/q6Ezt1PP6Ko3Cja7De0rrNZ8TC5seX/WAnn\r\nHaoIrkAh2zByYSvfhdd3qVRrjMlFZcYXXXHZ61ZiFJPkw4hra11byUaTesb0\r\n98a7Sn1XhFRYPFh9VLud3/WqBX1ZyZq2eoUiIExAOqLy24O18aXOt5j2pOFK\r\n5bt+3hy/l/xXPVXVSYhXedlm+bBw8jKY5yvGiGEkfxmK2eOzca+S610+v6Pd\r\nSqEd4IG+4dj+4xzHlJ3EZZkqxcXYddmCOtk=\r\n=2M5P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e68ad025642429a51f137e9f3fc853364faf0622","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.69ebf61ea.0","@material/rtl":"15.0.0-canary.69ebf61ea.0","@material/base":"15.0.0-canary.69ebf61ea.0","@material/shape":"15.0.0-canary.69ebf61ea.0","@material/theme":"15.0.0-canary.69ebf61ea.0","@material/button":"15.0.0-canary.69ebf61ea.0","@material/tokens":"15.0.0-canary.69ebf61ea.0","@material/animation":"15.0.0-canary.69ebf61ea.0","@material/elevation":"15.0.0-canary.69ebf61ea.0","@material/typography":"15.0.0-canary.69ebf61ea.0","@material/feature-targeting":"15.0.0-canary.69ebf61ea.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.69ebf61ea.0_1682616175735_0.06030118126662143","host":"s3://npm-registry-packages"}},"15.0.0-canary.b90be86de.0":{"name":"@material/tooltip","version":"15.0.0-canary.b90be86de.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b90be86de.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"46378bf7c3bb390cfb9717269a7c68ebddeba716","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b90be86de.0.tgz","fileCount":36,"integrity":"sha512-yGd6PP/0gbPs4Tg/Yr94TR6Vu1UIIEQvZVoVdNVdvpvcklxmtRv6wJa9ZnweYQjF6u9DDa9q9mU0wXvuTFZgow==","signatures":[{"sig":"MEUCIQCzmF0S3RBKw/sI6nYHjnl4Dwn87xNP55JGkNBG4WU6SgIgWM2JNcXio1NKoUKENUp0/Ms+uGNuIb6n+DETrJWFa2U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTGNhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfZw/+MDexnZu7oeMihpWUE1inDL2kdJQC342Eb6oBAEcoeffdzvmF\r\nicZx6SXAYt5a1HeOSQ2fe/b6Y2IISpjvyPkaQAXt0GnItz709tYWYaGvsrAv\r\n2W9JjBespdQmx4hXwBrynVRwkhjim0qoGM3PJSXpCfXvOl3YwpQuZrJBvNmQ\r\nJUmA2BjdvGqE6GVU+L0HN6WD5145kx2gWkbB/OnO81LBvg636fBpaXlLSWwL\r\nUnxGzncB7tLcA3IOSh3JyoE0n2ZhTQP+VaK3t4ol9L+rDsAub/RFin6Isq6T\r\npwnsZv9FY7hCq3phDTU3TSNjtLr62eiN4DP8MF5ajGCQwIe6XiD2REzlxw8Y\r\n/34j7BHl9F9FmsYDhwhno/cZj8NocEgFAI+ApxOwAG4y0+/7w0wq3IK4nApr\r\ns7oczQGMJfi0ZfKho6R+LocTl6R6qnCzz1/okezhEHXbGrd16ZKbHVQzxKQw\r\nxhsjEHW7NOspivBMT9MGHChawvJH7xDD29YB0IZDISuLvPCT1PoRCaur6QPP\r\nzH3p/0Xk55CDeA5E9Cse9KHIMYZxUHV/PLb/I+z4XyTH2wMnlhwJfE3Mumx/\r\nR4xa8LsREMz9Rk9yfrM4JzIVhAAgGAueSMFRgSX1LOQjg16Ap6ZOsNKwcwn7\r\n3xwGFvRlqnQ7KRc7LzFQe5n5LTx4R+smlBs=\r\n=3eCe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"903a4c00d6c4501b4eae8ac0007164ef4a97ce0e","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b90be86de.0","@material/rtl":"15.0.0-canary.b90be86de.0","@material/base":"15.0.0-canary.b90be86de.0","@material/shape":"15.0.0-canary.b90be86de.0","@material/theme":"15.0.0-canary.b90be86de.0","@material/button":"15.0.0-canary.b90be86de.0","@material/tokens":"15.0.0-canary.b90be86de.0","@material/animation":"15.0.0-canary.b90be86de.0","@material/elevation":"15.0.0-canary.b90be86de.0","@material/typography":"15.0.0-canary.b90be86de.0","@material/feature-targeting":"15.0.0-canary.b90be86de.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b90be86de.0_1682727776760_0.3823848556724403","host":"s3://npm-registry-packages"}},"15.0.0-canary.51f9c0c28.0":{"name":"@material/tooltip","version":"15.0.0-canary.51f9c0c28.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.51f9c0c28.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4e6e3ac41bf6bb9286137adf8f20a663e959cd42","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.51f9c0c28.0.tgz","fileCount":36,"integrity":"sha512-Lvh/Yjmh2wLSFp6p/S6PWrbIQbWFNqAq9K7YAnjYaWLUfBznz/GmgJbWzIhwtTwLzA6eyCk84KY7Ldm4y6QXnA==","signatures":[{"sig":"MEUCIQD+We8htpBmdcic2+75JAPcg0g9i7EE6f9BjYjkdS5hfgIgHBPz0Nr9/ux16r2yoHVWuF98lnbYw/b2SRYXclGByEA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTGWpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqqqQ//WYrsmH6EjdSbSSERB1ynG9TJoAUU51NYrlM7T6Seqki17Lmo\r\nirpTi5MyZQFb3vF6OSbO1aRxBrvVuEfHeB4m7CooIzbEDZORAIi6SrJbrYsQ\r\nNHwJJLFIT3EScUJwQQvpR3janKgtD78RNyK1WlDbjgEVzHektllAB8JSbxHc\r\nkFvao4ussDAsXcV1tTxuxVmmWNOvRMuyyvxasZYVvR/w5XPHpiHc1xFaWch1\r\nUQ6qEX3KIFNzsDzCnwD3PGPg0gzwgotVkA+/kPAEH66Lii0YLSZvjvQjboxL\r\na/03lZlhwo0maFLTjf5jZ3kV/sQJN1t2ALnJHNjIYAg6rBKlqaGYFYLQpv2j\r\niJTSkUL+GYikRuo+PLpHutGl4Z1C3WSRUk0WInhXX8T1Abf/YNbOpIeqfbQt\r\n+DsuAZfiaL59zeqJHYWiY+lWbIQFOV5p3+BlD9u+ECLXHBQZEeqhHDWTkNhJ\r\ntiof3BU+n3ikrdsiuFAJ1k7vl7rCX4m2itqMGh43GGeY5JARvudKrlCHCt+C\r\nYtBoFZVzYiR/Xm+Uv3i+aotP4gtpMdxKpd2cWqcvuCucu3SAGb6l/EWwl/bM\r\ngOZMla+jweRaIx7giCiGyIaewlHh2e4+NiWncmzohmb5jkQICtfimQ/Y8cEK\r\n7Rkw1zQwkPp7m9C7Vb8yP17/KffE8Gb2S5w=\r\n=PVWP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"87662f1719363ac8e600f73ed8a7795c25d8add6","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.51f9c0c28.0","@material/rtl":"15.0.0-canary.51f9c0c28.0","@material/base":"15.0.0-canary.51f9c0c28.0","@material/shape":"15.0.0-canary.51f9c0c28.0","@material/theme":"15.0.0-canary.51f9c0c28.0","@material/button":"15.0.0-canary.51f9c0c28.0","@material/tokens":"15.0.0-canary.51f9c0c28.0","@material/animation":"15.0.0-canary.51f9c0c28.0","@material/elevation":"15.0.0-canary.51f9c0c28.0","@material/typography":"15.0.0-canary.51f9c0c28.0","@material/feature-targeting":"15.0.0-canary.51f9c0c28.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.51f9c0c28.0_1682728361020_0.4156566796816681","host":"s3://npm-registry-packages"}},"15.0.0-canary.4e840d685.0":{"name":"@material/tooltip","version":"15.0.0-canary.4e840d685.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4e840d685.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"9c668c436df392fd90c424a8d36119d832db78ed","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4e840d685.0.tgz","fileCount":36,"integrity":"sha512-qFVpwSsI4ujtJYdAgRy2z2VrRN56gYO2FpPjbvqb2+47wStIBqMuMvt28kdeTL7u9nWGKm6t8RNT0/GbNnQI6w==","signatures":[{"sig":"MEQCIBNRaypLF6S/4vIiliEar2zM/kVJOh2vzGpcwq5UT5HLAiAJfTosR7yGVRf3S7zWsukaRiSPCo1Ju2yH9Saug0r1Wg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"feb1f9f53257b520aff6dfe5dd1a15e319e73a40","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.4e840d685.0","@material/rtl":"15.0.0-canary.4e840d685.0","@material/base":"15.0.0-canary.4e840d685.0","@material/shape":"15.0.0-canary.4e840d685.0","@material/theme":"15.0.0-canary.4e840d685.0","@material/button":"15.0.0-canary.4e840d685.0","@material/tokens":"15.0.0-canary.4e840d685.0","@material/animation":"15.0.0-canary.4e840d685.0","@material/elevation":"15.0.0-canary.4e840d685.0","@material/typography":"15.0.0-canary.4e840d685.0","@material/feature-targeting":"15.0.0-canary.4e840d685.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4e840d685.0_1683041703039_0.5932764200571512","host":"s3://npm-registry-packages"}},"15.0.0-canary.10b8563e4.0":{"name":"@material/tooltip","version":"15.0.0-canary.10b8563e4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.10b8563e4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6a2c73445df5117d0c0b2cfef6e6ea1f98e256ec","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.10b8563e4.0.tgz","fileCount":36,"integrity":"sha512-484+ALJ4cs/MGDthQS4fKIHIFC18Xmpl7KkFpVc/d00ehB9G+LQJjaDQSwDBkqCO7ohjrnuNPnxLCCDMmUyUsQ==","signatures":[{"sig":"MEUCIGWOavNW2cyTb1p3ZweWGQj257wC9FcPilp5jw3EAnr6AiEA9tR0RSbeTnC2dJz6AMCcnEY3i3bUUQQi7VtOObr6FA8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUaAKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLKxAAlQ8qwFIivWuX5rpkln36M36v0apXP4eGMP0vVh+5sn05D+B8\r\nicIM5tCJ/ahTyHfsOQCmcRMhzwkRy0/AKOtxppsmR7sivMj1nHdH/t9Q+obo\r\njJg2Cawadzq66uoWJh5aShwyAQM1YHiHDf+ptzQIE7tTXbCTv0kaYkr/L5ec\r\nzfB8lw1kls674VMKd173johp+g4GH3Ef9sKA/gysnv35ADHqa79Ad/VpLHKa\r\nhKeXsMRgx+lHa3sgTDl9H71Mrcn1SrVC4Ta6OWp61aJbGcJrRo6EFuhmg1Rn\r\n6GEsCqI12lXhoSNS6Cra6n6zhb9WBgDMCcTLs1Rkffof7L/+M8T6fHbKMyx8\r\n0ELhjE04ZAGBl6Va1kTtyO3nREjxUoo5nlKwN+EbG3msUwgeAmqEqKTbncwG\r\n6y5m3mSueFWh5d23+c63KsghGhHpwLRYcw5usI25mKIsTqC901+o7fiDeGOM\r\n/p+VFduSHNgnupg/HntAIMRMYshTqt0TSGyRGRRREWtwm6vvpc8xBDw0meQi\r\n7tObAlhwDxlHPPmEGPlTuh7lI+/hPKwZGjFyEAx0w46SXB/jcboRv4cK26Zo\r\ngluSSkpprdBd8xPDe3Ri4oskkRq4ry09PIZmF2S/hvVkjFagKn6dwjLEn7YF\r\niwtkR7Zr94ZHOml/4V3YF2eSwtO3j/j+CW4=\r\n=XGAt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5f71dcbe45f5245c72c0fabae0162af558c5c395","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.10b8563e4.0","@material/rtl":"15.0.0-canary.10b8563e4.0","@material/base":"15.0.0-canary.10b8563e4.0","@material/shape":"15.0.0-canary.10b8563e4.0","@material/theme":"15.0.0-canary.10b8563e4.0","@material/button":"15.0.0-canary.10b8563e4.0","@material/tokens":"15.0.0-canary.10b8563e4.0","@material/animation":"15.0.0-canary.10b8563e4.0","@material/elevation":"15.0.0-canary.10b8563e4.0","@material/typography":"15.0.0-canary.10b8563e4.0","@material/feature-targeting":"15.0.0-canary.10b8563e4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.10b8563e4.0_1683070985660_0.6049367993045656","host":"s3://npm-registry-packages"}},"15.0.0-canary.736b7fda4.0":{"name":"@material/tooltip","version":"15.0.0-canary.736b7fda4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.736b7fda4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f9af54058917aff417bc750dc7b41859f0b3267f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.736b7fda4.0.tgz","fileCount":36,"integrity":"sha512-k8wThfGf5UIOd3r3ZuGytJqBuy3cFF+/oo2jJ68yzCQEb+RB7+ebqoRVyURkjF+HT16gMFbnGDuV9pjFEz1tSQ==","signatures":[{"sig":"MEUCIQDAHw6JwQ3GCvapKnodGMl0OtmhrS/hdETebH/ImlqwCwIge0Ef+bM5mhx6mjRaG0+1fYc9qjxtLFGiY8Biclwi/i0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUnl/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQMQ//X5KP8zgrTPAu1pD1waACkmWhR8x3XhfaUQKILuIhwR8Xa+cZ\r\nyyB/GBV+HUQjl7Bv3kyi1Z8xAMrDtWuvPrbxChGgfuFvoxTKdhsqacUIJ49b\r\nNHb841POGlA0ZPR2B77122Cj6FuR9XHjUHUsy+VuGbFDQJXn2qMrclVFfXia\r\nqtfFhWs7jBA/9Mq02yamJRJ6nDJP1FIqjMZJwpbUYuirRbBW7MV6mhIb+hq8\r\nZurl0ioT2Z//yLFZUHTgC7j4WyFqCsQq7MKL+/gH7jeC+4MTzdNGzJmuo/sg\r\nuvpEleOoIXflPk8n3ERAiF978kpxJ40dBur/HyrPn8CZufTL/i/bKF0vktcQ\r\njo6b+vV7gZAQp3xtGZN7h/krYFS6QfnoG2ZYi6sqijPGxxW/TYNWYTkU4RUl\r\nT8tb1gGOEKZhMzFMO74qqzYgcBpczl9YWxamx9fV8NRa1nvDLvyjPEDfOHfZ\r\nqoJYp1mLhayYZSoegGzZ0yA1Oe21jh7l0l5ayalaf75i12cQcPmBr6EqIjcM\r\nOwFeKG10XcuSBPlcrikSNx5hdHNmaOKxNHrmJH7vziCbNWbZ/eQ5ns2qLkfZ\r\nP1wuHmHgEVWclDzMy5uy4CBf3Rt3448iB9fV325OYcqLPZ6kYbsxoEL6LL7t\r\nD4ufiPGQPRL/OJlIOwEFRAZr0iyr0Gm7Yu4=\r\n=UG6H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"b9ef54594aa8f93612aed085460f035d0aba61bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.736b7fda4.0","@material/rtl":"15.0.0-canary.736b7fda4.0","@material/base":"15.0.0-canary.736b7fda4.0","@material/shape":"15.0.0-canary.736b7fda4.0","@material/theme":"15.0.0-canary.736b7fda4.0","@material/button":"15.0.0-canary.736b7fda4.0","@material/tokens":"15.0.0-canary.736b7fda4.0","@material/animation":"15.0.0-canary.736b7fda4.0","@material/elevation":"15.0.0-canary.736b7fda4.0","@material/typography":"15.0.0-canary.736b7fda4.0","@material/feature-targeting":"15.0.0-canary.736b7fda4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.736b7fda4.0_1683126655717_0.7007543392933258","host":"s3://npm-registry-packages"}},"15.0.0-canary.0e533c5a1.0":{"name":"@material/tooltip","version":"15.0.0-canary.0e533c5a1.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0e533c5a1.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7a45cd526e87fb53fbaeb84ef0906b18e65561ab","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0e533c5a1.0.tgz","fileCount":36,"integrity":"sha512-YNbUFvDTAa55YmYXYwje5p7hMmY8QW0+4S4G6D2X8WzZL5X76V+f8SxiA6fdgtrDm/z+8mLL4/EMpxPIRxAJjw==","signatures":[{"sig":"MEUCID7RzwvZY7UIOtkdE9tvph8iNBt4jvDMwM2489K+vddUAiEAqCcJRq1lldicc/xZ6zH1FI6vircbSf90VSYCeNquLxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6b9b4497cc6457c9e92ab3abdaad626c73e610a4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.0e533c5a1.0","@material/rtl":"15.0.0-canary.0e533c5a1.0","@material/base":"15.0.0-canary.0e533c5a1.0","@material/shape":"15.0.0-canary.0e533c5a1.0","@material/theme":"15.0.0-canary.0e533c5a1.0","@material/button":"15.0.0-canary.0e533c5a1.0","@material/tokens":"15.0.0-canary.0e533c5a1.0","@material/animation":"15.0.0-canary.0e533c5a1.0","@material/elevation":"15.0.0-canary.0e533c5a1.0","@material/typography":"15.0.0-canary.0e533c5a1.0","@material/feature-targeting":"15.0.0-canary.0e533c5a1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0e533c5a1.0_1683305876594_0.4020720474146178","host":"s3://npm-registry-packages"}},"15.0.0-canary.5f01c15a2.0":{"name":"@material/tooltip","version":"15.0.0-canary.5f01c15a2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.5f01c15a2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1d458a4efec7de441cf0f45009c2a386a60e3348","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.5f01c15a2.0.tgz","fileCount":36,"integrity":"sha512-HUszkLsh++wHMO4+xvdHLsWlNHrsVCYgjys773rziWJRxG312Zh6JBnZr58JqtDWqGMUgFK4Vt+CQOlKjInMIw==","signatures":[{"sig":"MEUCIQC7HbHHGDO3bd2iR+eTdkRtm4IikaltzOdhWVBzLZmnUwIgYdX82O/jZvEh98N3SIfxvMkDhxc9+20arnQaoyIGf6c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7bb1c5dfc575b36654ae046d1f4ab3b27e8c8f9d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.5f01c15a2.0","@material/rtl":"15.0.0-canary.5f01c15a2.0","@material/base":"15.0.0-canary.5f01c15a2.0","@material/shape":"15.0.0-canary.5f01c15a2.0","@material/theme":"15.0.0-canary.5f01c15a2.0","@material/button":"15.0.0-canary.5f01c15a2.0","@material/tokens":"15.0.0-canary.5f01c15a2.0","@material/animation":"15.0.0-canary.5f01c15a2.0","@material/elevation":"15.0.0-canary.5f01c15a2.0","@material/typography":"15.0.0-canary.5f01c15a2.0","@material/feature-targeting":"15.0.0-canary.5f01c15a2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.5f01c15a2.0_1683307657066_0.558477512084889","host":"s3://npm-registry-packages"}},"15.0.0-canary.3b5b55e31.0":{"name":"@material/tooltip","version":"15.0.0-canary.3b5b55e31.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.3b5b55e31.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"56fd29c550f1c27bcb087730a774d51aebeca1f7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.3b5b55e31.0.tgz","fileCount":36,"integrity":"sha512-WxAJ8LxMdvSKgD1tC6mX8VbhLiMxijQm+uGK5XJZIbnHHJ6GNvvj+/kY0UydsaFPpAEtkDr3X4L9v70OF+hBBg==","signatures":[{"sig":"MEUCICsFAWoBSHr+EEpJCx9w34lIBnj4mGobahLVhT32IAvHAiEAgtkhZYFqYgkSEClc3cXEoQXy+PodVpmeIuvQ9/GoNJA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"c262d9ee39655e869886d1584551a096ae56dabc","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.3b5b55e31.0","@material/rtl":"15.0.0-canary.3b5b55e31.0","@material/base":"15.0.0-canary.3b5b55e31.0","@material/shape":"15.0.0-canary.3b5b55e31.0","@material/theme":"15.0.0-canary.3b5b55e31.0","@material/button":"15.0.0-canary.3b5b55e31.0","@material/tokens":"15.0.0-canary.3b5b55e31.0","@material/animation":"15.0.0-canary.3b5b55e31.0","@material/elevation":"15.0.0-canary.3b5b55e31.0","@material/typography":"15.0.0-canary.3b5b55e31.0","@material/feature-targeting":"15.0.0-canary.3b5b55e31.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.3b5b55e31.0_1683312036101_0.5031266078754546","host":"s3://npm-registry-packages"}},"15.0.0-canary.d0788120f.0":{"name":"@material/tooltip","version":"15.0.0-canary.d0788120f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d0788120f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"76460df4f9240642ff8b1a1b734ddad895b2fea0","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d0788120f.0.tgz","fileCount":36,"integrity":"sha512-xZMqHT7n6lgVycEetOFOeUYwj/S8+7gqWU9nERMhwR5lyeRr6nX/9Vre8IXlH4tE6Jd1r3FsemOVwD0SBmBwRw==","signatures":[{"sig":"MEQCIFti2hIBbozfOFqtsrr2iQUdisWtudo9Sgu7+B5LfDn9AiB4tbbLq6pQpqRJBnjHEb22RMvSuCLEzkd3am8K2EJTFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7eccbee262206623b89c40dadb4e11abe30d5e45","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d0788120f.0","@material/rtl":"15.0.0-canary.d0788120f.0","@material/base":"15.0.0-canary.d0788120f.0","@material/shape":"15.0.0-canary.d0788120f.0","@material/theme":"15.0.0-canary.d0788120f.0","@material/button":"15.0.0-canary.d0788120f.0","@material/tokens":"15.0.0-canary.d0788120f.0","@material/animation":"15.0.0-canary.d0788120f.0","@material/elevation":"15.0.0-canary.d0788120f.0","@material/typography":"15.0.0-canary.d0788120f.0","@material/feature-targeting":"15.0.0-canary.d0788120f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d0788120f.0_1683620672654_0.44174383828024344","host":"s3://npm-registry-packages"}},"15.0.0-canary.f52358dd0.0":{"name":"@material/tooltip","version":"15.0.0-canary.f52358dd0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f52358dd0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"7c854b2e28fee1e11ec3f4d2825abb6e9d8d72cc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f52358dd0.0.tgz","fileCount":36,"integrity":"sha512-nkhPCphj+fVfRnDuAH37G1Q5mjXsJNVts5Fb68M42Gj0L/QmjJw3o1yQWsn2wNzVVE0/EVLOhXIsZkZO0E+G2w==","signatures":[{"sig":"MEYCIQDKf/O8CJUZd118UgvbESF1bHFQll3Kas7rmL5PI1x/rgIhAM3jt8qexkSZlFMQe/LEcNw0FAizfah8vlhPGDf7UmUu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a4baf07a9736a6e1fa40001f7198ae1865d67392","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.f52358dd0.0","@material/rtl":"15.0.0-canary.f52358dd0.0","@material/base":"15.0.0-canary.f52358dd0.0","@material/shape":"15.0.0-canary.f52358dd0.0","@material/theme":"15.0.0-canary.f52358dd0.0","@material/button":"15.0.0-canary.f52358dd0.0","@material/tokens":"15.0.0-canary.f52358dd0.0","@material/animation":"15.0.0-canary.f52358dd0.0","@material/elevation":"15.0.0-canary.f52358dd0.0","@material/typography":"15.0.0-canary.f52358dd0.0","@material/feature-targeting":"15.0.0-canary.f52358dd0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f52358dd0.0_1683901906418_0.2562731021875948","host":"s3://npm-registry-packages"}},"15.0.0-canary.576d3d2c8.0":{"name":"@material/tooltip","version":"15.0.0-canary.576d3d2c8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.576d3d2c8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"71ecb72a2ac9ea6b053e644bffa32d3e8c3112a8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.576d3d2c8.0.tgz","fileCount":36,"integrity":"sha512-jLqEOTSaGY2iezoNnbvgmbHh+U+4KXaL1WvCwWrrzuaq+d204pEFfuhnIrFksChgn/vTKLbBJ08j41Dxv483mg==","signatures":[{"sig":"MEUCIC2IGE9O5TryKmPuPaw3vY2zdeMLCgdM8FNRB91QfJanAiEAo9IHaOGUK7y+Wzqp0SRLz0vwZYpSYAq4t0CkjwK7BOE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6ace19a21b6654f14cad48fc007198859874c910","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.576d3d2c8.0","@material/rtl":"15.0.0-canary.576d3d2c8.0","@material/base":"15.0.0-canary.576d3d2c8.0","@material/shape":"15.0.0-canary.576d3d2c8.0","@material/theme":"15.0.0-canary.576d3d2c8.0","@material/button":"15.0.0-canary.576d3d2c8.0","@material/tokens":"15.0.0-canary.576d3d2c8.0","@material/animation":"15.0.0-canary.576d3d2c8.0","@material/elevation":"15.0.0-canary.576d3d2c8.0","@material/typography":"15.0.0-canary.576d3d2c8.0","@material/feature-targeting":"15.0.0-canary.576d3d2c8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.576d3d2c8.0_1684202478475_0.833269948237308","host":"s3://npm-registry-packages"}},"15.0.0-canary.19bb36a46.0":{"name":"@material/tooltip","version":"15.0.0-canary.19bb36a46.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.19bb36a46.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ea7cfe3c0a3cdf937b2422f5c5e0fe3adc2379c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.19bb36a46.0.tgz","fileCount":36,"integrity":"sha512-SwggodbgN9EwXCqZmhpXRKaqozP4drzouAtBO1qOhn4vegwY0iX/VPiEEJQ5zJCWiLlN5RoSpQEWZO3mkxeEQw==","signatures":[{"sig":"MEUCIQDn3mfEimqIZSmvGVt0F8lLIGfQRp7YR5dZ34R7AWJALQIgdCDID5I7rA/EP2ZmUc8FJvOdBPGaejbIjEsEJfdgbGs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"75157be315eeaa02f70ed69f97e44a7d40d53e42","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.19bb36a46.0","@material/rtl":"15.0.0-canary.19bb36a46.0","@material/base":"15.0.0-canary.19bb36a46.0","@material/shape":"15.0.0-canary.19bb36a46.0","@material/theme":"15.0.0-canary.19bb36a46.0","@material/button":"15.0.0-canary.19bb36a46.0","@material/tokens":"15.0.0-canary.19bb36a46.0","@material/animation":"15.0.0-canary.19bb36a46.0","@material/elevation":"15.0.0-canary.19bb36a46.0","@material/typography":"15.0.0-canary.19bb36a46.0","@material/feature-targeting":"15.0.0-canary.19bb36a46.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.19bb36a46.0_1684266919276_0.24463902882570143","host":"s3://npm-registry-packages"}},"15.0.0-canary.aa5ac7fe5.0":{"name":"@material/tooltip","version":"15.0.0-canary.aa5ac7fe5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.aa5ac7fe5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e33ad3e32e075581df2fa47664a8ca91f978a25d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.aa5ac7fe5.0.tgz","fileCount":36,"integrity":"sha512-uEfKGMBZeq9uJfHQgIkpESb/cDpS428MFqw4CkFu6dab6Uc5dffa0leSLOqNBETJL+T4rHvZ+3sXN5z7RgUSyA==","signatures":[{"sig":"MEYCIQC93cxXTFxGHNx7IfJTo4Tfw0hnRqLUgmugDij9skTvTQIhAIFUiqAQTfMqYhVt2aTdAiTLYdBYgWbjRJL5Jv/DWa/R","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"83e86542dd6facc8ffe487d31111412ee18b5bde","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.aa5ac7fe5.0","@material/rtl":"15.0.0-canary.aa5ac7fe5.0","@material/base":"15.0.0-canary.aa5ac7fe5.0","@material/shape":"15.0.0-canary.aa5ac7fe5.0","@material/theme":"15.0.0-canary.aa5ac7fe5.0","@material/button":"15.0.0-canary.aa5ac7fe5.0","@material/tokens":"15.0.0-canary.aa5ac7fe5.0","@material/animation":"15.0.0-canary.aa5ac7fe5.0","@material/elevation":"15.0.0-canary.aa5ac7fe5.0","@material/typography":"15.0.0-canary.aa5ac7fe5.0","@material/feature-targeting":"15.0.0-canary.aa5ac7fe5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.aa5ac7fe5.0_1684776431953_0.7687879759500122","host":"s3://npm-registry-packages"}},"15.0.0-canary.90291f2e2.0":{"name":"@material/tooltip","version":"15.0.0-canary.90291f2e2.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.90291f2e2.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ae0263419daf18b5a4e1f108046c91335c6ae746","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.90291f2e2.0.tgz","fileCount":36,"integrity":"sha512-H3XsrctgRriNwt++NN+Zy6/JhyRznWo2pXiTFnOlaYwHOiGIFCNZR0A/0vf/3Kpf0GYhTfkJEFJMosUSZidSDg==","signatures":[{"sig":"MEUCIQDbGhc45BIQhknuqm3Iu66yYgrBxPa+bF1gpGdyvPA+9AIgJK/km3h/BDZ9Spu1NHkihFfur8mq+6lUxAb3TcceVUw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a1c306471717b15ae8f0b481703ed1b46162df25","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.90291f2e2.0","@material/rtl":"15.0.0-canary.90291f2e2.0","@material/base":"15.0.0-canary.90291f2e2.0","@material/shape":"15.0.0-canary.90291f2e2.0","@material/theme":"15.0.0-canary.90291f2e2.0","@material/button":"15.0.0-canary.90291f2e2.0","@material/tokens":"15.0.0-canary.90291f2e2.0","@material/animation":"15.0.0-canary.90291f2e2.0","@material/elevation":"15.0.0-canary.90291f2e2.0","@material/typography":"15.0.0-canary.90291f2e2.0","@material/feature-targeting":"15.0.0-canary.90291f2e2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.90291f2e2.0_1684863854477_0.7863129711783037","host":"s3://npm-registry-packages"}},"15.0.0-canary.446734f27.0":{"name":"@material/tooltip","version":"15.0.0-canary.446734f27.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.446734f27.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"0ed059267cc44e5c1d3b734f4eda62793af8a8c9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.446734f27.0.tgz","fileCount":36,"integrity":"sha512-zz/41RDQzSLEr91Wwv8EO82Gft6d2egC+dLwZ4VLk9KZiSS4NIsmmM+dr6iXVVYrRHnnsOkWN1v3lOVn9j/QAQ==","signatures":[{"sig":"MEYCIQChzPBi0rzVpxQFTSAY+joVKDQFYrfgPXkQ3r9l5V/zmAIhAK+HYQ9lsRWr0e9yqwI/NI/jiN0dj7DyK79I4vcJA63c","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a2536a849aada5f06aa85deaa7be06f44f620023","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.446734f27.0","@material/rtl":"15.0.0-canary.446734f27.0","@material/base":"15.0.0-canary.446734f27.0","@material/shape":"15.0.0-canary.446734f27.0","@material/theme":"15.0.0-canary.446734f27.0","@material/button":"15.0.0-canary.446734f27.0","@material/tokens":"15.0.0-canary.446734f27.0","@material/animation":"15.0.0-canary.446734f27.0","@material/elevation":"15.0.0-canary.446734f27.0","@material/typography":"15.0.0-canary.446734f27.0","@material/feature-targeting":"15.0.0-canary.446734f27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.446734f27.0_1685483369618_0.5605794725429543","host":"s3://npm-registry-packages"}},"15.0.0-canary.19de312d8.0":{"name":"@material/tooltip","version":"15.0.0-canary.19de312d8.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.19de312d8.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"ec6cfe74f3b394c44f301c169a2a2cc8468d636c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.19de312d8.0.tgz","fileCount":36,"integrity":"sha512-Pd5AiisrFfUPwh4ezcOhLuEhOshHdZ/mRSPSXwWDlMTJe6MF95bzC9YaH8ZxjSGelSWIGpSf+Y1PuQahaiRn3g==","signatures":[{"sig":"MEYCIQCVBkebufeFVindO1MpRi4CfleNc51G7pwevC4nkGhLcgIhAKj4yIQjR8Ap+mwX/exNDtTTxUBLm9V2PZ7zMD7pqvVS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"dc3811573a34ccafa5c09bcf14574bfb95373958","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.19de312d8.0","@material/rtl":"15.0.0-canary.19de312d8.0","@material/base":"15.0.0-canary.19de312d8.0","@material/shape":"15.0.0-canary.19de312d8.0","@material/theme":"15.0.0-canary.19de312d8.0","@material/button":"15.0.0-canary.19de312d8.0","@material/tokens":"15.0.0-canary.19de312d8.0","@material/animation":"15.0.0-canary.19de312d8.0","@material/elevation":"15.0.0-canary.19de312d8.0","@material/typography":"15.0.0-canary.19de312d8.0","@material/feature-targeting":"15.0.0-canary.19de312d8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.19de312d8.0_1686071986731_0.4677654748692113","host":"s3://npm-registry-packages"}},"15.0.0-canary.6081d829b.0":{"name":"@material/tooltip","version":"15.0.0-canary.6081d829b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6081d829b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4a35cb39ba9098e173e0e9f01f57c701f63096c4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6081d829b.0.tgz","fileCount":36,"integrity":"sha512-bDey/ktu4JgWE8fC+CH3jy1IBDbxyT7Sha42J25inaFj1H0ZrJBlRIn6HSWHgClynNqb8rVhBbcxgn02wYt/+g==","signatures":[{"sig":"MEUCID7ZoagiGOpyOwPbIafcpMLbaTaa8pclKhEWb2O0W1q2AiEAxcAVIUMjdZBFZ1QZAAQzB3np9Sqi7m73P2eeL73xqT0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"033569cc4deafe32dad2bf8cbd1de8789bc85668","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6081d829b.0","@material/rtl":"15.0.0-canary.6081d829b.0","@material/base":"15.0.0-canary.6081d829b.0","@material/shape":"15.0.0-canary.6081d829b.0","@material/theme":"15.0.0-canary.6081d829b.0","@material/button":"15.0.0-canary.6081d829b.0","@material/tokens":"15.0.0-canary.6081d829b.0","@material/animation":"15.0.0-canary.6081d829b.0","@material/elevation":"15.0.0-canary.6081d829b.0","@material/typography":"15.0.0-canary.6081d829b.0","@material/feature-targeting":"15.0.0-canary.6081d829b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6081d829b.0_1686100521064_0.3082200455335835","host":"s3://npm-registry-packages"}},"15.0.0-canary.b26c34a68.0":{"name":"@material/tooltip","version":"15.0.0-canary.b26c34a68.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b26c34a68.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d9089a24cd14a1753fedb2209bc8cc088beefa24","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b26c34a68.0.tgz","fileCount":36,"integrity":"sha512-AusSMngDza/rUV3k9jJ6CRhTkMs4DPsmP6HUDTeuG7WiN5eb3fmYlCDjXn+ldVAiylXeQhxo8ndgBS/qd/7S+A==","signatures":[{"sig":"MEQCIF2HuAeFeJPm5OvgrzE2/9mfL7b5qdewqLXoOSlPqiBNAiB8hig/gjYzVettuETF9tkcOrCAoG31+Uy2pcykU7TQag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"28919516866e588c52e4e6358c3c4d2523993b74","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b26c34a68.0","@material/rtl":"15.0.0-canary.b26c34a68.0","@material/base":"15.0.0-canary.b26c34a68.0","@material/shape":"15.0.0-canary.b26c34a68.0","@material/theme":"15.0.0-canary.b26c34a68.0","@material/button":"15.0.0-canary.b26c34a68.0","@material/tokens":"15.0.0-canary.b26c34a68.0","@material/animation":"15.0.0-canary.b26c34a68.0","@material/elevation":"15.0.0-canary.b26c34a68.0","@material/typography":"15.0.0-canary.b26c34a68.0","@material/feature-targeting":"15.0.0-canary.b26c34a68.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b26c34a68.0_1686169188381_0.6488831985115309","host":"s3://npm-registry-packages"}},"15.0.0-canary.4fe911371.0":{"name":"@material/tooltip","version":"15.0.0-canary.4fe911371.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4fe911371.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"821e1c1d885e16463909cef5a38a83acc176c671","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4fe911371.0.tgz","fileCount":36,"integrity":"sha512-Arxl1iXqRIxsa5Fb2NpnYHj9qeZYb/mhnbEGWj70ayME32hd4G9MHHPb4pVQWJc2gGyU3urw+O0hPOU8TR2HVg==","signatures":[{"sig":"MEUCIGBfIrg4nreQ8v7MwnZWpYzmSiLD6xfLnXhFuPgA25/AAiEA7tXKLZoV9sbON+2pqf7Ftvq7bKALEQageRmyPB/QIyw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"a9de53a24d5e0f79f94310f061cdf2ab718df7f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.4fe911371.0","@material/rtl":"15.0.0-canary.4fe911371.0","@material/base":"15.0.0-canary.4fe911371.0","@material/shape":"15.0.0-canary.4fe911371.0","@material/theme":"15.0.0-canary.4fe911371.0","@material/button":"15.0.0-canary.4fe911371.0","@material/tokens":"15.0.0-canary.4fe911371.0","@material/animation":"15.0.0-canary.4fe911371.0","@material/elevation":"15.0.0-canary.4fe911371.0","@material/typography":"15.0.0-canary.4fe911371.0","@material/feature-targeting":"15.0.0-canary.4fe911371.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4fe911371.0_1686179243877_0.40282297591722704","host":"s3://npm-registry-packages"}},"15.0.0-canary.a9ff9866f.0":{"name":"@material/tooltip","version":"15.0.0-canary.a9ff9866f.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a9ff9866f.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"524d2db61b6209227d47ce1087ca3a72a4ecefa8","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a9ff9866f.0.tgz","fileCount":36,"integrity":"sha512-AwkZyDyKqf4ssMirwi8Bxy1Lv46273ei/lnH07zk+reSpck7BREB654QN16rMrBkkQi/iMJK0wqKAP8ffl2hmA==","signatures":[{"sig":"MEUCIQD3Hrju0+N4yKSdSK0MOtgxEGDkyAl7mGhT8oVhNNXfgAIgMXmh91CgLsEYA8/BAhsjUbAt/aT/xog4ZSrz/P8yfLU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5bed0ec6cdad0c38b52e8ac98994b2809d9c8f50","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a9ff9866f.0","@material/rtl":"15.0.0-canary.a9ff9866f.0","@material/base":"15.0.0-canary.a9ff9866f.0","@material/shape":"15.0.0-canary.a9ff9866f.0","@material/theme":"15.0.0-canary.a9ff9866f.0","@material/button":"15.0.0-canary.a9ff9866f.0","@material/tokens":"15.0.0-canary.a9ff9866f.0","@material/animation":"15.0.0-canary.a9ff9866f.0","@material/elevation":"15.0.0-canary.a9ff9866f.0","@material/typography":"15.0.0-canary.a9ff9866f.0","@material/feature-targeting":"15.0.0-canary.a9ff9866f.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a9ff9866f.0_1686656372749_0.7699953496657947","host":"s3://npm-registry-packages"}},"15.0.0-canary.b994146f6.0":{"name":"@material/tooltip","version":"15.0.0-canary.b994146f6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b994146f6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1af251aba50669ee7e1c3f5d57961ee0a1138d47","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b994146f6.0.tgz","fileCount":36,"integrity":"sha512-bVzydXGn3fauHJ8pkh32DsdyRJXleeFQ4t7jZ/rcRik+n4G1BvYiblfuu3Z/OCC0m3TJDyMdJhd+sLqRDqLUUg==","signatures":[{"sig":"MEUCIQDbaIO3w5K43BhEI5saO/5MRWvSQvA5dGIZd9FXf7hkOwIgcHHXYX/dTqHyeXcwfl3wB7lNkz7vN1uTYWgLG03wUhQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e537228a5d88e4fb9c651aa15b1d56bd81bc63bd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b994146f6.0","@material/rtl":"15.0.0-canary.b994146f6.0","@material/base":"15.0.0-canary.b994146f6.0","@material/shape":"15.0.0-canary.b994146f6.0","@material/theme":"15.0.0-canary.b994146f6.0","@material/button":"15.0.0-canary.b994146f6.0","@material/tokens":"15.0.0-canary.b994146f6.0","@material/animation":"15.0.0-canary.b994146f6.0","@material/elevation":"15.0.0-canary.b994146f6.0","@material/typography":"15.0.0-canary.b994146f6.0","@material/feature-targeting":"15.0.0-canary.b994146f6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b994146f6.0_1686776708576_0.42944926603422484","host":"s3://npm-registry-packages"}},"15.0.0-canary.1fb4b1a06.0":{"name":"@material/tooltip","version":"15.0.0-canary.1fb4b1a06.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1fb4b1a06.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3bebe0a0ea2f3c1e9d2420a99224de470ce1abe1","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1fb4b1a06.0.tgz","fileCount":36,"integrity":"sha512-UfJB6y8F11arJsA2qFWI6wnqGCBWvZW6SF3V7izEwhg61JfQ2usuHk/qWgnhDaMprggy7srikBXhVxB0JTNcng==","signatures":[{"sig":"MEYCIQCCBCXVfkHHViGk+YBP153qA6PRlTBiArHfm7J9pYBghgIhAKmcJ/j6c/UWqVNsrxc7+J1kZ/nIfMjkTU2+28N3I0xq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1d1b86822f3fc9f22a5fdfc1c381d5a4ae983829","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1fb4b1a06.0","@material/rtl":"15.0.0-canary.1fb4b1a06.0","@material/base":"15.0.0-canary.1fb4b1a06.0","@material/shape":"15.0.0-canary.1fb4b1a06.0","@material/theme":"15.0.0-canary.1fb4b1a06.0","@material/button":"15.0.0-canary.1fb4b1a06.0","@material/tokens":"15.0.0-canary.1fb4b1a06.0","@material/animation":"15.0.0-canary.1fb4b1a06.0","@material/elevation":"15.0.0-canary.1fb4b1a06.0","@material/typography":"15.0.0-canary.1fb4b1a06.0","@material/feature-targeting":"15.0.0-canary.1fb4b1a06.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1fb4b1a06.0_1687892319057_0.08498777147267433","host":"s3://npm-registry-packages"}},"15.0.0-canary.c64a2776e.0":{"name":"@material/tooltip","version":"15.0.0-canary.c64a2776e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c64a2776e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"3ea78587a6beacf047dbeacce012ed1c7b155b32","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c64a2776e.0.tgz","fileCount":36,"integrity":"sha512-YMDCevOfCDGnbmxzYQi2cT1Wj3YQuK3eZC3aL0bgo7UOiXURXKWZ6UMW74p2Kuj5jtzgaD1Tco1smPEY3Ye8ag==","signatures":[{"sig":"MEYCIQDcpf/CDga8q5nMe3UpyMeqV7/NUj0wX16h60YSzU4NfAIhAOLJfYMLLmbRPDsAM8h3JvYYohyi3YcIvJvghBbjucfi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"271b0c446646af573f67960820b6b2a86a9bda88","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.c64a2776e.0","@material/rtl":"15.0.0-canary.c64a2776e.0","@material/base":"15.0.0-canary.c64a2776e.0","@material/shape":"15.0.0-canary.c64a2776e.0","@material/theme":"15.0.0-canary.c64a2776e.0","@material/button":"15.0.0-canary.c64a2776e.0","@material/tokens":"15.0.0-canary.c64a2776e.0","@material/animation":"15.0.0-canary.c64a2776e.0","@material/elevation":"15.0.0-canary.c64a2776e.0","@material/typography":"15.0.0-canary.c64a2776e.0","@material/feature-targeting":"15.0.0-canary.c64a2776e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c64a2776e.0_1687897084593_0.41225607086610094","host":"s3://npm-registry-packages"}},"15.0.0-canary.b05d9eb7c.0":{"name":"@material/tooltip","version":"15.0.0-canary.b05d9eb7c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.b05d9eb7c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e5b142c0ddfe7dc48239a7bacd718bb2f2be6933","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.b05d9eb7c.0.tgz","fileCount":36,"integrity":"sha512-B2QeToJrKxFSQmfIBtDlsfuH2F33mhGOcgSHiy0w6ovBUNZ0WuIzCuOQCPDVZbl5XaUjanXS76J4scMjj1IhMg==","signatures":[{"sig":"MEQCIEKkB1+j+wkqJD6pBVY1pwotqjYk6zKcDMg/GD963FENAiBI+oDmqFcL2evTQKg/v1Z3Ou0tsOF/StidhosjizL3pw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"854245f23fe0f7b3dd1163ecefd940b26718c134","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.b05d9eb7c.0","@material/rtl":"15.0.0-canary.b05d9eb7c.0","@material/base":"15.0.0-canary.b05d9eb7c.0","@material/shape":"15.0.0-canary.b05d9eb7c.0","@material/theme":"15.0.0-canary.b05d9eb7c.0","@material/button":"15.0.0-canary.b05d9eb7c.0","@material/tokens":"15.0.0-canary.b05d9eb7c.0","@material/animation":"15.0.0-canary.b05d9eb7c.0","@material/elevation":"15.0.0-canary.b05d9eb7c.0","@material/typography":"15.0.0-canary.b05d9eb7c.0","@material/feature-targeting":"15.0.0-canary.b05d9eb7c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.b05d9eb7c.0_1688055908224_0.8568943583044257","host":"s3://npm-registry-packages"}},"15.0.0-canary.2a9697dc5.0":{"name":"@material/tooltip","version":"15.0.0-canary.2a9697dc5.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2a9697dc5.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"78a44cc988f6dd8b8ca107534cce0de2750a70d4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2a9697dc5.0.tgz","fileCount":36,"integrity":"sha512-xb/GO//K1TnKCVZRelIqOhDHGaRRVlIhdecTMX6swqs2aoaMtbM/dMpKtJqw89MTr7bz1friMtKYG/iCtSwQHQ==","signatures":[{"sig":"MEYCIQDyhNM1PzYmgYgVZ5NLvMArjICIvjpcRQDCRF23qU4BmwIhAIhUG3zXhLxsNCHG0itBFiMx0sOKwJZn5TOnicjpze/f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"fad1e5223c83a5b7a83a6ef81f7ebdc83a85672a","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.2a9697dc5.0","@material/rtl":"15.0.0-canary.2a9697dc5.0","@material/base":"15.0.0-canary.2a9697dc5.0","@material/shape":"15.0.0-canary.2a9697dc5.0","@material/theme":"15.0.0-canary.2a9697dc5.0","@material/button":"15.0.0-canary.2a9697dc5.0","@material/tokens":"15.0.0-canary.2a9697dc5.0","@material/animation":"15.0.0-canary.2a9697dc5.0","@material/elevation":"15.0.0-canary.2a9697dc5.0","@material/typography":"15.0.0-canary.2a9697dc5.0","@material/feature-targeting":"15.0.0-canary.2a9697dc5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2a9697dc5.0_1688163312431_0.2798045682792547","host":"s3://npm-registry-packages"}},"15.0.0-canary.0c52adeab.0":{"name":"@material/tooltip","version":"15.0.0-canary.0c52adeab.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0c52adeab.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"74a23389621903cc31296b78f7029815126b3d67","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0c52adeab.0.tgz","fileCount":36,"integrity":"sha512-2xPPGowHgE2l4nkrPdgcSnTcQ5OwHBf+nJvJGeiJX8ch0A9uOFYrHxT95L0px3O22EkEINWb+lec4aXusafhRg==","signatures":[{"sig":"MEYCIQCMXumjO43ARtU2W6A27ozt3uhMKw/saSs/tXpfKghz4gIhAOstepoIi20y32e7t+YfwPiKEAHUxv/5TOA2N2f+mvCF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"972024dd57885ff944ec073de0cd956353bfa7e3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.0c52adeab.0","@material/rtl":"15.0.0-canary.0c52adeab.0","@material/base":"15.0.0-canary.0c52adeab.0","@material/shape":"15.0.0-canary.0c52adeab.0","@material/theme":"15.0.0-canary.0c52adeab.0","@material/button":"15.0.0-canary.0c52adeab.0","@material/tokens":"15.0.0-canary.0c52adeab.0","@material/animation":"15.0.0-canary.0c52adeab.0","@material/elevation":"15.0.0-canary.0c52adeab.0","@material/typography":"15.0.0-canary.0c52adeab.0","@material/feature-targeting":"15.0.0-canary.0c52adeab.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0c52adeab.0_1688574434932_0.22990164556839177","host":"s3://npm-registry-packages"}},"15.0.0-canary.83355c322.0":{"name":"@material/tooltip","version":"15.0.0-canary.83355c322.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.83355c322.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b79096b055247d1b6ec43a4a0572dd2a6b7cdc63","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.83355c322.0.tgz","fileCount":36,"integrity":"sha512-o9CNX7p+g/yrJF15hFrNkmiHQ/p7d9D/uWMV+6Uj2jd8wd1FMERWzqxb07V9nktRVURt75yDJI2iDnmAbEPSZg==","signatures":[{"sig":"MEYCIQCG6kfTREG3yP2YVAQqfCY8uMjsondoF1LA6u/pUdZgeAIhAKVIPMG1wmFUIfxDtPUU0E+9pAMhKwG0KvyG97ynTbNv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"173401c2dd65fb3babae5b8e998c0a0032ff819d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.83355c322.0","@material/rtl":"15.0.0-canary.83355c322.0","@material/base":"15.0.0-canary.83355c322.0","@material/shape":"15.0.0-canary.83355c322.0","@material/theme":"15.0.0-canary.83355c322.0","@material/button":"15.0.0-canary.83355c322.0","@material/tokens":"15.0.0-canary.83355c322.0","@material/animation":"15.0.0-canary.83355c322.0","@material/elevation":"15.0.0-canary.83355c322.0","@material/typography":"15.0.0-canary.83355c322.0","@material/feature-targeting":"15.0.0-canary.83355c322.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.83355c322.0_1689001623913_0.8410341878657996","host":"s3://npm-registry-packages"}},"15.0.0-canary.bc9ae6c9c.0":{"name":"@material/tooltip","version":"15.0.0-canary.bc9ae6c9c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.bc9ae6c9c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"e5703754d44d0daf9fccbaa66fc4dd3aa22b2a5b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.bc9ae6c9c.0.tgz","fileCount":36,"integrity":"sha512-UzuXp0b9NuWuYLYpPguxrjbJnCmT/Cco8CkjI/6JajxaeA3o2XEBbQfRMTq8PTafuBjCHTc0b0mQY7rtxUp1Gg==","signatures":[{"sig":"MEQCIH6nSVcE7nFhPdjqkL1iE1qbfafT0uHS8PZcshRmhD4xAiAxSZMdxcvQPAyUeZEruvRLd3J6itMkAUoslRMpVbxhNA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"9f0b9b80c267d99daa258e635481fecc4cbf0acd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.bc9ae6c9c.0","@material/rtl":"15.0.0-canary.bc9ae6c9c.0","@material/base":"15.0.0-canary.bc9ae6c9c.0","@material/shape":"15.0.0-canary.bc9ae6c9c.0","@material/theme":"15.0.0-canary.bc9ae6c9c.0","@material/button":"15.0.0-canary.bc9ae6c9c.0","@material/tokens":"15.0.0-canary.bc9ae6c9c.0","@material/animation":"15.0.0-canary.bc9ae6c9c.0","@material/elevation":"15.0.0-canary.bc9ae6c9c.0","@material/typography":"15.0.0-canary.bc9ae6c9c.0","@material/feature-targeting":"15.0.0-canary.bc9ae6c9c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.bc9ae6c9c.0_1691097773742_0.23007920736748377","host":"s3://npm-registry-packages"}},"15.0.0-canary.3c44cd956.0":{"name":"@material/tooltip","version":"15.0.0-canary.3c44cd956.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.3c44cd956.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6befbd0c6052276c4c7c6a7ef3efa3b29e517352","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.3c44cd956.0.tgz","fileCount":36,"integrity":"sha512-OgeQmISNq5X9PWum3uLE/6p32o2CRTeABhzIRBbI79vDtF2OzSI8Wvtf8Vc3gFbSzDHaT89BCx5oILVO4njHZQ==","signatures":[{"sig":"MEUCIQCvXhwWm1knfz7wH25p26Nn3GzahgT/GXd9FdWNix2YOAIgWan61ZALql/0pmfQ7vQTvIbAaAWmfePRmmd9IO9mpW8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6e39da189328fcabc7040a629e312efe5f7cea80","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.3c44cd956.0","@material/rtl":"15.0.0-canary.3c44cd956.0","@material/base":"15.0.0-canary.3c44cd956.0","@material/shape":"15.0.0-canary.3c44cd956.0","@material/theme":"15.0.0-canary.3c44cd956.0","@material/button":"15.0.0-canary.3c44cd956.0","@material/tokens":"15.0.0-canary.3c44cd956.0","@material/animation":"15.0.0-canary.3c44cd956.0","@material/elevation":"15.0.0-canary.3c44cd956.0","@material/typography":"15.0.0-canary.3c44cd956.0","@material/feature-targeting":"15.0.0-canary.3c44cd956.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.3c44cd956.0_1691430582361_0.0012571996201857782","host":"s3://npm-registry-packages"}},"15.0.0-canary.02702296e.0":{"name":"@material/tooltip","version":"15.0.0-canary.02702296e.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.02702296e.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"47f38a39626ce937b196dfa7f09da8ddcec165d5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.02702296e.0.tgz","fileCount":36,"integrity":"sha512-4mA9yA5JukuU3egu5Y5TiFMsoTezKp/EWlwcjA2OGqdMmNTUukSJbdknnU63T3k3fyKTZKBV8QA8mp4YurYhBA==","signatures":[{"sig":"MEUCIQD1s3uVHj3uK8KiqkOYs2rxPKxpr71D3BQaDvE6aRFkpAIgYHPQt5ZbhikuRjAmv+uCU+c1bTuXcv+O0LZXrB/+WI0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"22335673bc742932498b2538321ed9dcfd692879","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.02702296e.0","@material/rtl":"15.0.0-canary.02702296e.0","@material/base":"15.0.0-canary.02702296e.0","@material/shape":"15.0.0-canary.02702296e.0","@material/theme":"15.0.0-canary.02702296e.0","@material/button":"15.0.0-canary.02702296e.0","@material/tokens":"15.0.0-canary.02702296e.0","@material/animation":"15.0.0-canary.02702296e.0","@material/elevation":"15.0.0-canary.02702296e.0","@material/typography":"15.0.0-canary.02702296e.0","@material/feature-targeting":"15.0.0-canary.02702296e.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.02702296e.0_1692965190292_0.39760199893154047","host":"s3://npm-registry-packages"}},"15.0.0-canary.872b65832.0":{"name":"@material/tooltip","version":"15.0.0-canary.872b65832.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.872b65832.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1869e3cf29ff72e83cedea0c3e627ae09c57b031","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.872b65832.0.tgz","fileCount":36,"integrity":"sha512-4BGTDasbvkErTtYr7o9tHYUMJVGu7fa5kHegUmq5lwSXVF2/EKK1jAQ9oXxwQlGr4B09UI/ZoLx0FfJF+9xVLQ==","signatures":[{"sig":"MEUCIEuNFVMN5K078hKpg+8W3se9DBraDXwlA/5XL78ia+UtAiEAoik6/dljqL79VKSneHtoqZ6f4itQS+VSqpr+j/fHzP0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"be0901c091f812355b2d192c49bd051d8daf7a98","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.872b65832.0","@material/rtl":"15.0.0-canary.872b65832.0","@material/base":"15.0.0-canary.872b65832.0","@material/shape":"15.0.0-canary.872b65832.0","@material/theme":"15.0.0-canary.872b65832.0","@material/button":"15.0.0-canary.872b65832.0","@material/tokens":"15.0.0-canary.872b65832.0","@material/animation":"15.0.0-canary.872b65832.0","@material/elevation":"15.0.0-canary.872b65832.0","@material/typography":"15.0.0-canary.872b65832.0","@material/feature-targeting":"15.0.0-canary.872b65832.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.872b65832.0_1693397703055_0.1027473787112465","host":"s3://npm-registry-packages"}},"15.0.0-canary.89b2e4122.0":{"name":"@material/tooltip","version":"15.0.0-canary.89b2e4122.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.89b2e4122.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d7dc8576da4d9ea2764385d0f8fc47c9527c69a2","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.89b2e4122.0.tgz","fileCount":36,"integrity":"sha512-sEUzOtjJHPb29Qt2MY+x4laf9yJLXrrYJkXI9aU9ZBGu4Xlqas9NyF8UAGLzlgnS1/3YCYAp6qs9ah8TC6L+LA==","signatures":[{"sig":"MEUCIA/82ZKjjHXo0HVnkqaaOTS4pMIzZEVwfrspNFKwK/wnAiEAn2tCLDpZy7RuOgvPiOjm9FA6/0HzL7gImYxd/0IGhU8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"68bd55db9489546e515443239f477836e16db19b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.89b2e4122.0","@material/rtl":"15.0.0-canary.89b2e4122.0","@material/base":"15.0.0-canary.89b2e4122.0","@material/shape":"15.0.0-canary.89b2e4122.0","@material/theme":"15.0.0-canary.89b2e4122.0","@material/button":"15.0.0-canary.89b2e4122.0","@material/tokens":"15.0.0-canary.89b2e4122.0","@material/animation":"15.0.0-canary.89b2e4122.0","@material/elevation":"15.0.0-canary.89b2e4122.0","@material/typography":"15.0.0-canary.89b2e4122.0","@material/feature-targeting":"15.0.0-canary.89b2e4122.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.89b2e4122.0_1693498096910_0.8930328804209859","host":"s3://npm-registry-packages"}},"15.0.0-canary.7a3942e7a.0":{"name":"@material/tooltip","version":"15.0.0-canary.7a3942e7a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7a3942e7a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d86a19453a036309899d2530d5f357e1b4117b52","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7a3942e7a.0.tgz","fileCount":36,"integrity":"sha512-DAANwgfkhOiM8qsFArYPyj0Qu+2Beh2JD45wvRMyGrQIo9Y3b1VloFJl9XUaPnYzcze4mNzeyMEEfDRhF0BSGw==","signatures":[{"sig":"MEUCIQDl9nzIcPJDODOtneGQXldYu5rQdAQ7q5oUejU8lgb1gwIgZ49tKmrXlWA9HDM9vz2umD6nudjFFiIV/tC1xnIL+74=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e61dc0a16a5b376c778548e5a6cecb56f5c5704d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7a3942e7a.0","@material/rtl":"15.0.0-canary.7a3942e7a.0","@material/base":"15.0.0-canary.7a3942e7a.0","@material/shape":"15.0.0-canary.7a3942e7a.0","@material/theme":"15.0.0-canary.7a3942e7a.0","@material/button":"15.0.0-canary.7a3942e7a.0","@material/tokens":"15.0.0-canary.7a3942e7a.0","@material/animation":"15.0.0-canary.7a3942e7a.0","@material/elevation":"15.0.0-canary.7a3942e7a.0","@material/typography":"15.0.0-canary.7a3942e7a.0","@material/feature-targeting":"15.0.0-canary.7a3942e7a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7a3942e7a.0_1693507267283_0.1598456933808865","host":"s3://npm-registry-packages"}},"15.0.0-canary.54feb3020.0":{"name":"@material/tooltip","version":"15.0.0-canary.54feb3020.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.54feb3020.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"86dc6786d20d4c35096be317f3d6deef38abf807","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.54feb3020.0.tgz","fileCount":36,"integrity":"sha512-pljInKkGH9wovbiK72Zaj5saOUCWHoWcumkXPM3JgRnc/BoajPH+n2hfL23XiGB2CnLIYwgfwNE8hSCTm57QYQ==","signatures":[{"sig":"MEQCIEGOI9OlLZIBOxRUOii4DvzzRbgPvXu+ZcaMX0L5YcPAAiAXNyC/8gNLG05WBlgH0Oz2/y3/XVrnJuLZZANsAM+5Bw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"5dc5cb94463af21f898ddd58cc4d9e4fbf803222","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.54feb3020.0","@material/rtl":"15.0.0-canary.54feb3020.0","@material/base":"15.0.0-canary.54feb3020.0","@material/shape":"15.0.0-canary.54feb3020.0","@material/theme":"15.0.0-canary.54feb3020.0","@material/button":"15.0.0-canary.54feb3020.0","@material/tokens":"15.0.0-canary.54feb3020.0","@material/animation":"15.0.0-canary.54feb3020.0","@material/elevation":"15.0.0-canary.54feb3020.0","@material/typography":"15.0.0-canary.54feb3020.0","@material/feature-targeting":"15.0.0-canary.54feb3020.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.54feb3020.0_1694466405328_0.6408693933288996","host":"s3://npm-registry-packages"}},"15.0.0-canary.6cda3ce8d.0":{"name":"@material/tooltip","version":"15.0.0-canary.6cda3ce8d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.6cda3ce8d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"00ba30e45d2ec6e90363d4b1bc1d5cf7e5dc514c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.6cda3ce8d.0.tgz","fileCount":36,"integrity":"sha512-ARz1/HrnXIyZP7g4ho7k6d7m8ts9njVse+w0GhszRUaMeLSxuFzPn7g6HxCX0qF2gs1zZX+5PKr7M4K5I+ApsA==","signatures":[{"sig":"MEUCIHjwtxo/56eRYr3kXHmVe+BcSVP9A132h5akq0FbtZb4AiEAzouCrySpMZuV4YJFuWr9GzU0KJkS/7KBIkmz2nITtRg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"adb36c6339e7bf37fe1e8ca96526a9673ca602e7","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.6cda3ce8d.0","@material/rtl":"15.0.0-canary.6cda3ce8d.0","@material/base":"15.0.0-canary.6cda3ce8d.0","@material/shape":"15.0.0-canary.6cda3ce8d.0","@material/theme":"15.0.0-canary.6cda3ce8d.0","@material/button":"15.0.0-canary.6cda3ce8d.0","@material/tokens":"15.0.0-canary.6cda3ce8d.0","@material/animation":"15.0.0-canary.6cda3ce8d.0","@material/elevation":"15.0.0-canary.6cda3ce8d.0","@material/typography":"15.0.0-canary.6cda3ce8d.0","@material/feature-targeting":"15.0.0-canary.6cda3ce8d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.6cda3ce8d.0_1694483200551_0.17100572976107364","host":"s3://npm-registry-packages"}},"15.0.0-canary.205b20b36.0":{"name":"@material/tooltip","version":"15.0.0-canary.205b20b36.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.205b20b36.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f7b2d445bcefd4eb4eb25c5e731182aeee77956d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.205b20b36.0.tgz","fileCount":36,"integrity":"sha512-LzsnZYmRt6GRlOUeH+/4IQD1LLPU52D1p3oa8aTkTBOXoW4OBlUbXQa+XFQ0DfZ6yf8J+vZtQcjsxxuK9FWTIw==","signatures":[{"sig":"MEUCIQCohPwJWuOrGoKdEp8LpK0Ogefpd+DgMFwWuzLDNJhIjAIgaz2eWfzcqo1jW/tNC0zgMoVNJvAb8FXqfYrtqZLCHt8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"00fdcf619c34c502844acb0f2485e99595aa138d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.205b20b36.0","@material/rtl":"15.0.0-canary.205b20b36.0","@material/base":"15.0.0-canary.205b20b36.0","@material/shape":"15.0.0-canary.205b20b36.0","@material/theme":"15.0.0-canary.205b20b36.0","@material/button":"15.0.0-canary.205b20b36.0","@material/tokens":"15.0.0-canary.205b20b36.0","@material/animation":"15.0.0-canary.205b20b36.0","@material/elevation":"15.0.0-canary.205b20b36.0","@material/typography":"15.0.0-canary.205b20b36.0","@material/feature-targeting":"15.0.0-canary.205b20b36.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.205b20b36.0_1694625615995_0.8059809441286965","host":"s3://npm-registry-packages"}},"15.0.0-canary.22bf82024.0":{"name":"@material/tooltip","version":"15.0.0-canary.22bf82024.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.22bf82024.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2ef09ef418bcbc4e3b306f26bb3d8745a0a09b62","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.22bf82024.0.tgz","fileCount":36,"integrity":"sha512-VKlN6fCp3kUMn4p7VtUZf/l4PiNikpKd88Yf89Y7qgvf7fndSIfY0UW3j8Ion18s2h6mYAS/NcYdWTLBEHeang==","signatures":[{"sig":"MEYCIQCn00z/gnmQ7SYdkKaEUiTXn2hxtI2cqNY+jRZbAuIHcgIhAM7c8uSluE/woPaS+M/jFx/u00h0vr2T9iZ0oJDkAxLD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1198709},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"eda4fad2a8a727b69db60b828bd92df7a8956143","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.22bf82024.0","@material/rtl":"15.0.0-canary.22bf82024.0","@material/base":"15.0.0-canary.22bf82024.0","@material/shape":"15.0.0-canary.22bf82024.0","@material/theme":"15.0.0-canary.22bf82024.0","@material/button":"15.0.0-canary.22bf82024.0","@material/tokens":"15.0.0-canary.22bf82024.0","@material/animation":"15.0.0-canary.22bf82024.0","@material/elevation":"15.0.0-canary.22bf82024.0","@material/typography":"15.0.0-canary.22bf82024.0","@material/feature-targeting":"15.0.0-canary.22bf82024.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.22bf82024.0_1695028396909_0.09680483121226757","host":"s3://npm-registry-packages"}},"15.0.0-canary.a246a4439.0":{"name":"@material/tooltip","version":"15.0.0-canary.a246a4439.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a246a4439.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"96d0818b141f4aa4b58f499ab37c02d29a2b5b6b","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a246a4439.0.tgz","fileCount":36,"integrity":"sha512-Ja2Z4aZQkYWD6InXA+MG4M9zdKR6dYsXXlYzQppYpfcQzXylZqh5Y7WBLulG5fA2o83pHVwILfwFZM7j7ht08Q==","signatures":[{"sig":"MEUCIBDb1jOKE+c7wt5xla9LBiYoTsb/lEHmV+kIWbgMFcaoAiEArOB3s3l/E4VQCK7Kovf7kTFzcHGM8amQiImwjxaHmxQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199104},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"40201df8b7e53b61aead4acdfa34b48fb1d155b8","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a246a4439.0","@material/rtl":"15.0.0-canary.a246a4439.0","@material/base":"15.0.0-canary.a246a4439.0","@material/shape":"15.0.0-canary.a246a4439.0","@material/theme":"15.0.0-canary.a246a4439.0","@material/button":"15.0.0-canary.a246a4439.0","@material/tokens":"15.0.0-canary.a246a4439.0","@material/animation":"15.0.0-canary.a246a4439.0","@material/elevation":"15.0.0-canary.a246a4439.0","@material/typography":"15.0.0-canary.a246a4439.0","@material/feature-targeting":"15.0.0-canary.a246a4439.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a246a4439.0_1695059254597_0.6667508794978527","host":"s3://npm-registry-packages"}},"15.0.0-canary.d153db62b.0":{"name":"@material/tooltip","version":"15.0.0-canary.d153db62b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d153db62b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"5b978214354070200abd8f27df6d69c6cfb83516","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d153db62b.0.tgz","fileCount":36,"integrity":"sha512-0QeQONCiOYXhtozvw3O/lfqdG2Z+YyFqDLxnaNJsHohDZ7zIBoV4+zyFBITRftvZ04SHO1c+y7DSd4VB1xvGxA==","signatures":[{"sig":"MEUCIBmOljK9fAAMWc0Lix2fwleNVU6LCnjnFS+erhN2LwAiAiEAwb2GKMxXkpjUceY8RQAQq93KlbsWnQ+c1koW0lbetrk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199104},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4ca05c144c691cd06cd5926fe0bc54818e462202","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d153db62b.0","@material/rtl":"15.0.0-canary.d153db62b.0","@material/base":"15.0.0-canary.d153db62b.0","@material/shape":"15.0.0-canary.d153db62b.0","@material/theme":"15.0.0-canary.d153db62b.0","@material/button":"15.0.0-canary.d153db62b.0","@material/tokens":"15.0.0-canary.d153db62b.0","@material/animation":"15.0.0-canary.d153db62b.0","@material/elevation":"15.0.0-canary.d153db62b.0","@material/typography":"15.0.0-canary.d153db62b.0","@material/feature-targeting":"15.0.0-canary.d153db62b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d153db62b.0_1695150990351_0.4567308483607537","host":"s3://npm-registry-packages"}},"15.0.0-canary.2528c1c3b.0":{"name":"@material/tooltip","version":"15.0.0-canary.2528c1c3b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2528c1c3b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"36880f957c59df5f58d3ad6b3f7385aa24ae7ddc","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2528c1c3b.0.tgz","fileCount":36,"integrity":"sha512-tYf32iKm0a06aCHu7CiyLClo5v0IJxN0aNWRBhaEEcmcjU9oktzE8dMnH0RANSmNyFiclXtml/c+wkXq30hf5A==","signatures":[{"sig":"MEQCIGRmmoflIed4Lfwri2G9CTeZNaNRQAvLkj5EIqoUJPzSAiAIkgJMVh73aj0O1LDDDAlFnk/s9kG7QBkVfEc16MqLZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199104},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"98b5b57bd5356f48610a254e8c4acff388d5fb7b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.2528c1c3b.0","@material/rtl":"15.0.0-canary.2528c1c3b.0","@material/base":"15.0.0-canary.2528c1c3b.0","@material/shape":"15.0.0-canary.2528c1c3b.0","@material/theme":"15.0.0-canary.2528c1c3b.0","@material/button":"15.0.0-canary.2528c1c3b.0","@material/tokens":"15.0.0-canary.2528c1c3b.0","@material/animation":"15.0.0-canary.2528c1c3b.0","@material/elevation":"15.0.0-canary.2528c1c3b.0","@material/typography":"15.0.0-canary.2528c1c3b.0","@material/feature-targeting":"15.0.0-canary.2528c1c3b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2528c1c3b.0_1695233289013_0.8783868078768318","host":"s3://npm-registry-packages"}},"15.0.0-canary.1728a6dcf.0":{"name":"@material/tooltip","version":"15.0.0-canary.1728a6dcf.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.1728a6dcf.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f737fa1971439665bf53cb7b6e45f1914da651e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.1728a6dcf.0.tgz","fileCount":36,"integrity":"sha512-clE254LU3MGMn6UJJRRpGr3nnXtxa9Bs//ZX9aDTecZv0kx/FSuPvBzJSebYV3FKGxROpohaKMGy3DNrUxhv2w==","signatures":[{"sig":"MEUCIAGWZSioN+/0j1YaLb0ne9EORAZ/tDKCF8A1AiwBXTM2AiEA5hqaw0LCfh3N9eWK9QWCBWw9LW7LCb9SiaKd7drmUoE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199104},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"3828aedf4f344a948780a69956ca4f069cef3daa","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.1728a6dcf.0","@material/rtl":"15.0.0-canary.1728a6dcf.0","@material/base":"15.0.0-canary.1728a6dcf.0","@material/shape":"15.0.0-canary.1728a6dcf.0","@material/theme":"15.0.0-canary.1728a6dcf.0","@material/button":"15.0.0-canary.1728a6dcf.0","@material/tokens":"15.0.0-canary.1728a6dcf.0","@material/animation":"15.0.0-canary.1728a6dcf.0","@material/elevation":"15.0.0-canary.1728a6dcf.0","@material/typography":"15.0.0-canary.1728a6dcf.0","@material/feature-targeting":"15.0.0-canary.1728a6dcf.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.1728a6dcf.0_1695691471092_0.13024460352639045","host":"s3://npm-registry-packages"}},"15.0.0-canary.ebb636f3d.0":{"name":"@material/tooltip","version":"15.0.0-canary.ebb636f3d.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.ebb636f3d.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a7af82951fa7d6ece9f5ed08613cfac52032aae5","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.ebb636f3d.0.tgz","fileCount":36,"integrity":"sha512-5bBiFk6hxGsJbBKTrliCP+3FC28/9QWonIHfRfPvGqhhcCJE54fjfEwpgIndiyyQ/j3SU+H6KGvCK7Lgjsvh9Q==","signatures":[{"sig":"MEUCIHboDHh+LYJHnoSuthpZ+9cDr/VzoMnCTiEdT4T9x1ByAiEA8hLb3pI2majhOZ8473Py4ABT+s9st02X/rZd8vybOwo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199104},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"6f62607a00dd885ebbe422b247dc4acc1ded22cb","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.ebb636f3d.0","@material/rtl":"15.0.0-canary.ebb636f3d.0","@material/base":"15.0.0-canary.ebb636f3d.0","@material/shape":"15.0.0-canary.ebb636f3d.0","@material/theme":"15.0.0-canary.ebb636f3d.0","@material/button":"15.0.0-canary.ebb636f3d.0","@material/tokens":"15.0.0-canary.ebb636f3d.0","@material/animation":"15.0.0-canary.ebb636f3d.0","@material/elevation":"15.0.0-canary.ebb636f3d.0","@material/typography":"15.0.0-canary.ebb636f3d.0","@material/feature-targeting":"15.0.0-canary.ebb636f3d.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.ebb636f3d.0_1696016738987_0.7961276995271607","host":"s3://npm-registry-packages"}},"15.0.0-canary.c0d21ecc9.0":{"name":"@material/tooltip","version":"15.0.0-canary.c0d21ecc9.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c0d21ecc9.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"989c6bca3c3ddd73d7212bae9c75dccb58aef56e","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c0d21ecc9.0.tgz","fileCount":36,"integrity":"sha512-YDBDsXEZPONC6LBEYVyYlq1XT1XQyRX9J1pXu9zt7kJTt7nx+mpmuqpgpObQqo8A2RMh9sfiskaV3q7ndlqYzA==","signatures":[{"sig":"MEYCIQC3Rm8jR5RBA6qJRO0T5MIG0wKAJuRNrL0gcN32ZH7PuAIhAKvyELUmUEw9QKSqGWsokLKiKwUVYWWOYexi+C3CLVYe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199104},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0a932ea790a12d359ce4ec7c5c4c7aec7edf565d","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.c0d21ecc9.0","@material/rtl":"15.0.0-canary.c0d21ecc9.0","@material/base":"15.0.0-canary.c0d21ecc9.0","@material/shape":"15.0.0-canary.c0d21ecc9.0","@material/theme":"15.0.0-canary.c0d21ecc9.0","@material/button":"15.0.0-canary.c0d21ecc9.0","@material/tokens":"15.0.0-canary.c0d21ecc9.0","@material/animation":"15.0.0-canary.c0d21ecc9.0","@material/elevation":"15.0.0-canary.c0d21ecc9.0","@material/typography":"15.0.0-canary.c0d21ecc9.0","@material/feature-targeting":"15.0.0-canary.c0d21ecc9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c0d21ecc9.0_1696880284344_0.05981513763077473","host":"s3://npm-registry-packages"}},"15.0.0-canary.127a44b28.0":{"name":"@material/tooltip","version":"15.0.0-canary.127a44b28.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.127a44b28.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"54e6a7f9ffe47aaf31abd12e0d2e34a6fff0fbf4","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.127a44b28.0.tgz","fileCount":36,"integrity":"sha512-/TqYyxLUiXFdyBdG5u9wyvrfZ0wamjq60Uo/+t9ecMSVCdwmUBuMEXcZ0zh2pLrjjlx6yWpGkW/dUOcuCt2NvQ==","signatures":[{"sig":"MEYCIQCpyazohj22SdtfdIjUv+POzF1IEdApOvUkohtI01QFngIhAOTtKnRBl6KJld1rvauhLOs9wpYhGsfu94rqAACjtee6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1199104},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"88d1fc2c5354e751ea3ab567d26bb1886ee152d3","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.127a44b28.0","@material/rtl":"15.0.0-canary.127a44b28.0","@material/base":"15.0.0-canary.127a44b28.0","@material/shape":"15.0.0-canary.127a44b28.0","@material/theme":"15.0.0-canary.127a44b28.0","@material/button":"15.0.0-canary.127a44b28.0","@material/tokens":"15.0.0-canary.127a44b28.0","@material/animation":"15.0.0-canary.127a44b28.0","@material/elevation":"15.0.0-canary.127a44b28.0","@material/typography":"15.0.0-canary.127a44b28.0","@material/feature-targeting":"15.0.0-canary.127a44b28.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.127a44b28.0_1697140915366_0.6384164344770733","host":"s3://npm-registry-packages"}},"15.0.0-canary.0ad128337.0":{"name":"@material/tooltip","version":"15.0.0-canary.0ad128337.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.0ad128337.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"4ec0f9640f3ab0c048582b6bbed3fc1331d9bf13","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.0ad128337.0.tgz","fileCount":36,"integrity":"sha512-9VyyyWjZHEOi8CQ8N7ztEcysCXS8ROvgtOgwRwfz6XWMUrxns3FTdznghRlU4/z4EE7qny8OKMaL19O7eT+W1A==","signatures":[{"sig":"MEQCICrSmdR35Q0uJngfhTyNReFwSx+ylqyGN0sq9Jf3O2nGAiBeFJAlIMe9Ex1LNBr/LDQlihZfbu2rOmh0slI+9Ud8qg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"bb76f531b61a52aae34c7a1efa45824fd32e49f4","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.0ad128337.0","@material/rtl":"15.0.0-canary.0ad128337.0","@material/base":"15.0.0-canary.0ad128337.0","@material/shape":"15.0.0-canary.0ad128337.0","@material/theme":"15.0.0-canary.0ad128337.0","@material/button":"15.0.0-canary.0ad128337.0","@material/tokens":"15.0.0-canary.0ad128337.0","@material/animation":"15.0.0-canary.0ad128337.0","@material/elevation":"15.0.0-canary.0ad128337.0","@material/typography":"15.0.0-canary.0ad128337.0","@material/feature-targeting":"15.0.0-canary.0ad128337.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.0ad128337.0_1697741612784_0.18291330702848607","host":"s3://npm-registry-packages"}},"15.0.0-canary.9cec94097.0":{"name":"@material/tooltip","version":"15.0.0-canary.9cec94097.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.9cec94097.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"82c655bb7760b18794af54f4e21fa6e74b2a3d16","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.9cec94097.0.tgz","fileCount":36,"integrity":"sha512-/BAEP5WMZoD1ixQbInDMLgPYnjomxoaTA5qmKCyIudFEGhl3dPigZvCCdLGlN/3k599UgMQf79B9NzsPHtWl5Q==","signatures":[{"sig":"MEYCIQCjmjSRZvceDaLdUDEHIa3o7+TQ4MkBi6BpjvYyNP6UdQIhAL7xEaLNq4ei/RMjxb9gNqgc62DfZpqULaE2WIxEXMho","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1a8019402daf97efb72456551503dfb3fa31466b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.9cec94097.0","@material/rtl":"15.0.0-canary.9cec94097.0","@material/base":"15.0.0-canary.9cec94097.0","@material/shape":"15.0.0-canary.9cec94097.0","@material/theme":"15.0.0-canary.9cec94097.0","@material/button":"15.0.0-canary.9cec94097.0","@material/tokens":"15.0.0-canary.9cec94097.0","@material/animation":"15.0.0-canary.9cec94097.0","@material/elevation":"15.0.0-canary.9cec94097.0","@material/typography":"15.0.0-canary.9cec94097.0","@material/feature-targeting":"15.0.0-canary.9cec94097.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.9cec94097.0_1697757042919_0.08767727369337752","host":"s3://npm-registry-packages"}},"15.0.0-canary.c51a0bbcc.0":{"name":"@material/tooltip","version":"15.0.0-canary.c51a0bbcc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c51a0bbcc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b83139430f5f9f8034d4f8f2713bc7fe9de7079d","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c51a0bbcc.0.tgz","fileCount":36,"integrity":"sha512-Nif9hw1/C2ph3bCynvxX28nT+A5AfcqCErZ17/s9IAcztVGSmTC0bMlvGbX8NPUBE8zXntTKEwM8Ca2SIiDXpQ==","signatures":[{"sig":"MEUCIGUOUaGGamjl7arTudWy0Jz350T4DcIY9vLS/5m6CbsvAiEAm9MbFLpKsat8JfYy16tnStjEGWewM/kDTJrARbsZXSE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e65c7fe6dcc6d6069f00d4d2f8c55e61710d046b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.c51a0bbcc.0","@material/rtl":"15.0.0-canary.c51a0bbcc.0","@material/base":"15.0.0-canary.c51a0bbcc.0","@material/shape":"15.0.0-canary.c51a0bbcc.0","@material/theme":"15.0.0-canary.c51a0bbcc.0","@material/button":"15.0.0-canary.c51a0bbcc.0","@material/tokens":"15.0.0-canary.c51a0bbcc.0","@material/animation":"15.0.0-canary.c51a0bbcc.0","@material/elevation":"15.0.0-canary.c51a0bbcc.0","@material/typography":"15.0.0-canary.c51a0bbcc.0","@material/feature-targeting":"15.0.0-canary.c51a0bbcc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c51a0bbcc.0_1700081952798_0.7313844109678616","host":"s3://npm-registry-packages"}},"15.0.0-canary.d76666ad4.0":{"name":"@material/tooltip","version":"15.0.0-canary.d76666ad4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.d76666ad4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"eaea721c49e2506fb811953db50f1621c4343109","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.d76666ad4.0.tgz","fileCount":36,"integrity":"sha512-0GI+zw5xWoWnxyu7Qd5WdduJGwi0JCQBJczqOg5PB/+Vwe0pgqVPiDK1wzCMbqiRQSr9j6BTwHlramte1X0Kcg==","signatures":[{"sig":"MEUCIDQAjENWWqo/VgTl9JXEQxHObnT1TAkPBhvLVW9B3ClrAiEA/q1hv5jjmJ++O0qpojRKkYpsoWPH3GLnMhCwA057TDY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"8fc3640e389fda0098b42091a9a1ab8653fc6470","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.d76666ad4.0","@material/rtl":"15.0.0-canary.d76666ad4.0","@material/base":"15.0.0-canary.d76666ad4.0","@material/shape":"15.0.0-canary.d76666ad4.0","@material/theme":"15.0.0-canary.d76666ad4.0","@material/button":"15.0.0-canary.d76666ad4.0","@material/tokens":"15.0.0-canary.d76666ad4.0","@material/animation":"15.0.0-canary.d76666ad4.0","@material/elevation":"15.0.0-canary.d76666ad4.0","@material/typography":"15.0.0-canary.d76666ad4.0","@material/feature-targeting":"15.0.0-canary.d76666ad4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.d76666ad4.0_1701123217941_0.6663724226358771","host":"s3://npm-registry-packages"}},"15.0.0-canary.8656bf0e0.0":{"name":"@material/tooltip","version":"15.0.0-canary.8656bf0e0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.8656bf0e0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a6a81e0e02efd064a3b5e325b460c39447fcbf19","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.8656bf0e0.0.tgz","fileCount":36,"integrity":"sha512-YoIr3fhl9TsIE9M286W69quYIUqj1I2S5RuhdL25+ZmcfI26FrTG8t08pD+s2PqyLaltZIO0MfitlWWcu45fGA==","signatures":[{"sig":"MEQCIAsqg56tmJEfAEEGF1e9AjZECXxE4hY71daWI3np2hw8AiBzzP6FU4U8HoC/qm6ICOL943EXnzs7Oky7XMx/AhkMuw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"36cab37e468233da3044a10c1df388f634163cc1","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.8656bf0e0.0","@material/rtl":"15.0.0-canary.8656bf0e0.0","@material/base":"15.0.0-canary.8656bf0e0.0","@material/shape":"15.0.0-canary.8656bf0e0.0","@material/theme":"15.0.0-canary.8656bf0e0.0","@material/button":"15.0.0-canary.8656bf0e0.0","@material/tokens":"15.0.0-canary.8656bf0e0.0","@material/animation":"15.0.0-canary.8656bf0e0.0","@material/elevation":"15.0.0-canary.8656bf0e0.0","@material/typography":"15.0.0-canary.8656bf0e0.0","@material/feature-targeting":"15.0.0-canary.8656bf0e0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.8656bf0e0.0_1702415954428_0.5656037533649612","host":"s3://npm-registry-packages"}},"15.0.0-canary.7f224ddd4.0":{"name":"@material/tooltip","version":"15.0.0-canary.7f224ddd4.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.7f224ddd4.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"78bf4353b426030071944cdef45f1c2a023537f6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.7f224ddd4.0.tgz","fileCount":36,"integrity":"sha512-8qNk3pmPLTnam3XYC1sZuplQXW9xLn4Z4MI3D+U17Q7pfNZfoOugGr+d2cLA9yWAEjVJYB0mj8Yu86+udo4N9w==","signatures":[{"sig":"MEUCIEcufPdxDA53PeS3Ohb9RF7axupNeTUKpDSdxkiHSYwGAiEA1ooWtY+h69k5apB+HE/+AkQ09M8sTV9QCY/YNT5C7yc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ff8ff3ce455054f1532d1ae0983f40634a524886","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.7f224ddd4.0","@material/rtl":"15.0.0-canary.7f224ddd4.0","@material/base":"15.0.0-canary.7f224ddd4.0","@material/shape":"15.0.0-canary.7f224ddd4.0","@material/theme":"15.0.0-canary.7f224ddd4.0","@material/button":"15.0.0-canary.7f224ddd4.0","@material/tokens":"15.0.0-canary.7f224ddd4.0","@material/animation":"15.0.0-canary.7f224ddd4.0","@material/elevation":"15.0.0-canary.7f224ddd4.0","@material/typography":"15.0.0-canary.7f224ddd4.0","@material/feature-targeting":"15.0.0-canary.7f224ddd4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.7f224ddd4.0_1703743778827_0.857049087690718","host":"s3://npm-registry-packages"}},"15.0.0-canary.a0b8a90c0.0":{"name":"@material/tooltip","version":"15.0.0-canary.a0b8a90c0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.a0b8a90c0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6ee88912d543a1618a85a29c6a4e4a9049326bef","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.a0b8a90c0.0.tgz","fileCount":36,"integrity":"sha512-O/8vnz5InWgW9j6zxUnqT79ZezOqqjgsgpTAvklBairVoPd6c72qo44zPOkqRX2nVb/t8DF3PIVnD1UxXUcYgQ==","signatures":[{"sig":"MEUCIQDIK4WD3tJEBF5n6AGbwpBqe3M9tZduFDkWHtrPgWBTqgIgc+5uOXEkownrlxVo0SBovuIEiu4u3NRDxRjEIBXG56A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"85d5965379b080c9f852ecbbd95031e363636dfd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.a0b8a90c0.0","@material/rtl":"15.0.0-canary.a0b8a90c0.0","@material/base":"15.0.0-canary.a0b8a90c0.0","@material/shape":"15.0.0-canary.a0b8a90c0.0","@material/theme":"15.0.0-canary.a0b8a90c0.0","@material/button":"15.0.0-canary.a0b8a90c0.0","@material/tokens":"15.0.0-canary.a0b8a90c0.0","@material/animation":"15.0.0-canary.a0b8a90c0.0","@material/elevation":"15.0.0-canary.a0b8a90c0.0","@material/typography":"15.0.0-canary.a0b8a90c0.0","@material/feature-targeting":"15.0.0-canary.a0b8a90c0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.a0b8a90c0.0_1707333605037_0.5980586232760832","host":"s3://npm-registry-packages"}},"15.0.0-canary.e50b478eb.0":{"name":"@material/tooltip","version":"15.0.0-canary.e50b478eb.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.e50b478eb.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"364d9b81dbf8922119cf2caa1bfdf66848e7d1db","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.e50b478eb.0.tgz","fileCount":36,"integrity":"sha512-Enj52GlM4k5Sew8KKMNn45lar09q7BrFkYpf8L0Cs6eCqTYsOQHDd1sBegh0HR8Nh7sKSDXjXdkCmQJzTPHZyA==","signatures":[{"sig":"MEUCIAVJf9Bb4hV97lTAovcKp4XEWXvuFZkBAazuNLe5hiGzAiEAhuXJjl7CMV68rSsjjxMKZD0gF/JCHKdmMYo5lfB0+HM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"4691455eaee76f99b18be70913c9fefb7cf3c2ae","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.e50b478eb.0","@material/rtl":"15.0.0-canary.e50b478eb.0","@material/base":"15.0.0-canary.e50b478eb.0","@material/shape":"15.0.0-canary.e50b478eb.0","@material/theme":"15.0.0-canary.e50b478eb.0","@material/button":"15.0.0-canary.e50b478eb.0","@material/tokens":"15.0.0-canary.e50b478eb.0","@material/animation":"15.0.0-canary.e50b478eb.0","@material/elevation":"15.0.0-canary.e50b478eb.0","@material/typography":"15.0.0-canary.e50b478eb.0","@material/feature-targeting":"15.0.0-canary.e50b478eb.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.e50b478eb.0_1707415715378_0.2428522788550711","host":"s3://npm-registry-packages"}},"15.0.0-canary.c43b3438b.0":{"name":"@material/tooltip","version":"15.0.0-canary.c43b3438b.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.c43b3438b.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"959d3d7419c813e4e3c934c8e7160b32e27e5df6","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.c43b3438b.0.tgz","fileCount":36,"integrity":"sha512-4Z8+oPza3BklBMX0yVjSM4dEpwISA25l9suyAMnNnXC0N23ZXHrcy3zvMfekok2yLaE8aFb3Ijkj2ad5jmacJg==","signatures":[{"sig":"MEUCIQCm21uYU7Acb0aOM6OGDIRO+6Z/5or1OzqNzfUgdTaThgIgIgX8QjHz34DnahY161WFypbIbCRZwzdcJ6Er4cxTKBM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"e69adcf897de97b302f026f07bbc2571b1a488ca","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.c43b3438b.0","@material/rtl":"15.0.0-canary.c43b3438b.0","@material/base":"15.0.0-canary.c43b3438b.0","@material/shape":"15.0.0-canary.c43b3438b.0","@material/theme":"15.0.0-canary.c43b3438b.0","@material/button":"15.0.0-canary.c43b3438b.0","@material/tokens":"15.0.0-canary.c43b3438b.0","@material/animation":"15.0.0-canary.c43b3438b.0","@material/elevation":"15.0.0-canary.c43b3438b.0","@material/typography":"15.0.0-canary.c43b3438b.0","@material/feature-targeting":"15.0.0-canary.c43b3438b.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.c43b3438b.0_1708719488392_0.5343681587545488","host":"s3://npm-registry-packages"}},"15.0.0-canary.819498d8c.0":{"name":"@material/tooltip","version":"15.0.0-canary.819498d8c.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.819498d8c.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"d403ccb4fefe657cb5615cb68f49dd753fba7010","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.819498d8c.0.tgz","fileCount":36,"integrity":"sha512-7sTOKrNw60+werKRfqZF2iStXdFTXRdKYhs9Sc6ynSR3cLC4NTxT+LKgDG+vtDJQlYcN6RqqkFTDnWxCPJYPBw==","signatures":[{"sig":"MEYCIQCx/yar4KryKHzJ5cbMoD/MNOBskXJTMBMR7VeNc5xB/QIhAJ5C9cGjr7uoEhyD4ps+08Jh/hDpVHnCdVrdFNBHQnib","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"886876a8252aacefe1942b13ba9251af9204bcdd","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.819498d8c.0","@material/rtl":"15.0.0-canary.819498d8c.0","@material/base":"15.0.0-canary.819498d8c.0","@material/shape":"15.0.0-canary.819498d8c.0","@material/theme":"15.0.0-canary.819498d8c.0","@material/button":"15.0.0-canary.819498d8c.0","@material/tokens":"15.0.0-canary.819498d8c.0","@material/animation":"15.0.0-canary.819498d8c.0","@material/elevation":"15.0.0-canary.819498d8c.0","@material/typography":"15.0.0-canary.819498d8c.0","@material/feature-targeting":"15.0.0-canary.819498d8c.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.819498d8c.0_1710515746849_0.7697596955861579","host":"s3://npm-registry-packages"}},"15.0.0-canary.453a6248a.0":{"name":"@material/tooltip","version":"15.0.0-canary.453a6248a.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.453a6248a.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"261f88e2bad37f02b6f7e30b30d576d68757c983","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.453a6248a.0.tgz","fileCount":36,"integrity":"sha512-ARpS/+RBeA+ul9Y9hX3y9uD1WgaH/R4UZusM5RBsEjglXaIKTR+O42HGxBRyM57f/TMIpTatjcqDgg9JV2JtGg==","signatures":[{"sig":"MEQCIAhS1efjl8eTLLcq8eWB0ShUlvGEAE5D+4uh1o9VM6SSAiAu5IIjBu7K88aX58i116JBYN4e2U7Rs6eWBm1zBA9NOQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1eea6443d63f2bc64fe8f6f86664b54266c41244","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.453a6248a.0","@material/rtl":"15.0.0-canary.453a6248a.0","@material/base":"15.0.0-canary.453a6248a.0","@material/shape":"15.0.0-canary.453a6248a.0","@material/theme":"15.0.0-canary.453a6248a.0","@material/button":"15.0.0-canary.453a6248a.0","@material/tokens":"15.0.0-canary.453a6248a.0","@material/animation":"15.0.0-canary.453a6248a.0","@material/elevation":"15.0.0-canary.453a6248a.0","@material/typography":"15.0.0-canary.453a6248a.0","@material/feature-targeting":"15.0.0-canary.453a6248a.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.453a6248a.0_1711386846722_0.8409832145674807","host":"s3://npm-registry-packages"}},"15.0.0-canary.68edc03c6.0":{"name":"@material/tooltip","version":"15.0.0-canary.68edc03c6.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.68edc03c6.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"6bf24015d4575a5550d72a525318f4db83869ebe","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.68edc03c6.0.tgz","fileCount":36,"integrity":"sha512-q0Sg8fJUcJG9DclAdh1SqG6tLS3Qd6V5unm8X2zo8P4pj1aIRAPnAU6cobyiUD0hVdj3UD8x4mnFQLQNEKhmOQ==","signatures":[{"sig":"MEQCIHpdMGIa6dDc0eEiRO6WrdWwH5wQuggHa5E1sBAH/xYnAiAjxa8MAw1OWzG62CKW98TemWfVBGlPhrt4JZiBQxXE/g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"04046ad51f4d581f93e797ec929d219422dd0235","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.68edc03c6.0","@material/rtl":"15.0.0-canary.68edc03c6.0","@material/base":"15.0.0-canary.68edc03c6.0","@material/shape":"15.0.0-canary.68edc03c6.0","@material/theme":"15.0.0-canary.68edc03c6.0","@material/button":"15.0.0-canary.68edc03c6.0","@material/tokens":"15.0.0-canary.68edc03c6.0","@material/animation":"15.0.0-canary.68edc03c6.0","@material/elevation":"15.0.0-canary.68edc03c6.0","@material/typography":"15.0.0-canary.68edc03c6.0","@material/feature-targeting":"15.0.0-canary.68edc03c6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.68edc03c6.0_1712603213509_0.472552200678523","host":"s3://npm-registry-packages"}},"15.0.0-canary.5bebc0064.0":{"name":"@material/tooltip","version":"15.0.0-canary.5bebc0064.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.5bebc0064.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8de40e0f84523b57b40672fec3f386f16e46a2e7","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.5bebc0064.0.tgz","fileCount":36,"integrity":"sha512-ajfsoKUCny+FLMmF+zy6gkk+KiZ/Dgn77zRlUfbVA7cO8gTV++LK+G5gbWlUlN8p8vMoV+Aj+OAKASt776EsRg==","signatures":[{"sig":"MEQCIGv4v3YzL1jXAb3MtMWGI405rIhMuzGgoLjnXoNqe9sQAiBG6Ouz+asMyWDMQc7t4KfZkSMp6DY4/Bd+bFaOuXufCw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"ff39e65972de013a29dd14429e111139bc616366","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.5bebc0064.0","@material/rtl":"15.0.0-canary.5bebc0064.0","@material/base":"15.0.0-canary.5bebc0064.0","@material/shape":"15.0.0-canary.5bebc0064.0","@material/theme":"15.0.0-canary.5bebc0064.0","@material/button":"15.0.0-canary.5bebc0064.0","@material/tokens":"15.0.0-canary.5bebc0064.0","@material/animation":"15.0.0-canary.5bebc0064.0","@material/elevation":"15.0.0-canary.5bebc0064.0","@material/typography":"15.0.0-canary.5bebc0064.0","@material/feature-targeting":"15.0.0-canary.5bebc0064.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.5bebc0064.0_1712871718488_0.2878998284256189","host":"s3://npm-registry-packages"}},"15.0.0-canary.311f29a60.0":{"name":"@material/tooltip","version":"15.0.0-canary.311f29a60.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.311f29a60.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"1844c708b25096624763add64352c393ec76329f","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.311f29a60.0.tgz","fileCount":36,"integrity":"sha512-HZ2QzgShglCsaKrA52K/NOXKuF2blzPJOd/OC7+KU2x22FNSE2lIhFAC2izJ9Gfl1W8BSAGvnRgxsmLcG8DFdA==","signatures":[{"sig":"MEUCIQCQyJVa1hb4Y+KSotUZR/93q2s0wyWRMZcGNGAfiWM3DwIgB2jxmsJ1Q4Vno2IVB+C6ZBgBrraUVaWkAEZrj/ykd+4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"7bc0264e163e842f0f96c1dbf7a468c022db1497","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.311f29a60.0","@material/rtl":"15.0.0-canary.311f29a60.0","@material/base":"15.0.0-canary.311f29a60.0","@material/shape":"15.0.0-canary.311f29a60.0","@material/theme":"15.0.0-canary.311f29a60.0","@material/button":"15.0.0-canary.311f29a60.0","@material/tokens":"15.0.0-canary.311f29a60.0","@material/animation":"15.0.0-canary.311f29a60.0","@material/elevation":"15.0.0-canary.311f29a60.0","@material/typography":"15.0.0-canary.311f29a60.0","@material/feature-targeting":"15.0.0-canary.311f29a60.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.311f29a60.0_1713895249740_0.2539107338659541","host":"s3://npm-registry-packages"}},"15.0.0-canary.65c10a622.0":{"name":"@material/tooltip","version":"15.0.0-canary.65c10a622.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.65c10a622.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"f3f457eb321fd7a74cbfed46f9ae26c723cc7c62","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.65c10a622.0.tgz","fileCount":36,"integrity":"sha512-8mBk98AiorCEMBtwtZQKHLpbKY0d0v3NWImScu8hPOdZaHBx+RpGRc2+pY6n8kvSRx/SUE9UNgNqxvsg/wfWEg==","signatures":[{"sig":"MEUCIArEzM8fM8GkDJaUxVRyiaVuwtGbn1CfTdq4O6YbhJG0AiEA3WfblXHluxNSktjY7xNrKJjAjsIIfDAGerr4znicVvU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"1f3126503c812250084b65b6edbb26f25ef4a174","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.65c10a622.0","@material/rtl":"15.0.0-canary.65c10a622.0","@material/base":"15.0.0-canary.65c10a622.0","@material/shape":"15.0.0-canary.65c10a622.0","@material/theme":"15.0.0-canary.65c10a622.0","@material/button":"15.0.0-canary.65c10a622.0","@material/tokens":"15.0.0-canary.65c10a622.0","@material/animation":"15.0.0-canary.65c10a622.0","@material/elevation":"15.0.0-canary.65c10a622.0","@material/typography":"15.0.0-canary.65c10a622.0","@material/feature-targeting":"15.0.0-canary.65c10a622.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.65c10a622.0_1714070970602_0.1117778752159242","host":"s3://npm-registry-packages"}},"15.0.0-canary.4b35cb7d0.0":{"name":"@material/tooltip","version":"15.0.0-canary.4b35cb7d0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.4b35cb7d0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b2cbe8cd8f3629b6c66838575580ddc505a51004","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.4b35cb7d0.0.tgz","fileCount":36,"integrity":"sha512-4M2Sv8prTXNcwkW6ZfkfGOXxQ5cnvW+gfqZfG3bmpCz1LkroNpIeWIrU5yZ+uC2RSRaanAPTTHbViXSUhPlLQA==","signatures":[{"sig":"MEYCIQCX+Y9Xy+ADuCB7XPB/qrA10AIdfqO7pdLsRCNKgp9KfgIhAJY+zj5bdCju+NDYBNqKbcmL0GSvU2+dAxn426fG6viU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"cba29aaa21c1bc2b1f1a02e5ddfa4a5110d9ef63","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.4b35cb7d0.0","@material/rtl":"15.0.0-canary.4b35cb7d0.0","@material/base":"15.0.0-canary.4b35cb7d0.0","@material/shape":"15.0.0-canary.4b35cb7d0.0","@material/theme":"15.0.0-canary.4b35cb7d0.0","@material/button":"15.0.0-canary.4b35cb7d0.0","@material/tokens":"15.0.0-canary.4b35cb7d0.0","@material/animation":"15.0.0-canary.4b35cb7d0.0","@material/elevation":"15.0.0-canary.4b35cb7d0.0","@material/typography":"15.0.0-canary.4b35cb7d0.0","@material/feature-targeting":"15.0.0-canary.4b35cb7d0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.4b35cb7d0.0_1714651415048_0.05265017650395265","host":"s3://npm-registry-packages"}},"15.0.0-canary.f80ac92b0.0":{"name":"@material/tooltip","version":"15.0.0-canary.f80ac92b0.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.f80ac92b0.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2cc970847c4379da184a3f21dd52cfe9c0c6cdee","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.f80ac92b0.0.tgz","fileCount":36,"integrity":"sha512-DW3178JsZqD9Dlytqu7pi2sojXisGv+Bn75oNGbClyO3F4kO8K5yeHsGv/MvAgQiPkbMRbzZimscPlmX57IFeA==","signatures":[{"sig":"MEQCIFhpO5z+INln401ryBnHM7zjLPVnc3zevIjo9tK0EiroAiBzw/gcDjaIOL5BFWLQrS6cITaSjBQy/zazdKfUk0Aa2A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"514a3afe9efc5bcebf1ace1e335357184ee1a9e0","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.f80ac92b0.0","@material/rtl":"15.0.0-canary.f80ac92b0.0","@material/base":"15.0.0-canary.f80ac92b0.0","@material/shape":"15.0.0-canary.f80ac92b0.0","@material/theme":"15.0.0-canary.f80ac92b0.0","@material/button":"15.0.0-canary.f80ac92b0.0","@material/tokens":"15.0.0-canary.f80ac92b0.0","@material/animation":"15.0.0-canary.f80ac92b0.0","@material/elevation":"15.0.0-canary.f80ac92b0.0","@material/typography":"15.0.0-canary.f80ac92b0.0","@material/feature-targeting":"15.0.0-canary.f80ac92b0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.f80ac92b0.0_1714652023660_0.9388023728385464","host":"s3://npm-registry-packages"}},"15.0.0-canary.2f5b899bc.0":{"name":"@material/tooltip","version":"15.0.0-canary.2f5b899bc.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.2f5b899bc.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"277c3737ac5f2659cfb8685339de4f9eb9d6b45c","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.2f5b899bc.0.tgz","fileCount":36,"integrity":"sha512-71HQ5hmwx9h0DfRxzAazyPfXw0jo5C7o+xYqbbwY3SYu/aRpdN5ujbR2TfbWMsQgHGcNyoz4nDsaaVLSnf92+Q==","signatures":[{"sig":"MEUCIQDO04J16P4vzqdJX+ZmAozAbLopz+4nbjZZJCYTb/P/rgIgL81q6WeEuGwTnQ7BEBJI37o//tc6ANdG+csXjwvkXHk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1202992},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"751553ca74ad43074c963487257a8862de87844b","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.2f5b899bc.0","@material/rtl":"15.0.0-canary.2f5b899bc.0","@material/base":"15.0.0-canary.2f5b899bc.0","@material/shape":"15.0.0-canary.2f5b899bc.0","@material/theme":"15.0.0-canary.2f5b899bc.0","@material/button":"15.0.0-canary.2f5b899bc.0","@material/tokens":"15.0.0-canary.2f5b899bc.0","@material/animation":"15.0.0-canary.2f5b899bc.0","@material/elevation":"15.0.0-canary.2f5b899bc.0","@material/typography":"15.0.0-canary.2f5b899bc.0","@material/feature-targeting":"15.0.0-canary.2f5b899bc.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.2f5b899bc.0_1716213447610_0.521608731432514","host":"s3://npm-registry-packages"}},"15.0.0-canary.cfec83c74.0":{"name":"@material/tooltip","version":"15.0.0-canary.cfec83c74.0","keywords":["material components","material design","tooltip"],"license":"MIT","_id":"@material/tooltip@15.0.0-canary.cfec83c74.0","maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"b53af96ac8bd989ddbbe57f29955d074110d8ebf","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.cfec83c74.0.tgz","fileCount":36,"integrity":"sha512-NQ2zCgRkMIJbusRdTFhZyizJenXaIe+WNidVTUSPmAO6CYtSgH8LCw0KPPqTIYUPE8SDere/GB928w5UtJ5Jkg==","signatures":[{"sig":"MEQCIAC2xr2j2DtFxFd7QivLTjnRd3YDA4Gcvd8ye9VXLQxbAiBCEU6ptCd4NN64HrSVVGdwpd3sIoRomoeXRRmfAnY2Iw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1204995},"main":"dist/mdc.tooltip.js","module":"index.js","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n`rich-max-width($max-width)` | Sets the max-width of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","gitHead":"0ec8b129344ebbe45f00b6ad892b682b054ea892","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","description":"The Material Components Web tooltip component.","directories":{},"sideEffects":false,"_nodeVersion":"14.21.3","dependencies":{"tslib":"^2.1.0","safevalues":"^0.3.4","@material/dom":"15.0.0-canary.cfec83c74.0","@material/rtl":"15.0.0-canary.cfec83c74.0","@material/base":"15.0.0-canary.cfec83c74.0","@material/shape":"15.0.0-canary.cfec83c74.0","@material/theme":"15.0.0-canary.cfec83c74.0","@material/button":"15.0.0-canary.cfec83c74.0","@material/tokens":"15.0.0-canary.cfec83c74.0","@material/animation":"15.0.0-canary.cfec83c74.0","@material/elevation":"15.0.0-canary.cfec83c74.0","@material/typography":"15.0.0-canary.cfec83c74.0","@material/feature-targeting":"15.0.0-canary.cfec83c74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/tooltip_15.0.0-canary.cfec83c74.0_1716231443857_0.7294227861719116","host":"s3://npm-registry-packages"}},"15.0.0-canary.423edc3dc.0":{"name":"@material/tooltip","description":"The Material Components Web tooltip component.","version":"15.0.0-canary.423edc3dc.0","license":"MIT","keywords":["material components","material design","tooltip"],"main":"dist/mdc.tooltip.js","module":"index.js","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/material-components/material-components-web.git","directory":"packages/mdc-tooltip"},"dependencies":{"@material/animation":"15.0.0-canary.423edc3dc.0","@material/base":"15.0.0-canary.423edc3dc.0","@material/button":"15.0.0-canary.423edc3dc.0","@material/dom":"15.0.0-canary.423edc3dc.0","@material/elevation":"15.0.0-canary.423edc3dc.0","@material/feature-targeting":"15.0.0-canary.423edc3dc.0","@material/rtl":"15.0.0-canary.423edc3dc.0","@material/shape":"15.0.0-canary.423edc3dc.0","@material/theme":"15.0.0-canary.423edc3dc.0","@material/tokens":"15.0.0-canary.423edc3dc.0","@material/typography":"15.0.0-canary.423edc3dc.0","safevalues":"^0.3.4","tslib":"^2.1.0"},"publishConfig":{"access":"public"},"gitHead":"19b2c5a95782b4928b3aecb29a1075c42aee53e5","readme":"<!--docs:\ntitle: \"Tooltip\"\nlayout: detail\nsection: components\nexcerpt: \"Tooltips display informative text when users hover over, focus on, or tap an element.\"\niconId: tooltip\npath: /catalog/tooltips/\n-->\n\n# Tooltip\n\nTooltips display informative text when users hover over, focus on, or tap an\nelement.\n\n**Contents**\n\n*   [Using tooltips](#using-tooltips)\n*   [Tooltips](#tooltips)\n*   [API](#api)\n*   [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using tooltips\n\nPlain tooltips, when activated, display a text label identifying an element,\nsuch as a description of its function. Tooltips should include only short,\ndescriptive text and avoid restating visible UI text.\n\nCommon use cases include:\n\n*   Displaying full text that has been truncated\n*   Identifying a UI affordance\n*   Describing differences between similar elements\n*   Distinguishing actions with related iconography\n\nRich tooltips provide greater context and assistance for taking action through\nthe additions of an optional title and buttons.\n\nCommon use cases include:\n\n*   Guidance on a particular section of the page or object\n*   Providing informative and contextual actions\n\n### Installing tooltips\n\n```\nnpm install @material/tooltip\n```\n\n### Styles\n\n```scss\n@use \"@material/tooltip/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCTooltip} from '@material/tooltip';\nconst tooltip = new MDCTooltip(document.querySelector('.mdc-tooltip'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more\n> information on how to import JavaScript.\n\n### Making tooltips accessible\n\nEach tooltip element placed into the DOM is expected to have a unique `id`.\nTheir corresponding anchor element must be labeled with the `aria-describedby`\nattribute, establishing a relationship between the two elements.\n\nAnchor elements for rich tooltips without interactive contents (a link or an\naction button), are similarly labeled with `aria-describedby`. Rich tooltips\nwithout interactive content also have the aria-role `tooltip`.\n\nAnchor elements for rich tooltips with interactive elements are labeled with\n`data-tooltip-id`. This prevents the screen reader from announcing the contents\nprior to the user navigating into the tooltip, and giving focus to the\ninteractive elements. Rich tooltips with interactive content have the aria-role\n`dialog` instead of `tooltip` and their anchor elements has their\n`aria-haspopup` property set to `dialog`, and `aria-expanded` set to the\nvisibility of the interactive rich tooltip.\n\n## Tooltips\n\nThere are two types of tooltips:\n\n1.  [Plain Tooltips](#plain-tooltips)\n1.  [Rich Tooltips](#rich-tooltips)\n\n### Plain tooltips\n\n![Plain tooltip example](images/tooltip.png)\n\n#### Plain tooltip example\n\n```html\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">lorem ipsum dolor<span>\n  </div>\n</div>\n```\n\nTo ensure proper positioning of the tooltip, it's important that this tooltip\nelement is an immediate child of the `<body>`, rather than nested underneath the\nanchor element or other elements.\n\n```html\n<a aria-describedby=\"tooltip-id\" href=\"www.google.com\"> Link </a>\n```\n\nThe `aria-describedby` attribute (which is given the `id` for the associated\ntooltip) designates an element as being the anchor element for a particular\ntooltip.\n\nOther MDC components can be designated as anchor elements by adding this\nattribute.\n\n### Rich tooltips\n\n![Rich tooltip example](images/rich_tooltip.png)\n\nRich tooltips have two variants: default and persistent.\n\nDefault rich tooltips are shown when users hover over or focus on their anchor\nelement. They remain shown when users focus/hover over the contents of the rich\ntooltip, but becomes hidden if the users focus/hover outside of the anchor\nelement or the tooltip contents. If the user clicks within the contents of the\ntooltip, the tooltip will also be hidden.\n\nPersistent rich tooltips' visibility is toggled by clicks and enter/space bar\nkeystrokes on their anchor element. When shown, they remain visible when users\nfocus/hover over the contents of the rich tooltip, as well as when users hover\noutside of the anchor element or the tooltip contents. However, they become\nhidden when the users focus outside of the anchor element or the tooltip\ncontents. If the user clicks within the contents of the tooltip, the tooltip\nremains shown. If the user clicks outside the contents of the tooltip, the\ntooltip will be hidden. It is recommended that persistent rich tooltips are not\nadded to anchor elements that already have an click action; the click action for\nthe anchor element should be used solely to toggle the visibility of the rich\ntooltip.\n\n#### Rich tooltip example\n\nDefault rich tooltip without interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" aria-describedby=\"tt0\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"tooltip\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n       <p class=\"mdc-tooltip__content\">\n         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n         pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n         aliquam sit amet sit amet eros.\n       </p>\n     </div>\n  </div>\n</div>\n```\n\nThe rich tooltip element should be a sibling of the anchor element; the anchor\nand the tooltip element should be wrapped in a parent div with the class\n`mdc-tooltip-wrapper--rich` or the tooltip will not be positioned correctly.\n\nDefault rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n            <button class=\"mdc-button mdc-tooltip--rich-action\">\n              <div class=\"mdc-button__ripple\"></div>\n              <span class=\"mdc-button__focus-ring\"></span>\n              <span class=\"mdc-button__label\">Action</span>\n            </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that any links used within the rich tooltip has the class\n`mdc-tooltip__content-link`. This is to ensure that the color of links within\nrich tooltips are consistent with the color theming.\n\nPersistent rich tooltip with interactive content\n\n```html\n<div class=\"mdc-tooltip-wrapper--rich\">\n  <button class=\"mdc-button\" data-tooltip-id=\"tt0\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n    <div class=\"mdc-button__ripple\"></div>\n    <span class=\"mdc-button__label\">Button</span>\n  </button>\n  <div id=\"tt0\" class=\"mdc-tooltip mdc-tooltip--rich\" aria-hidden=\"true\" tabindex=\"-1\" data-mdc-tooltip-persistent=\"true\" role=\"dialog\">\n     <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n        <h2 class=\"mdc-tooltip__title\"> Lorem Ipsum </h2>\n        <p class=\"mdc-tooltip__content\">\n          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur\n          pretium vitae est et dapibus. Aenean sit amet felis eu lorem fermentum\n          aliquam sit amet sit amet eros.\n          <a class=\"mdc-tooltip__content-link\" href=\"google.com\">link</a>\n        </p>\n        <div class=\"mdc-tooltip--rich-actions\">\n          <button class=\"mdc-button mdc-tooltip--rich-action\">\n            <div class=\"mdc-button__ripple\"></div>\n            <span class=\"mdc-button__focus-ring\"></span>\n            <span class=\"mdc-button__label\">Action</span>\n          </button>\n        </div>\n     </div>\n  </div>\n</div>\n```\n\nNote that persistent rich tooltips have `tabindex` set to `-1`. This is added to\nensure that the tooltip is not hidden when clicked on.\n\n#### MDC Button:\n\n```html\n<button class=\"mdc-button mdc-button--outlined\" aria-describedby=\"tooltip-id\">\n  <div class=\"mdc-button__ripple\"></div>\n  <span class=\"mdc-button__label\">Button</span>\n</button>\n```\n\n#### MDC Icon Button:\n\n```html\n<button class=\"mdc-icon-button material-icons\" aria-describedby=\"tooltip-id\">favorite</button>\n```\n\nIf the information provided in the tooltip is duplicated from the anchor\nelement's `aria-label`, the tooltip can be hidden from the screenreader by\nannotating the anchor element with `data-tooltip-id` instead of\n`aria-describedby`. Hiding the tooltip from the screenreader will prevent the\nsame information from being announced twice (once from the `aria-label` and a\nsecond time from the tooltip).\n\n```html\n<button class=\"mdc-icon-button material-icons\"\n        aria-label=\"toggle favorite\"\n        data-tooltip-id=\"tooltip-id\">\n  favorite\n</button>\n\n<div id=\"tooltip-id\" class=\"mdc-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n  <div class=\"mdc-tooltip__surface mdc-tooltip__surface-animation\">\n    <span class=\"mdc-tooltip__label\">toggle favorite</span>\n  </div>\n</div>\n```\n\n### Tooltip positioning\n\nTooltip positioning is based on the anchor element.\n\nPlain tooltips appear directly below or above this anchor element and can be\nplaced flush with either the end, center, or start of the anchor.\n\n![End, center, and start alignment of tooltip on icon button in a LTR page](images/plain_tooltip_alignment.png)\n<p align=\"center\"> *Plain tooltip aligned with the end, center, and start of an\nanchor element (in a LTR page flow).* </p>\n\nRich tooltips appear directly below or above this anchor element, and can be\nplaced at the corner of either the end or start of the anchor.\n\n![End and start alignment of rich tooltip on button in a LTR page](images/rich_tooltip_alignment.png)\n<p align=\"center\"> *Rich tooltip aligned with the end and start of an anchor\nelement (in a LTR page flow).* </p>\n\nA threshold distance of 32px is expected to be maintained between the tooltip\nand the viewport edge. A valid tooltip position is calculated based on which of\nthe position options (start, center, or end for x-axis alignment and above or\nbelow for y-axis alignment) maintain this threshold. If all possible alignment\noptions violate the threshold, then a valid tooltip position is one that does\nnot collide with the viewport.\n\nA user specified position is honored only if the specified position is\nconsidered valid based on the logic outlined above.\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the tooltip's theme style module.\n\n```scss\n@use \"@material/tooltip\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the tooltip.\n`rich-fill-color($color)` | Sets the fill color of the rich tooltip.\n`label-ink-color($color)` | Sets the color of the tooltip's label text.\n`rich-text-ink-color($title-color, $content-color, $content-link-color)` | Sets the color of the text for the content inside a rich tooltip.\n`shape-radius($radius, $rtl-reflexive)` | Sets the rounded shape to tooltip surface with given radius size. Set `$rtl-reflexive` to true to flip radius values in RTL context, defaults to false.\n`word-break($value, $fallbackValue)` | Sets the `word-break` property for the tooltip label. This is used to force-wrap long tooltip labels that lack spaces and hyphens. The optional $fallbackValue param can be used for IE11 as it does not support the `break-word` option. Users for IE11 who do not want their tooltip labels to be broken in the middle of the word can use this mixin to remove the default IE11 behavior of `break-all`.\n`z-index($z-index)` | Sets the z-index of the tooltip.\n`show-transition($enter-duration)` | Sets the duration for the animation that shows the tooltip.\n`exit-transition($exit-duration)` | Sets the duration for the animation that hides the tooltip.\n`rich-max-height($max-height)` | Sets the max-height of a rich tooltip.\n`rich-max-width($max-width)` | Sets the max-width of a rich tooltip.\n\n### `MDCTooltip` Methods\n\nMethod Signature | Description\n--- | ---\n`setTooltipPosition(position: {xPos?: XPosition, yPos?: YPosition}) => void` | Specify how the tooltip should be aligned with the anchor element. See [tooltip positioning](#tooltip-positioning) section for more information.\n`setAnchorBoundaryType(type: AnchorBoundaryType) => void` | Specify whether the anchor element is `bounded` (element has an identifiable boundary such as a button) or `unbounded` (element does not have a visually declared boundary such as a text link). Tooltips are placed closer to bounded anchor elements compared to unbounded anchor elements. If no type is specified, defaults to `bounded`.\n`hide() => void` | Proxies to the foundation's `hide` method, immediately hides the tooltip if it is shown.\n`isShown() => boolean` | Returns whether or not the tooltip is shown.\n`attachScrollHandler(addEventListenerFn: (event, handler) => void)` | Provided with a method that registers an event listener on a given element, will attach a `scroll` event handler on said element when the tooltip is shown. This should be used in situations where the anchor element is placed inside a scrollable container (that is not the body element), and will keep the tooltip \"attached\" to the anchor element when this element is scrolled.\n`removeScrollHandler(removeEventHandlerFn: (event, handler) => void)` | Should be used in conjunction with the above `attachScrollHandler` method. Removes the additional scroll handlers attached in the above method when the tooltip is hidden.\n`setShowDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being shown.\n`setHideDelay(delayMs: number) => void` | Specify the delay prior to a tooltip being hidden.\n\n### Usage Within Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can\ncreate a Tooltip for your framework. Depending on your needs, you can use the\n_Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced\nApproach: Using Foundations and Adapters_. Please follow the instructions\n[here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCTooltipAdapter](./adapter.ts) and\n[MDCTooltipFoundation](./foundation.ts) for up-to-date code documentation of\ntooltip foundation APIs.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"homepage":"https://github.com/material-components/material-components-web#readme","_id":"@material/tooltip@15.0.0-canary.423edc3dc.0","_nodeVersion":"14.21.3","_npmVersion":"lerna/3.20.2/node@v14.21.3+x64 (linux)","dist":{"integrity":"sha512-mQgu90BSOD3ytoiHFV0lzrEU2gDeynFPgXAhYWWyVqd1ayaIyOlRKIbab90TTN8JINQkaTqMN/lyBY+OuBOeCA==","shasum":"e1624220ff47922df3170e11513971ef19a64aa9","tarball":"https://registry.npmjs.org/@material/tooltip/-/tooltip-15.0.0-canary.423edc3dc.0.tgz","fileCount":36,"unpackedSize":1204995,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcQaDz7dP+tHq2FtN9AfANhXjPXkpQM/lSuOpZYCdPHgIhAM2+FkjUzJKOCOVQ6oSCXkEEXR6UekkLanG/IuV0+hjG"}]},"_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tooltip_15.0.0-canary.423edc3dc.0_1719425541906_0.48897176475654036"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-08T16:49:09.404Z","modified":"2024-06-26T18:12:22.555Z","2.0.0-dev.20160903":"2016-12-14T23:44:57.645Z","2.0.0-dev-20160723":"2016-12-14T23:44:57.645Z","2.0.0-dev.20160810":"2016-12-14T23:44:57.645Z","2.0.0-dev.20160822":"2016-12-14T23:44:57.645Z","2.0.0-dev.20160822-1":"2016-12-14T23:44:57.645Z","8.0.0-canary.2e5711e04.0":"2020-07-08T16:49:09.553Z","8.0.0-canary.811fc5d24.0":"2020-07-08T17:16:31.308Z","8.0.0-canary.6ed717ddd.0":"2020-07-08T19:44:52.579Z","8.0.0-canary.d850de590.0":"2020-07-09T18:06:14.575Z","8.0.0-canary.e07a70841.0":"2020-07-09T18:35:59.510Z","8.0.0-canary.37947ed6c.0":"2020-07-09T20:36:56.956Z","8.0.0-canary.5d443afec.0":"2020-07-09T20:52:26.089Z","8.0.0-canary.9ac1ed914.0":"2020-07-09T21:21:21.925Z","8.0.0-canary.1e7cb6198.0":"2020-07-09T22:13:11.838Z","8.0.0-canary.843f636c0.0":"2020-07-10T17:43:33.027Z","8.0.0-canary.b2edaeead.0":"2020-07-10T18:07:56.959Z","8.0.0-canary.5dac1f624.0":"2020-07-13T16:35:03.337Z","8.0.0-canary.4497acef8.0":"2020-07-14T14:20:55.211Z","8.0.0-canary.e6e23019d.0":"2020-07-14T20:11:24.949Z","8.0.0-canary.d548d7a92.0":"2020-07-14T21:13:47.577Z","8.0.0-canary.58ce529cc.0":"2020-07-14T21:15:49.768Z","8.0.0-canary.a0f1202dc.0":"2020-07-14T21:35:18.736Z","8.0.0-canary.ad4df58c1.0":"2020-07-15T00:10:09.210Z","8.0.0-canary.01db89053.0":"2020-07-16T16:40:22.923Z","8.0.0-canary.fb5a4cdeb.0":"2020-07-20T19:20:44.335Z","8.0.0-canary.8df0f517c.0":"2020-07-20T23:56:26.751Z","8.0.0-canary.abcdbcfeb.0":"2020-07-21T00:50:58.776Z","8.0.0-canary.7bd5075de.0":"2020-07-21T18:47:58.137Z","8.0.0-canary.405a29a20.0":"2020-07-22T22:24:03.608Z","8.0.0-canary.f3693ac4c.0":"2020-07-22T22:34:28.543Z","8.0.0-canary.12a109680.0":"2020-07-22T23:04:16.910Z","8.0.0-canary.bbd06696e.0":"2020-07-22T23:53:46.505Z","8.0.0-canary.4951e7651.0":"2020-07-23T01:50:30.478Z","8.0.0-canary.75deebbef.0":"2020-07-23T17:47:56.569Z","8.0.0-canary.95aff33ee.0":"2020-07-23T18:48:12.567Z","8.0.0-canary.9d9f47473.0":"2020-07-23T19:59:36.285Z","8.0.0-canary.00dfbf6be.0":"2020-07-23T21:00:28.507Z","8.0.0-canary.b87e522d2.0":"2020-07-23T21:24:24.920Z","8.0.0-canary.5b3e150e5.0":"2020-07-24T01:24:49.567Z","8.0.0-canary.f0ae11786.0":"2020-07-24T01:44:26.685Z","8.0.0-canary.fb4ee66c0.0":"2020-07-24T02:11:32.387Z","8.0.0-canary.5511e0aeb.0":"2020-07-24T16:57:34.727Z","8.0.0-canary.8388a9bf6.0":"2020-07-24T20:14:11.413Z","8.0.0-canary.ac405eae1.0":"2020-07-27T15:07:19.963Z","8.0.0-canary.75553837c.0":"2020-07-27T15:13:14.383Z","8.0.0-canary.b96fbfc7a.0":"2020-07-27T15:38:52.016Z","8.0.0-canary.61f1a8d85.0":"2020-07-27T15:47:59.285Z","8.0.0-canary.81dc33377.0":"2020-07-27T16:00:03.272Z","8.0.0-canary.ffd9ede58.0":"2020-07-27T16:33:26.505Z","8.0.0-canary.52dc55acf.0":"2020-07-27T17:09:22.844Z","8.0.0-canary.d4274ff05.0":"2020-07-27T19:51:17.300Z","8.0.0-canary.b82d0696d.0":"2020-07-27T19:58:56.914Z","8.0.0-canary.c2852000d.0":"2020-07-27T20:59:12.332Z","8.0.0-canary.f86f83f54.0":"2020-07-27T21:54:51.948Z","8.0.0-canary.41eb1684c.0":"2020-07-28T17:51:19.091Z","8.0.0-canary.9e2f6c450.0":"2020-07-28T22:40:04.555Z","8.0.0-canary.e6950b55a.0":"2020-07-28T22:53:35.644Z","8.0.0-canary.5e51ee38e.0":"2020-07-28T23:16:47.797Z","8.0.0-canary.a3898ffcf.0":"2020-07-29T00:37:12.854Z","8.0.0-canary.bc5cc6c96.0":"2020-07-29T00:49:59.938Z","8.0.0-canary.9bdeaf928.0":"2020-07-29T01:21:39.692Z","8.0.0-canary.fde2c1f9d.0":"2020-07-29T01:35:49.180Z","8.0.0-canary.6b3876d5d.0":"2020-07-29T01:39:42.270Z","8.0.0-canary.30ce17873.0":"2020-07-29T17:15:48.681Z","8.0.0-canary.f6bb43bf0.0":"2020-07-29T18:26:22.166Z","8.0.0-canary.6af75f6ab.0":"2020-07-30T00:02:19.704Z","8.0.0-canary.42d7a65aa.0":"2020-07-30T00:11:27.240Z","8.0.0-canary.85abdabb7.0":"2020-07-30T00:16:05.458Z","8.0.0-canary.49fb20ca3.0":"2020-07-30T01:28:24.282Z","8.0.0-canary.962d4abbb.0":"2020-07-30T16:11:07.151Z","8.0.0-canary.2fcee40cb.0":"2020-07-30T17:22:15.891Z","8.0.0-canary.bd5987f5a.0":"2020-07-30T17:46:59.878Z","8.0.0-canary.005e86a9b.0":"2020-07-30T18:00:56.373Z","8.0.0-canary.e309c7c68.0":"2020-07-30T18:09:34.591Z","8.0.0-canary.935a51cc0.0":"2020-07-30T18:21:11.571Z","8.0.0-canary.74839da7b.0":"2020-07-30T18:32:19.450Z","8.0.0-canary.f041a48c9.0":"2020-07-30T23:00:36.011Z","8.0.0-canary.fbb1381e1.0":"2020-07-31T15:51:13.694Z","8.0.0-canary.7f61d5785.0":"2020-07-31T17:23:47.223Z","8.0.0-canary.e1bc84d10.0":"2020-08-03T17:51:41.462Z","8.0.0-canary.096a7a066.0":"2020-08-03T17:54:43.652Z","8.0.0-canary.aa3a3e5a4.0":"2020-08-03T17:55:25.036Z","8.0.0-canary.5903d39af.0":"2020-08-03T17:55:38.686Z","8.0.0-canary.72258f898.0":"2020-08-04T01:18:12.025Z","8.0.0-canary.1b44b43c8.0":"2020-08-04T16:49:15.866Z","8.0.0-canary.e9d2e2f96.0":"2020-08-04T20:25:00.660Z","8.0.0-canary.b9dff0a19.0":"2020-08-05T03:49:42.295Z","8.0.0-canary.2bd09a706.0":"2020-08-05T03:54:53.033Z","8.0.0-canary.e0560522f.0":"2020-08-05T17:20:50.553Z","8.0.0-canary.08ca4d0ec.0":"2020-08-05T17:40:10.222Z","8.0.0-canary.08090126b.0":"2020-08-06T19:33:25.933Z","8.0.0-canary.e8bf5b2ac.0":"2020-08-06T21:50:55.399Z","8.0.0-canary.e3b746208.0":"2020-08-06T22:27:35.072Z","8.0.0-canary.96a640534.0":"2020-08-06T22:42:19.253Z","8.0.0-canary.9f9aac825.0":"2020-08-07T20:52:10.448Z","8.0.0-canary.fc65fd00b.0":"2020-08-10T15:21:46.118Z","8.0.0-canary.02e372c5f.0":"2020-08-10T15:49:34.033Z","8.0.0-canary.66669e3b6.0":"2020-08-10T15:53:25.315Z","8.0.0-canary.6d1ea9761.0":"2020-08-11T14:31:44.679Z","8.0.0-canary.79414bf9f.0":"2020-08-11T19:02:52.953Z","8.0.0-canary.85a5272df.0":"2020-08-11T20:09:01.009Z","8.0.0-canary.fda053eb8.0":"2020-08-12T20:05:00.541Z","8.0.0-canary.760873445.0":"2020-08-12T21:44:02.879Z","8.0.0-canary.2f4711a30.0":"2020-08-12T21:54:03.909Z","8.0.0-canary.2d72f3659.0":"2020-08-12T22:01:40.174Z","8.0.0-canary.1fee70a5e.0":"2020-08-12T23:29:30.441Z","8.0.0-canary.023f3fa34.0":"2020-08-13T01:13:12.765Z","8.0.0-canary.80f3a9e5d.0":"2020-08-13T01:29:58.177Z","8.0.0-canary.a1dcfe97c.0":"2020-08-13T08:51:19.148Z","8.0.0-canary.af332d5be.0":"2020-08-13T21:18:15.539Z","8.0.0-canary.7dd4567c4.0":"2020-08-14T00:51:54.866Z","8.0.0-canary.ff870005a.0":"2020-08-14T01:16:58.243Z","8.0.0-canary.150f427a0.0":"2020-08-14T13:30:49.850Z","8.0.0-canary.bcc58290a.0":"2020-08-14T23:23:16.686Z","8.0.0-canary.4f55400bb.0":"2020-08-17T16:39:23.338Z","8.0.0-canary.000d64815.0":"2020-08-17T17:05:09.126Z","8.0.0-canary.defa599a8.0":"2020-08-17T20:32:42.974Z","8.0.0-canary.66b8ed7e6.0":"2020-08-18T18:37:39.422Z","8.0.0-canary.e2b1033df.0":"2020-08-19T18:42:56.420Z","8.0.0-canary.2e8c3dd2e.0":"2020-08-19T19:24:43.838Z","8.0.0-canary.b2e80a5d9.0":"2020-08-19T22:21:51.317Z","8.0.0-canary.ff88df637.0":"2020-08-19T22:33:52.736Z","8.0.0-canary.32fb314cd.0":"2020-08-20T10:38:32.094Z","8.0.0-canary.546277d32.0":"2020-08-20T16:44:38.086Z","8.0.0-canary.da72839f4.0":"2020-08-20T18:00:51.644Z","8.0.0-canary.346069ccb.0":"2020-08-20T18:19:26.277Z","8.0.0-canary.e27c5802f.0":"2020-08-20T19:15:58.582Z","8.0.0-canary.f4532b9c8.0":"2020-08-20T19:58:30.477Z","8.0.0-canary.fbf73c2a6.0":"2020-08-20T21:07:17.144Z","8.0.0-canary.cf800124f.0":"2020-08-20T21:53:31.063Z","8.0.0-canary.95e4eeea7.0":"2020-08-20T23:29:39.016Z","8.0.0-canary.91ab1c62a.0":"2020-08-21T15:12:33.809Z","8.0.0-canary.58eaa9f02.0":"2020-08-21T20:01:10.256Z","8.0.0-canary.238216fc4.0":"2020-08-24T15:41:38.282Z","8.0.0-canary.a1c65593d.0":"2020-08-25T03:04:37.627Z","8.0.0-canary.708cc09c4.0":"2020-08-25T15:57:12.497Z","8.0.0-canary.19bea2ad3.0":"2020-08-26T18:50:13.551Z","8.0.0-canary.911014711.0":"2020-08-27T16:08:57.206Z","8.0.0-canary.d3387f54c.0":"2020-09-03T20:56:49.045Z","8.0.0-canary.2ccf996cc.0":"2020-09-03T20:56:59.713Z","8.0.0-canary.744bfe5d8.0":"2020-09-03T20:58:06.989Z","8.0.0-canary.78da96eaf.0":"2020-09-08T19:13:39.678Z","8.0.0-canary.b0ed593cc.0":"2020-09-09T06:16:50.219Z","8.0.0-canary.85a1fa9ea.0":"2020-09-10T21:11:29.859Z","8.0.0-canary.0bc41a9c7.0":"2020-09-11T17:50:44.614Z","8.0.0-canary.fc0eb5013.0":"2020-09-11T19:56:31.387Z","8.0.0-canary.319bf66de.0":"2020-09-11T23:11:08.925Z","8.0.0-canary.5bfc305ec.0":"2020-09-13T23:01:04.166Z","8.0.0-canary.83d83f131.0":"2020-09-14T00:33:34.904Z","8.0.0-canary.d52b165b5.0":"2020-09-15T14:55:17.950Z","8.0.0-canary.a831d4799.0":"2020-09-15T17:52:45.991Z","8.0.0-canary.a306aa488.0":"2020-09-17T00:59:41.932Z","8.0.0-canary.fd608ff66.0":"2020-09-17T14:26:48.355Z","8.0.0-canary.3e435ba57.0":"2020-09-17T14:44:05.703Z","8.0.0-canary.c250ec52a.0":"2020-09-17T20:11:23.804Z","8.0.0-canary.e34e411b1.0":"2020-09-17T20:18:44.241Z","8.0.0-canary.4e9343929.0":"2020-09-17T20:44:06.049Z","8.0.0-canary.4e5c350c2.0":"2020-09-21T21:15:05.943Z","8.0.0-canary.16c563ef7.0":"2020-09-22T19:47:12.677Z","8.0.0-canary.fd8af3d43.0":"2020-09-23T19:33:14.204Z","8.0.0-canary.d4cd83a85.0":"2020-09-25T00:36:58.917Z","8.0.0-canary.199aecdfb.0":"2020-09-25T15:52:22.418Z","8.0.0-canary.38ef4501f.0":"2020-09-30T18:25:33.380Z","8.0.0-canary.774dcfc8e.0":"2020-10-01T09:55:17.550Z","8.0.0-canary.0f60323a8.0":"2020-10-08T21:11:03.000Z","8.0.0-canary.d71622574.0":"2020-10-09T16:32:50.724Z","8.0.0-canary.7a9afaf4b.0":"2020-10-09T22:55:03.302Z","8.0.0-canary.8a39352c8.0":"2020-10-12T17:47:25.493Z","8.0.0-canary.790ca85fd.0":"2020-10-12T21:57:43.133Z","8.0.0-canary.174c0becf.0":"2020-10-14T02:16:39.303Z","8.0.0-canary.c71ebfa02.0":"2020-10-14T04:18:41.422Z","8.0.0-canary.2ab716cbd.0":"2020-10-16T00:05:17.650Z","8.0.0-canary.43c1c5e2f.0":"2020-10-19T14:09:10.460Z","8.0.0-canary.ccc64eea3.0":"2020-10-26T22:52:34.292Z","8.0.0-canary.a79cdd019.0":"2020-10-27T16:32:39.620Z","8.0.0-canary.596e98424.0":"2020-10-28T16:04:44.046Z","8.0.0-canary.05d5facc2.0":"2020-10-28T16:13:25.169Z","8.0.0-canary.291b3553d.0":"2020-10-28T17:46:05.159Z","8.0.0-canary.dbc449b09.0":"2020-10-28T18:13:51.011Z","8.0.0-canary.4794b25da.0":"2020-10-28T18:42:18.930Z","8.0.0-canary.c61db90a5.0":"2020-10-28T19:01:00.503Z","8.0.0-canary.6d9648ab2.0":"2020-10-29T20:33:41.601Z","8.0.0-canary.5511c5254.0":"2020-10-30T18:01:15.109Z","8.0.0-canary.bd6e302a4.0":"2020-11-02T17:05:56.373Z","9.0.0-canary.d6b5cd418.0":"2020-11-02T23:00:24.729Z","8.0.0":"2020-11-02T23:00:42.857Z","9.0.0-canary.fdf9a2634.0":"2020-11-03T23:22:30.304Z","9.0.0-canary.4a86f30a0.0":"2020-11-03T23:29:12.631Z","9.0.0-canary.fc8b045f1.0":"2020-11-03T23:38:08.699Z","9.0.0-canary.a0b2db26b.0":"2020-11-04T00:10:25.005Z","9.0.0-canary.419e03572.0":"2020-11-04T01:34:02.699Z","9.0.0-canary.a432ad542.0":"2020-11-06T01:46:49.384Z","9.0.0-canary.e2e8aef1e.0":"2020-11-06T02:06:16.548Z","9.0.0-canary.ec6b68b34.0":"2020-11-06T18:57:38.585Z","9.0.0-canary.b39094d14.0":"2020-11-06T21:17:03.579Z","9.0.0-canary.8648b8258.0":"2020-11-12T10:45:46.951Z","9.0.0-canary.240c5f74f.0":"2020-11-12T20:21:55.675Z","9.0.0-canary.6cf6ba4f4.0":"2020-11-16T18:50:53.628Z","9.0.0-canary.07f3e01b7.0":"2020-11-16T21:46:43.815Z","9.0.0-canary.23491cf85.0":"2020-11-17T00:18:12.564Z","9.0.0-canary.b659d4fc3.0":"2020-11-17T00:26:03.390Z","9.0.0-canary.d8a3aed67.0":"2020-11-17T15:28:34.109Z","9.0.0-canary.482ff9091.0":"2020-11-17T17:59:06.269Z","9.0.0-canary.99cfb6bd5.0":"2020-11-18T18:45:02.197Z","9.0.0-canary.b98d15d90.0":"2020-11-18T22:35:47.816Z","9.0.0-canary.30c11bfc2.0":"2020-11-19T01:27:02.985Z","9.0.0-canary.1b731d51b.0":"2020-11-19T18:53:20.107Z","9.0.0-canary.4ae94ff78.0":"2020-11-19T18:56:21.375Z","9.0.0-canary.7ad038e1d.0":"2020-11-19T19:19:28.351Z","9.0.0-canary.a41527604.0":"2020-11-19T20:01:12.020Z","9.0.0-canary.7b0e2b377.0":"2020-11-20T22:56:52.389Z","9.0.0-canary.c927a5d05.0":"2020-11-23T19:48:36.036Z","9.0.0-canary.b349b5185.0":"2020-11-24T17:10:00.766Z","9.0.0-canary.9083b7d61.0":"2020-11-24T21:16:39.263Z","9.0.0-canary.eff7b46ac.0":"2020-11-24T23:32:07.915Z","9.0.0-canary.ae27b44b0.0":"2020-11-25T15:35:21.529Z","9.0.0-canary.2fbba2554.0":"2020-11-30T17:41:19.066Z","9.0.0-canary.6d8574fe1.0":"2020-11-30T17:52:17.089Z","9.0.0-canary.fd22355f7.0":"2020-11-30T23:00:34.163Z","9.0.0-canary.c4ab98722.0":"2020-12-02T00:57:48.886Z","9.0.0-canary.977585650.0":"2020-12-02T14:43:22.058Z","9.0.0-canary.c7edfc7b6.0":"2020-12-02T14:50:33.178Z","9.0.0-canary.4f3347306.0":"2020-12-02T15:08:30.781Z","9.0.0-canary.37fbae10d.0":"2020-12-02T18:17:24.858Z","9.0.0-canary.11da3c0db.0":"2020-12-02T20:23:25.182Z","9.0.0-canary.489d4c219.0":"2020-12-03T15:30:43.314Z","9.0.0-canary.6557a69d9.0":"2020-12-03T15:42:29.151Z","9.0.0-canary.4ea1b7c69.0":"2020-12-03T15:59:33.701Z","9.0.0-canary.eaeb78ce3.0":"2020-12-03T17:02:31.101Z","9.0.0-canary.1c156d69d.0":"2020-12-03T20:46:15.279Z","9.0.0-canary.832668d33.0":"2020-12-04T18:06:57.013Z","9.0.0-canary.4321323e4.0":"2020-12-07T11:29:56.033Z","9.0.0-canary.2d5f32d41.0":"2020-12-07T16:42:59.507Z","9.0.0-canary.8239afc64.0":"2020-12-07T19:50:29.807Z","9.0.0-canary.6871336f1.0":"2020-12-08T16:02:32.890Z","9.0.0-canary.9f718da94.0":"2020-12-08T16:14:17.873Z","9.0.0-canary.1fccb1418.0":"2020-12-08T16:29:15.848Z","9.0.0-canary.afb68894e.0":"2020-12-08T16:33:17.505Z","9.0.0-canary.fd88d40c2.0":"2020-12-08T16:46:59.606Z","9.0.0-canary.ba9e3109c.0":"2020-12-08T19:06:22.670Z","9.0.0-canary.1085c3b2d.0":"2020-12-09T19:12:03.328Z","9.0.0-canary.c5dda809d.0":"2020-12-09T20:51:07.860Z","9.0.0-canary.f5f1bd86a.0":"2020-12-09T21:07:58.801Z","9.0.0-canary.00f38200f.0":"2020-12-11T15:47:09.304Z","9.0.0-canary.ac41a5729.0":"2020-12-11T16:29:32.012Z","9.0.0-canary.7fe0e4f05.0":"2020-12-11T17:06:36.322Z","9.0.0-canary.9244508bd.0":"2020-12-11T19:08:23.687Z","9.0.0-canary.384a8eeb1.0":"2020-12-16T17:02:47.176Z","9.0.0-canary.eabf9d5c2.0":"2020-12-16T18:28:40.717Z","9.0.0-canary.30fdfd06e.0":"2020-12-16T19:08:27.436Z","9.0.0-canary.9590a8f90.0":"2020-12-22T17:43:03.327Z","9.0.0-canary.f89d8b8f2.0":"2020-12-22T23:06:05.607Z","9.0.0-canary.fb194dd35.0":"2020-12-28T20:46:30.966Z","9.0.0-canary.64f36e287.0":"2020-12-28T21:09:24.433Z","9.0.0-canary.b7bbe7022.0":"2020-12-29T18:48:52.280Z","9.0.0":"2020-12-29T19:47:04.967Z","10.0.0-canary.776c18681.0":"2020-12-30T00:41:02.970Z","10.0.0-canary.671d72d95.0":"2020-12-30T20:12:52.895Z","10.0.0-canary.b4f5a1c9e.0":"2020-12-30T21:47:19.841Z","10.0.0-canary.a94bd8deb.0":"2020-12-30T22:05:13.608Z","10.0.0-canary.5d128511b.0":"2020-12-30T22:10:34.395Z","10.0.0-canary.365c69360.0":"2021-01-05T17:49:14.128Z","10.0.0-canary.700a8261a.0":"2021-01-05T21:01:38.363Z","10.0.0-canary.766981c15.0":"2021-01-05T22:41:13.452Z","10.0.0-canary.b28c576d9.0":"2021-01-05T22:50:53.722Z","10.0.0-canary.968735356.0":"2021-01-06T15:52:01.909Z","10.0.0-canary.c5e18b020.0":"2021-01-06T19:45:15.346Z","10.0.0-canary.bcff8a66a.0":"2021-01-06T20:27:28.659Z","10.0.0-canary.79328c9ff.0":"2021-01-07T02:35:09.601Z","10.0.0-canary.121e1f303.0":"2021-01-07T23:20:47.027Z","10.0.0-canary.abdd10065.0":"2021-01-08T17:52:29.091Z","10.0.0-canary.089de519c.0":"2021-01-08T22:21:31.241Z","10.0.0-canary.163119837.0":"2021-01-08T23:46:19.140Z","10.0.0-canary.b8a1a58e4.0":"2021-01-11T16:25:22.576Z","10.0.0-canary.7584267ff.0":"2021-01-12T01:13:19.514Z","10.0.0-canary.251ac04c0.0":"2021-01-12T19:56:21.369Z","10.0.0-canary.772cc1068.0":"2021-01-14T00:08:03.998Z","10.0.0-canary.fe13dd130.0":"2021-01-14T01:11:11.989Z","10.0.0-canary.c7c5da28f.0":"2021-01-14T01:35:02.800Z","10.0.0-canary.b2faa116a.0":"2021-01-19T19:27:37.773Z","10.0.0-canary.0c95c9f7b.0":"2021-01-19T22:54:55.054Z","10.0.0-canary.5268222c4.0":"2021-01-20T19:20:25.296Z","10.0.0-canary.2ed2d829b.0":"2021-01-20T23:09:05.497Z","10.0.0-canary.df00c2b30.0":"2021-01-21T19:56:06.921Z","10.0.0-canary.fd61b0476.0":"2021-01-21T20:10:42.647Z","10.0.0-canary.3fb3a0265.0":"2021-01-22T00:05:57.217Z","10.0.0-canary.07deaec27.0":"2021-01-22T16:57:29.442Z","10.0.0-canary.d2959b16c.0":"2021-01-22T18:53:10.559Z","10.0.0-canary.75f3bfe7c.0":"2021-01-22T22:52:35.357Z","10.0.0-canary.b9adb7a0f.0":"2021-01-22T23:36:56.977Z","10.0.0-canary.d29ec2862.0":"2021-01-25T16:25:12.854Z","10.0.0-canary.96be07c68.0":"2021-01-26T00:11:15.211Z","10.0.0-canary.e383944e9.0":"2021-01-26T01:46:01.007Z","10.0.0-canary.623af861e.0":"2021-01-26T03:46:17.337Z","10.0.0-canary.6863fd43a.0":"2021-01-26T21:34:28.977Z","10.0.0-canary.ea55b87ca.0":"2021-01-26T23:47:13.766Z","10.0.0-canary.e902ff05f.0":"2021-01-27T00:05:20.782Z","10.0.0-canary.2c9fc538a.0":"2021-01-27T00:28:24.330Z","10.0.0-canary.6bf56aaa4.0":"2021-01-27T01:21:21.281Z","10.0.0-canary.994873795.0":"2021-01-27T14:52:08.447Z","10.0.0-canary.96878e1d0.0":"2021-01-27T18:03:31.062Z","10.0.0-canary.3c117cdcc.0":"2021-01-27T18:33:39.608Z","10.0.0-canary.b411e7033.0":"2021-01-27T22:04:48.437Z","10.0.0-canary.a9ac16b4a.0":"2021-01-27T23:04:45.752Z","10.0.0-canary.fec7b42ca.0":"2021-01-28T19:15:49.877Z","10.0.0-canary.8e66dbfee.0":"2021-02-01T23:21:34.945Z","10.0.0-canary.637d15da6.0":"2021-02-02T18:50:27.779Z","10.0.0-canary.fb793939e.0":"2021-02-02T23:44:10.955Z","10.0.0-canary.15a4d40dd.0":"2021-02-03T02:19:34.541Z","10.0.0-canary.7a003acf0.0":"2021-02-04T02:35:10.234Z","10.0.0-canary.05f249666.0":"2021-02-04T17:51:25.632Z","10.0.0-canary.1a3a39629.0":"2021-02-04T18:44:27.536Z","10.0.0-canary.8b1cdb1be.0":"2021-02-04T22:36:02.899Z","10.0.0-canary.8271f00f7.0":"2021-02-04T23:01:43.062Z","10.0.0-canary.533092a90.0":"2021-02-05T03:47:47.847Z","11.0.0-canary.633a9fc7a.0":"2021-02-05T16:18:46.939Z","10.0.0":"2021-02-05T16:20:05.611Z","11.0.0-canary.b5227247d.0":"2021-02-05T17:43:15.755Z","11.0.0-canary.95322b11e.0":"2021-02-05T23:32:45.046Z","11.0.0-canary.1f318ff0f.0":"2021-02-06T00:06:00.194Z","11.0.0-canary.ab12cf7a3.0":"2021-02-08T15:04:46.046Z","11.0.0-canary.98db2c5ec.0":"2021-02-08T15:35:53.361Z","11.0.0-canary.1f86b9f6d.0":"2021-02-08T17:18:35.678Z","11.0.0-canary.aac8f5d9a.0":"2021-02-08T18:01:33.796Z","11.0.0-canary.750e18fc7.0":"2021-02-08T21:42:23.362Z","11.0.0-canary.b62b1266d.0":"2021-02-09T21:53:50.139Z","11.0.0-canary.a6b3101fb.0":"2021-02-11T23:18:04.797Z","11.0.0-canary.ed88df700.0":"2021-02-12T00:08:01.824Z","11.0.0-canary.d30efe6b4.0":"2021-02-12T02:42:58.196Z","11.0.0-canary.0393bdc4b.0":"2021-02-12T04:32:01.531Z","11.0.0-canary.7cd26af4d.0":"2021-02-12T16:00:32.031Z","11.0.0-canary.71fe9a067.0":"2021-02-12T16:31:57.307Z","11.0.0-canary.0fd56a86b.0":"2021-02-13T00:12:48.486Z","11.0.0-canary.f19bbc4af.0":"2021-02-16T22:17:23.864Z","11.0.0-canary.f9cac96cc.0":"2021-02-17T16:11:05.203Z","11.0.0-canary.79ce0878b.0":"2021-02-17T19:26:10.942Z","11.0.0-canary.d6e507b5b.0":"2021-02-17T19:59:08.786Z","11.0.0-canary.f2658381b.0":"2021-02-17T22:45:53.276Z","11.0.0-canary.97c4d4035.0":"2021-02-18T02:36:03.547Z","11.0.0-canary.f5bb4648c.0":"2021-02-18T16:06:40.229Z","11.0.0-canary.302c7a960.0":"2021-02-18T18:39:22.611Z","11.0.0-canary.aa0aaf026.0":"2021-02-18T19:24:35.173Z","11.0.0-canary.07ff0c452.0":"2021-02-18T19:43:44.997Z","11.0.0-canary.bed7ecd3e.0":"2021-02-18T23:28:38.932Z","11.0.0-canary.06dead2d6.0":"2021-02-19T00:38:06.915Z","11.0.0-canary.cddb03553.0":"2021-02-19T03:14:11.623Z","11.0.0-canary.d6d8d0476.0":"2021-02-19T05:37:45.636Z","11.0.0-canary.0b4a4b2eb.0":"2021-02-19T15:46:52.473Z","11.0.0-canary.3201cae47.0":"2021-02-19T23:01:45.686Z","11.0.0-canary.f1b1fd5d3.0":"2021-02-22T19:50:27.853Z","11.0.0-canary.7899e0fe0.0":"2021-02-22T22:46:47.320Z","11.0.0-canary.f19c86d13.0":"2021-02-22T23:31:41.747Z","11.0.0-canary.60e892d79.0":"2021-02-23T01:15:17.343Z","11.0.0-canary.c96bfa495.0":"2021-02-23T19:34:17.080Z","11.0.0-canary.fa9b59f67.0":"2021-02-23T19:35:33.204Z","11.0.0-canary.869e3497c.0":"2021-02-23T19:36:00.541Z","11.0.0-canary.8ecd7c9a9.0":"2021-02-23T19:51:42.666Z","11.0.0-canary.9c85d505b.0":"2021-02-23T22:16:42.975Z","11.0.0-canary.9f2e85fb8.0":"2021-02-24T01:49:21.114Z","11.0.0-canary.19c4f29ef.0":"2021-02-25T19:23:32.952Z","11.0.0-canary.63df6e9bf.0":"2021-02-25T19:38:12.649Z","11.0.0-canary.981ad970a.0":"2021-02-26T00:09:00.413Z","11.0.0-canary.f9c9e39d6.0":"2021-02-26T18:39:52.120Z","11.0.0-canary.c97d7d881.0":"2021-03-01T20:54:09.431Z","11.0.0-canary.bf670dad7.0":"2021-03-03T00:22:09.237Z","11.0.0-canary.c7d98fcde.0":"2021-03-03T20:33:14.582Z","11.0.0-canary.4fef8bc1e.0":"2021-03-03T23:25:13.811Z","11.0.0-canary.afae3a3ec.0":"2021-03-03T23:43:10.174Z","11.0.0-canary.0a0b10f22.0":"2021-03-04T00:01:56.487Z","11.0.0-canary.6f678a91a.0":"2021-03-04T18:41:07.774Z","11.0.0-canary.f5f1b613c.0":"2021-03-04T20:50:28.391Z","11.0.0-canary.606e767ef.0":"2021-03-04T21:46:45.753Z","11.0.0-canary.f77a4dd1a.0":"2021-03-06T04:40:57.029Z","11.0.0-canary.2d6ba2c23.0":"2021-03-08T22:45:08.684Z","11.0.0-canary.7522dcaca.0":"2021-03-09T00:28:32.747Z","11.0.0-canary.5c0ab7401.0":"2021-03-09T22:53:23.133Z","11.0.0-canary.59010b6dc.0":"2021-03-10T16:58:27.793Z","11.0.0-canary.9e52f5544.0":"2021-03-10T23:26:04.972Z","11.0.0-canary.a678806f5.0":"2021-03-11T01:50:45.760Z","11.0.0-canary.b2d22df5b.0":"2021-03-11T17:03:46.700Z","11.0.0-canary.81911b707.0":"2021-03-11T18:24:18.634Z","11.0.0-canary.9eeb35c38.0":"2021-03-11T19:37:49.643Z","11.0.0-canary.12be3e95a.0":"2021-03-11T20:02:30.063Z","11.0.0-canary.e683bdf4a.0":"2021-03-11T20:10:03.063Z","11.0.0-canary.a07b6d486.0":"2021-03-11T20:34:20.342Z","11.0.0-canary.1e0653477.0":"2021-03-11T20:41:23.963Z","11.0.0-canary.148e8cfcc.0":"2021-03-11T22:45:17.608Z","11.0.0-canary.73a227194.0":"2021-03-12T00:25:05.877Z","11.0.0-canary.f8579b7ea.0":"2021-03-13T02:04:01.311Z","11.0.0-canary.d2a39d300.0":"2021-03-16T00:36:02.065Z","11.0.0-canary.7cf67823e.0":"2021-03-16T18:21:07.192Z","11.0.0-canary.67d780c79.0":"2021-03-16T19:48:52.945Z","11.0.0-canary.0f358ddae.0":"2021-03-16T22:13:26.354Z","11.0.0-canary.67eb0df80.0":"2021-03-16T22:40:37.056Z","11.0.0-canary.941ca3b3c.0":"2021-03-16T22:42:20.770Z","11.0.0-canary.3344d12ad.0":"2021-03-17T10:02:42.698Z","11.0.0-canary.6072ed604.0":"2021-03-17T23:00:25.184Z","11.0.0-canary.d3a6862af.0":"2021-03-18T16:20:58.203Z","11.0.0-canary.40dd242d5.0":"2021-03-18T21:18:07.430Z","11.0.0-canary.ec8f8465f.0":"2021-03-18T21:45:00.856Z","11.0.0-canary.da38969ec.0":"2021-03-18T22:18:43.858Z","11.0.0-canary.f5246264d.0":"2021-03-19T00:39:33.836Z","11.0.0-canary.03d34bbad.0":"2021-03-19T00:52:22.751Z","11.0.0-canary.cbc57c600.0":"2021-03-19T01:00:38.798Z","11.0.0-canary.d6c5bcf37.0":"2021-03-19T01:13:29.432Z","11.0.0-canary.fefc668d7.0":"2021-03-19T01:34:52.738Z","11.0.0-canary.faa7d3226.0":"2021-03-19T17:45:09.446Z","11.0.0-canary.c60449bc8.0":"2021-03-19T18:06:05.063Z","11.0.0-canary.5f0fc444a.0":"2021-03-19T18:38:35.843Z","11.0.0-canary.4567a750d.0":"2021-03-20T02:08:51.521Z","11.0.0-canary.0cde52f5a.0":"2021-03-23T00:03:49.977Z","11.0.0-canary.48f4b67fb.0":"2021-03-23T19:55:13.984Z","11.0.0-canary.0b8cff734.0":"2021-03-23T20:05:34.677Z","11.0.0-canary.8943b991f.0":"2021-03-23T20:30:36.846Z","11.0.0-canary.3955d8d3d.0":"2021-03-24T19:17:30.366Z","11.0.0-canary.23ea2d85e.0":"2021-03-25T17:33:45.132Z","11.0.0-canary.e3ec22f45.0":"2021-03-25T17:58:50.574Z","11.0.0-canary.4ceb42220.0":"2021-03-26T07:58:27.945Z","11.0.0-canary.dc9c84023.0":"2021-03-30T17:49:22.435Z","11.0.0-canary.56fc26962.0":"2021-03-31T00:21:37.882Z","11.0.0-canary.bc318250e.0":"2021-03-31T01:34:34.524Z","11.0.0-canary.edaee19aa.0":"2021-03-31T02:12:26.248Z","11.0.0-canary.24609b822.0":"2021-03-31T20:57:48.845Z","11.0.0-canary.b6cddc2b7.0":"2021-04-01T15:06:10.812Z","11.0.0-canary.94937c78c.0":"2021-04-01T21:01:47.285Z","11.0.0-canary.e7202cb57.0":"2021-04-01T22:48:08.330Z","11.0.0-canary.1f636b205.0":"2021-04-02T22:25:01.587Z","11.0.0-canary.94f50b260.0":"2021-04-05T15:05:56.831Z","11.0.0-canary.a4009b80a.0":"2021-04-05T22:01:21.973Z","11.0.0-canary.15604bd0d.0":"2021-04-05T22:43:00.997Z","11.0.0-canary.76da7876c.0":"2021-04-07T01:45:36.707Z","11.0.0-canary.6bcb6cbd2.0":"2021-04-07T18:54:45.783Z","11.0.0-canary.c91e8d141.0":"2021-04-07T18:58:44.229Z","11.0.0-canary.f77c50860.0":"2021-04-08T15:36:41.816Z","11.0.0-canary.367d88bdb.0":"2021-04-08T16:39:33.112Z","11.0.0-canary.0ec437d3b.0":"2021-04-08T19:36:13.280Z","11.0.0-canary.b2fa996a1.0":"2021-04-09T15:11:58.716Z","11.0.0-canary.24255c408.0":"2021-04-09T20:13:17.712Z","11.0.0-canary.7d6a4bb72.0":"2021-04-09T22:54:24.263Z","11.0.0-canary.352b295c1.0":"2021-04-12T18:16:30.381Z","11.0.0-canary.ab99b8064.0":"2021-04-13T14:44:19.820Z","11.0.0-canary.8f0a11e32.0":"2021-04-14T20:03:53.623Z","11.0.0-canary.f5c6db8fc.0":"2021-04-15T18:05:01.184Z","11.0.0-canary.3793a3143.0":"2021-04-15T18:32:14.944Z","11.0.0-canary.bc104bae7.0":"2021-04-15T19:47:06.079Z","12.0.0-canary.3f342c3f4.0":"2021-04-15T22:55:04.682Z","11.0.0":"2021-04-15T22:59:14.168Z","12.0.0-canary.2ebfc5374.0":"2021-04-16T20:45:57.659Z","12.0.0-canary.5631828e1.0":"2021-04-17T07:47:46.642Z","12.0.0-canary.bd685395b.0":"2021-04-19T18:42:08.593Z","12.0.0-canary.b52196498.0":"2021-04-19T19:58:41.881Z","12.0.0-canary.8ba3e298c.0":"2021-04-21T14:09:33.312Z","12.0.0-canary.c629eab71.0":"2021-04-21T19:58:02.649Z","12.0.0-canary.8ace3b810.0":"2021-04-21T20:38:47.043Z","12.0.0-canary.70beaf42d.0":"2021-04-21T20:50:19.366Z","12.0.0-canary.cad489689.0":"2021-04-22T16:50:21.987Z","12.0.0-canary.d928692b5.0":"2021-04-23T17:35:26.680Z","12.0.0-canary.8f68de8f3.0":"2021-04-23T18:14:08.295Z","12.0.0-canary.05753cf77.0":"2021-04-23T23:44:01.320Z","12.0.0-canary.ef43e6d96.0":"2021-04-23T23:50:22.468Z","12.0.0-canary.197f64fa2.0":"2021-04-26T17:10:49.846Z","12.0.0-canary.55ad2d7d8.0":"2021-04-27T01:20:47.100Z","12.0.0-canary.ec4ac5234.0":"2021-04-27T07:59:33.027Z","12.0.0-canary.b0579acdb.0":"2021-04-27T08:37:23.984Z","12.0.0-canary.81e2d4ff3.0":"2021-04-27T20:58:47.950Z","12.0.0-canary.c8edee52c.0":"2021-04-27T21:47:07.585Z","12.0.0-canary.f5b6110d6.0":"2021-04-27T22:08:18.676Z","12.0.0-canary.cee9b9e22.0":"2021-04-28T00:13:51.884Z","12.0.0-canary.96e83fca7.0":"2021-04-28T02:48:51.532Z","12.0.0-canary.4c497bd19.0":"2021-04-28T17:54:37.609Z","12.0.0-canary.105b15b96.0":"2021-04-28T21:45:46.201Z","12.0.0-canary.6e20259e3.0":"2021-04-28T21:50:11.607Z","12.0.0-canary.0f79a5d74.0":"2021-04-28T22:44:00.092Z","12.0.0-canary.84f3db9ed.0":"2021-04-29T14:19:01.443Z","12.0.0-canary.8fc29273c.0":"2021-04-29T21:24:43.632Z","12.0.0-canary.c50d20bab.0":"2021-04-29T23:02:54.010Z","12.0.0-canary.474836ad0.0":"2021-05-01T03:38:39.784Z","12.0.0-canary.f5ad92287.0":"2021-05-03T18:23:16.321Z","12.0.0-canary.af453daf8.0":"2021-05-03T18:54:34.193Z","12.0.0-canary.1f1918c24.0":"2021-05-03T19:23:39.493Z","12.0.0-canary.33148231f.0":"2021-05-03T19:39:44.748Z","12.0.0-canary.06b76fa74.0":"2021-05-03T19:46:47.640Z","12.0.0-canary.7c5000473.0":"2021-05-03T22:42:37.700Z","12.0.0-canary.de997644b.0":"2021-05-04T17:29:14.805Z","12.0.0-canary.d4d7f1cc2.0":"2021-05-04T17:56:09.644Z","12.0.0-canary.be999eb08.0":"2021-05-04T18:01:18.306Z","12.0.0-canary.eda1705fc.0":"2021-05-04T19:11:27.008Z","12.0.0-canary.718c90178.0":"2021-05-04T19:28:45.918Z","12.0.0-canary.0e3917299.0":"2021-05-04T19:31:29.424Z","12.0.0-canary.836b3c7db.0":"2021-05-04T20:34:54.153Z","12.0.0-canary.53d4e6d59.0":"2021-05-04T20:50:36.324Z","12.0.0-canary.18d147e27.0":"2021-05-04T20:59:03.266Z","12.0.0-canary.b9984794e.0":"2021-05-04T23:04:03.466Z","12.0.0-canary.b76f5fc9d.0":"2021-05-04T23:07:33.353Z","12.0.0-canary.055d4f10a.0":"2021-05-04T23:22:46.345Z","12.0.0-canary.5b6a46016.0":"2021-05-05T16:17:21.943Z","12.0.0-canary.33c9a737a.0":"2021-05-05T17:28:17.023Z","12.0.0-canary.9bc0effaf.0":"2021-05-05T21:01:03.396Z","12.0.0-canary.a1e0f2af5.0":"2021-05-05T21:42:04.166Z","12.0.0-canary.06930c96b.0":"2021-05-05T23:40:10.828Z","12.0.0-canary.03f525f9f.0":"2021-05-06T00:31:06.929Z","12.0.0-canary.e82ba2a26.0":"2021-05-06T15:57:34.096Z","12.0.0-canary.fc7c4e5ce.0":"2021-05-06T17:30:26.920Z","12.0.0-canary.65c04514d.0":"2021-05-06T18:44:41.961Z","12.0.0-canary.c97779ca6.0":"2021-05-06T21:44:16.229Z","12.0.0-canary.869d890d4.0":"2021-05-07T15:19:46.911Z","12.0.0-canary.ec22e1da9.0":"2021-05-10T18:24:29.788Z","12.0.0-nightly.7427449f0.0":"2021-05-10T18:45:13.080Z","12.0.0-canary.957cc3bf5.0":"2021-05-10T21:57:50.463Z","12.0.0-canary.88a33cd70.0":"2021-05-11T00:09:57.026Z","12.0.0-canary.d20dc6dba.0":"2021-05-11T00:25:42.556Z","12.0.0-canary.0ce2fdb02.0":"2021-05-11T00:59:38.873Z","12.0.0-canary.cb162da37.0":"2021-05-11T01:59:40.289Z","12.0.0-canary.573dc7ffd.0":"2021-05-11T02:18:31.003Z","12.0.0-canary.d5f6ad3fe.0":"2021-05-11T23:23:32.496Z","12.0.0-canary.25751d2ed.0":"2021-05-12T16:20:57.265Z","12.0.0-canary.a23ecb682.0":"2021-05-12T18:24:14.750Z","12.0.0-canary.33a954852.0":"2021-05-13T15:08:47.063Z","12.0.0-canary.a4484849b.0":"2021-05-13T15:32:07.554Z","12.0.0-canary.b4c3f513e.0":"2021-05-13T16:08:57.532Z","12.0.0-canary.1a8d06483.0":"2021-05-13T16:14:47.954Z","12.0.0-canary.8e6081836.0":"2021-05-14T21:41:39.417Z","12.0.0-canary.a2b0f4cee.0":"2021-05-14T21:54:58.352Z","12.0.0-canary.e8e39ad19.0":"2021-05-18T20:14:08.963Z","12.0.0-canary.4bb5eea2b.0":"2021-05-19T15:29:22.232Z","12.0.0-canary.ccce99cd6.0":"2021-05-20T00:57:48.832Z","12.0.0-canary.14767a8db.0":"2021-05-20T20:51:57.787Z","12.0.0-canary.22c6dcff9.0":"2021-05-24T15:19:38.550Z","12.0.0-canary.fadab3372.0":"2021-05-24T16:06:54.263Z","12.0.0-canary.caa73aeee.0":"2021-05-25T14:15:27.337Z","12.0.0-canary.ec31ae1ed.0":"2021-05-25T20:36:28.796Z","12.0.0-canary.8530d3514.0":"2021-05-27T16:05:57.058Z","12.0.0-canary.00b5899dc.0":"2021-06-01T22:46:35.616Z","12.0.0-canary.f1525ea3e.0":"2021-06-03T13:55:26.765Z","12.0.0-canary.464a00286.0":"2021-06-03T14:47:13.057Z","12.0.0-canary.474de7878.0":"2021-06-03T15:15:13.297Z","12.0.0-canary.b87ebf74d.0":"2021-06-03T17:47:17.362Z","12.0.0-canary.2daa49b35.0":"2021-06-04T16:15:09.343Z","12.0.0-canary.08db3d737.0":"2021-06-04T19:42:34.690Z","12.0.0-canary.5823407a7.0":"2021-06-08T00:49:27.078Z","12.0.0-canary.23b0c5e22.0":"2021-06-08T16:23:13.803Z","12.0.0-canary.2952c6a76.0":"2021-06-08T17:41:51.452Z","12.0.0-canary.f12425f88.0":"2021-06-10T01:07:18.434Z","12.0.0-canary.e543628c3.0":"2021-06-10T01:08:20.804Z","12.0.0-canary.e0c346286.0":"2021-06-10T16:36:46.195Z","12.0.0-canary.f43af5633.0":"2021-06-10T20:36:43.155Z","12.0.0-canary.8415ae585.0":"2021-06-11T16:06:51.774Z","12.0.0-canary.598fcccc8.0":"2021-06-11T21:47:17.151Z","12.0.0-canary.5d0605188.0":"2021-06-14T17:40:16.730Z","12.0.0-canary.f147a2271.0":"2021-06-14T19:19:09.029Z","12.0.0-canary.33579e00b.0":"2021-06-15T00:22:59.462Z","12.0.0-canary.a6909c0e6.0":"2021-06-15T18:30:59.709Z","12.0.0-canary.c18b5925b.0":"2021-06-15T21:04:35.998Z","12.0.0-canary.271fff902.0":"2021-06-15T22:52:02.064Z","12.0.0-canary.7ea2e830d.0":"2021-06-15T22:53:06.888Z","12.0.0-canary.d96f0a1e0.0":"2021-06-16T21:07:22.274Z","12.0.0-canary.a6183801a.0":"2021-06-16T22:06:28.700Z","12.0.0-canary.940550232.0":"2021-06-17T19:41:14.878Z","12.0.0-canary.f705e8048.0":"2021-06-18T15:25:31.461Z","12.0.0-canary.08d791f37.0":"2021-06-18T21:12:41.914Z","12.0.0-canary.e38d7440f.0":"2021-06-21T17:41:35.144Z","12.0.0-canary.75900a5a9.0":"2021-06-21T18:38:03.539Z","12.0.0-canary.33e6f50e9.0":"2021-06-23T00:13:03.258Z","12.0.0-canary.8c685301d.0":"2021-06-23T18:25:35.146Z","12.0.0-canary.8c7d994ae.0":"2021-06-23T19:28:24.450Z","12.0.0-canary.4ccd39bdd.0":"2021-06-24T16:15:55.966Z","12.0.0-canary.17553e9f8.0":"2021-06-28T22:53:32.154Z","12.0.0-canary.4c80072fd.0":"2021-06-29T18:41:57.470Z","12.0.0-canary.796811db7.0":"2021-07-01T00:04:21.498Z","12.0.0-canary.70e1efdca.0":"2021-07-01T17:07:35.017Z","12.0.0-canary.435866d32.0":"2021-07-02T18:22:11.569Z","12.0.0-canary.d0f9f3f2e.0":"2021-07-03T00:01:04.142Z","12.0.0-canary.adeac0549.0":"2021-07-08T15:10:31.332Z","12.0.0-canary.068fd5028.0":"2021-07-08T19:04:49.536Z","12.0.0-canary.5dfec7a14.0":"2021-07-12T20:05:08.355Z","12.0.0-canary.07a73750c.0":"2021-07-12T20:26:30.277Z","12.0.0-canary.3e4c6dca1.0":"2021-07-13T01:52:27.833Z","12.0.0-canary.ea77795b1.0":"2021-07-13T15:50:28.077Z","12.0.0-canary.15a179fad.0":"2021-07-13T18:10:35.739Z","12.0.0-canary.c73142a1b.0":"2021-07-13T18:45:21.951Z","12.0.0-canary.d923db73a.0":"2021-07-13T20:54:58.880Z","12.0.0-canary.22d29cbb4.0":"2021-07-13T22:51:44.461Z","12.0.0-canary.2749604bc.0":"2021-07-14T16:23:33.105Z","12.0.0-canary.e1703bed9.0":"2021-07-14T21:49:10.829Z","12.0.0-canary.de48eff0d.0":"2021-07-15T17:09:13.859Z","12.0.0-canary.4f060adc5.0":"2021-07-15T19:22:56.836Z","12.0.0-canary.bd25779b2.0":"2021-07-15T20:43:21.161Z","12.0.0-canary.9f68a932e.0":"2021-07-15T22:08:07.339Z","12.0.0-canary.4eecdeaf0.0":"2021-07-16T14:59:04.313Z","12.0.0-canary.7239684d4.0":"2021-07-16T16:00:08.145Z","12.0.0-canary.d5f1f7c72.0":"2021-07-16T16:14:56.283Z","12.0.0-canary.4d95812f9.0":"2021-07-16T19:44:09.138Z","12.0.0-canary.38d1846cc.0":"2021-07-19T18:43:05.865Z","12.0.0-canary.3f691eccf.0":"2021-07-20T16:10:07.164Z","12.0.0-canary.ebb5c73bb.0":"2021-07-20T16:57:55.665Z","12.0.0-nightly.778a0e8a.0":"2021-07-20T21:06:31.829Z","12.0.0-canary.791311bba.0":"2021-07-20T22:08:35.652Z","12.0.0-canary.85e9a6ac3.0":"2021-07-21T15:37:05.803Z","12.0.0-canary.6b0442278.0":"2021-07-21T18:50:57.422Z","12.0.0-canary.5f00e454a.0":"2021-07-22T17:07:26.716Z","12.0.0-canary.90e08fc6b.0":"2021-07-22T23:39:16.696Z","12.0.0-canary.cf5b9eb86.0":"2021-07-23T18:13:15.599Z","12.0.0-canary.3f36ac75c.0":"2021-07-23T18:33:13.679Z","12.0.0-canary.ea1e1b850.0":"2021-07-24T20:56:48.992Z","12.0.0-canary.22f390c43.0":"2021-07-27T19:00:56.093Z","12.0.0":"2021-07-27T19:51:03.378Z","13.0.0-canary.ae85f7eba.0":"2021-07-27T19:52:33.295Z","13.0.0-canary.5981207f7.0":"2021-07-27T23:19:14.477Z","13.0.0-canary.83bdd0222.0":"2021-07-28T17:26:56.337Z","13.0.0-canary.28656298a.0":"2021-07-29T18:14:01.283Z","13.0.0-canary.9e797daaf.0":"2021-07-29T18:36:16.792Z","13.0.0-canary.adb9f1ad8.0":"2021-07-30T19:06:06.964Z","13.0.0-canary.cc5377458.0":"2021-07-30T21:34:25.372Z","13.0.0-canary.a395972cf.0":"2021-08-03T21:24:24.179Z","13.0.0-canary.7c96e6b98.0":"2021-08-03T22:14:53.961Z","13.0.0-canary.a80c8b2c2.0":"2021-08-05T00:00:51.049Z","13.0.0-canary.3dd611091.0":"2021-08-05T03:57:32.572Z","13.0.0-canary.5dee37ff6.0":"2021-08-05T17:43:23.737Z","13.0.0-canary.bf405d22a.0":"2021-08-05T20:19:09.954Z","13.0.0-canary.b47dd37a6.0":"2021-08-05T20:51:00.174Z","13.0.0-canary.6c82b965b.0":"2021-08-06T16:15:54.777Z","13.0.0-canary.4ca11fe76.0":"2021-08-06T17:08:30.155Z","13.0.0-canary.510cf90f2.0":"2021-08-09T17:18:25.614Z","13.0.0-canary.17580ebf7.0":"2021-08-09T18:18:43.110Z","13.0.0-canary.7249a3060.0":"2021-08-09T18:22:35.359Z","13.0.0-canary.4c405863b.0":"2021-08-10T17:41:57.026Z","13.0.0-canary.f4241a42a.0":"2021-08-11T17:00:39.108Z","13.0.0-canary.0ad12ed3c.0":"2021-08-11T21:29:50.550Z","13.0.0-canary.077dcfcfe.0":"2021-08-12T17:56:18.155Z","13.0.0-canary.e3346766f.0":"2021-08-13T19:46:23.087Z","13.0.0-canary.2fb068fb0.0":"2021-08-13T19:49:33.069Z","13.0.0-canary.fb76c5069.0":"2021-08-16T20:09:11.633Z","13.0.0-canary.457d89aad.0":"2021-08-17T15:22:57.197Z","13.0.0-canary.0de2f2edc.0":"2021-08-17T20:55:15.761Z","13.0.0-canary.1f9259b9d.0":"2021-08-17T22:15:16.960Z","13.0.0-canary.3b9290351.0":"2021-08-18T05:25:09.788Z","13.0.0-canary.43d2eed2a.0":"2021-08-18T16:03:18.350Z","13.0.0-canary.0a9069300.0":"2021-08-19T16:18:49.915Z","13.0.0-canary.7da413ed8.0":"2021-08-20T15:49:57.646Z","13.0.0-canary.e1e69fd8e.0":"2021-08-20T19:33:19.888Z","13.0.0-canary.f5afc16df.0":"2021-08-20T20:27:42.495Z","13.0.0-canary.28d0d75bb.0":"2021-08-20T22:21:21.485Z","13.0.0-canary.21ece5360.0":"2021-08-20T23:45:20.980Z","13.0.0-canary.8de07c02a.0":"2021-08-23T15:27:42.616Z","13.0.0-canary.65aa63b0c.0":"2021-08-24T15:29:47.614Z","13.0.0-canary.15981e9d9.0":"2021-08-24T16:18:11.190Z","13.0.0-canary.fa7520f62.0":"2021-08-24T22:28:57.637Z","13.0.0-canary.ce25bc3ec.0":"2021-08-24T22:49:32.197Z","13.0.0-canary.12f5622e1.0":"2021-08-24T23:19:12.972Z","13.0.0-canary.d97f8f133.0":"2021-08-25T18:34:15.729Z","13.0.0-canary.d86fb6fac.0":"2021-08-25T18:54:50.726Z","13.0.0-canary.e8554dbbf.0":"2021-08-25T22:00:27.317Z","13.0.0-canary.877e3fb0d.0":"2021-08-26T15:39:20.465Z","13.0.0-canary.6236f3576.0":"2021-08-26T16:07:02.431Z","13.0.0-canary.1d19158a1.0":"2021-08-26T17:10:18.950Z","13.0.0-canary.6adc9e83f.0":"2021-08-30T22:45:24.803Z","13.0.0-canary.d082790f0.0":"2021-09-01T21:55:22.512Z","13.0.0-canary.e2c4f0196.0":"2021-09-02T02:12:28.663Z","13.0.0-canary.611db508e.0":"2021-09-02T03:16:21.571Z","13.0.0-canary.d4706933f.0":"2021-09-02T15:38:49.659Z","13.0.0-canary.c16fe03ce.0":"2021-09-02T17:45:50.751Z","13.0.0-canary.9203a958a.0":"2021-09-02T23:47:01.521Z","13.0.0-canary.fddd5ae93.0":"2021-09-03T07:30:38.633Z","13.0.0-canary.117599a8b.0":"2021-09-03T07:32:14.925Z","13.0.0-canary.e4180d07b.0":"2021-09-03T07:32:45.228Z","13.0.0-canary.42d175efc.0":"2021-09-03T15:43:29.262Z","13.0.0-canary.72464476c.0":"2021-09-07T15:34:51.081Z","13.0.0-canary.37d4db866.0":"2021-09-09T14:34:08.034Z","13.0.0-canary.6df682e74.0":"2021-09-09T15:43:48.782Z","13.0.0-canary.b49359c35.0":"2021-09-09T17:36:06.497Z","13.0.0-canary.470bd34e8.0":"2021-09-09T18:01:24.065Z","13.0.0-canary.d48a01771.0":"2021-09-09T18:10:58.398Z","13.0.0-canary.13db34b34.0":"2021-09-09T18:25:59.556Z","13.0.0-canary.864798678.0":"2021-09-09T18:37:26.827Z","13.0.0-canary.d04bda3fb.0":"2021-09-10T15:22:17.969Z","13.0.0-canary.5533f73d3.0":"2021-09-13T23:04:15.121Z","13.0.0-canary.08398f880.0":"2021-09-13T23:34:55.422Z","13.0.0-canary.818f4ee93.0":"2021-09-15T17:50:55.699Z","13.0.0-canary.8355e14dc.0":"2021-09-15T19:12:54.063Z","13.0.0-canary.d4e16a6c4.0":"2021-09-15T21:59:38.990Z","13.0.0-canary.65125b3a6.0":"2021-09-16T21:17:57.206Z","13.0.0-canary.80a583365.0":"2021-09-17T20:36:06.579Z","13.0.0-canary.83900936a.0":"2021-09-17T23:24:37.443Z","13.0.0-canary.860ad06a1.0":"2021-09-17T23:35:59.680Z","13.0.0-canary.3b8d4429e.0":"2021-09-20T17:47:52.167Z","13.0.0-canary.2da3606b9.0":"2021-09-20T19:37:59.018Z","13.0.0-canary.e8c598d1e.0":"2021-09-20T21:12:10.136Z","13.0.0-canary.1340ee9f7.0":"2021-09-22T17:57:54.542Z","13.0.0-canary.65084baff.0":"2021-09-23T21:25:28.223Z","13.0.0-canary.c79aa0cdd.0":"2021-09-24T13:41:54.477Z","13.0.0":"2021-09-24T19:46:09.554Z","14.0.0-canary.198431fcd.0":"2021-09-24T19:46:53.175Z","14.0.0-canary.9a02b6ef8.0":"2021-09-25T13:11:01.322Z","14.0.0-canary.758ce31d9.0":"2021-09-27T17:29:14.636Z","14.0.0-canary.86b50ef74.0":"2021-09-28T17:43:02.140Z","14.0.0-canary.b2fe3528b.0":"2021-09-29T22:57:11.588Z","14.0.0-canary.586e740dd.0":"2021-09-30T16:31:35.953Z","14.0.0-canary.2ac92d766.0":"2021-10-05T19:28:32.774Z","14.0.0-canary.353ca7e9f.0":"2021-10-08T18:47:13.045Z","14.0.0-canary.c78ff0429.0":"2021-10-11T17:22:04.023Z","14.0.0-canary.261f2db59.0":"2021-10-20T16:59:39.080Z","14.0.0-canary.9803d2dc1.0":"2021-10-20T19:22:09.191Z","14.0.0-canary.348665978.0":"2021-10-21T14:51:03.263Z","14.0.0-canary.b2b979a8a.0":"2021-10-28T15:12:39.107Z","14.0.0-canary.1af7c1c4a.0":"2021-10-28T17:52:48.980Z","14.0.0-canary.4afd353cd.0":"2021-10-29T15:01:34.565Z","14.0.0-canary.a986df922.0":"2021-10-29T21:35:03.210Z","14.0.0-canary.c3cdff07b.0":"2021-11-09T19:05:55.330Z","14.0.0-canary.468392606.0":"2021-11-11T19:40:25.695Z","14.0.0-canary.828f9803b.0":"2021-11-11T19:51:07.696Z","14.0.0-canary.8795cba87.0":"2021-11-11T19:57:03.693Z","14.0.0-canary.cd7f8cace.0":"2021-11-11T19:58:48.854Z","14.0.0-canary.207230eb8.0":"2021-11-11T22:24:28.944Z","14.0.0-canary.991fb99f7.0":"2021-11-11T22:36:44.332Z","14.0.0-canary.15db4f164.0":"2021-11-12T17:30:05.342Z","14.0.0-canary.8fcad5a3c.0":"2021-11-12T19:13:50.579Z","14.0.0-canary.f81fb1d23.0":"2021-11-12T22:40:34.580Z","14.0.0-canary.783f6fd5a.0":"2021-11-16T05:50:28.111Z","14.0.0-canary.d57ec74c7.0":"2021-11-16T16:17:01.407Z","14.0.0-canary.554c71829.0":"2021-11-16T16:19:50.582Z","14.0.0-canary.3ef470efe.0":"2021-11-16T16:24:39.841Z","14.0.0-canary.61a28b2b5.0":"2021-11-17T18:59:43.483Z","14.0.0-canary.fae6c652d.0":"2021-11-18T16:25:27.980Z","14.0.0-canary.978a3b5bb.0":"2021-11-19T19:39:48.139Z","14.0.0-canary.e6f43cf44.0":"2021-11-22T17:35:39.204Z","14.0.0-canary.39cf14bc3.0":"2021-11-22T23:05:02.312Z","14.0.0-canary.93134d453.0":"2021-11-23T15:39:46.032Z","14.0.0-canary.bbd11268f.0":"2021-11-23T22:32:46.890Z","14.0.0-canary.3db9c4d3d.0":"2021-11-24T15:37:53.128Z","14.0.0-canary.78305b6d5.0":"2021-11-24T19:51:09.009Z","14.0.0-canary.43d08ba77.0":"2021-11-30T22:56:32.690Z","14.0.0-canary.17a072535.0":"2021-12-02T18:05:46.425Z","14.0.0-canary.5d809696c.0":"2021-12-08T17:44:55.367Z","14.0.0-canary.b6510c8c1.0":"2021-12-08T18:07:08.753Z","14.0.0-canary.f460e23da.0":"2021-12-10T15:25:54.395Z","14.0.0-canary.7d8ea4624.0":"2021-12-10T19:29:21.972Z","14.0.0-canary.8fffcb5dd.0":"2021-12-14T08:55:38.183Z","14.0.0-canary.21e1cb9be.0":"2021-12-14T19:40:21.046Z","14.0.0-canary.ba78e8724.0":"2021-12-15T22:13:29.360Z","14.0.0-canary.e3e073c00.0":"2021-12-20T21:10:12.894Z","14.0.0-canary.3366a71d7.0":"2021-12-22T12:32:34.760Z","14.0.0-canary.c047f7c19.0":"2022-01-05T16:46:23.384Z","14.0.0-canary.05db65ec0.0":"2022-01-06T17:14:44.178Z","14.0.0-canary.6ca8b8f85.0":"2022-01-07T16:01:19.297Z","14.0.0-canary.173ee7a7a.0":"2022-01-10T16:54:49.695Z","14.0.0-canary.b704e4dfc.0":"2022-01-10T18:33:34.769Z","14.0.0-canary.c14e977ee.0":"2022-01-11T15:50:13.437Z","14.0.0-canary.b094eaa4e.0":"2022-01-14T18:42:53.309Z","14.0.0-canary.390220e42.0":"2022-01-17T16:46:44.366Z","14.0.0-canary.4b5391f8b.0":"2022-01-19T23:53:17.611Z","14.0.0-canary.cef6bc623.0":"2022-01-20T00:18:01.271Z","14.0.0-canary.0379179c4.0":"2022-01-20T18:54:54.528Z","14.0.0-canary.e62f3dabf.0":"2022-01-21T23:03:54.131Z","14.0.0-canary.3e20c1de8.0":"2022-01-25T15:32:29.337Z","14.0.0-canary.9f9d928b2.0":"2022-01-27T18:13:42.186Z","14.0.0-canary.a2bcb065c.0":"2022-01-28T19:37:35.874Z","14.0.0-canary.4e66fb2e1.0":"2022-01-28T19:41:55.441Z","14.0.0-canary.9736ddce9.0":"2022-01-29T09:50:25.173Z","14.0.0-canary.cc4ed13cc.0":"2022-02-04T18:23:16.206Z","14.0.0-canary.dcba26fe1.0":"2022-02-04T21:57:44.653Z","14.0.0-canary.ec54d9046.0":"2022-02-07T15:47:18.328Z","14.0.0-canary.ea9b5b463.0":"2022-02-09T17:54:14.960Z","14.0.0-canary.96ea061c1.0":"2022-02-09T18:59:21.480Z","14.0.0-canary.e00181e59.0":"2022-02-10T20:07:02.596Z","14.0.0-canary.037285f9b.0":"2022-02-11T18:30:01.769Z","14.0.0-canary.1aaa68dda.0":"2022-02-16T19:49:30.604Z","14.0.0-canary.ab4aba1af.0":"2022-02-17T18:16:45.982Z","14.0.0-canary.e58552c6e.0":"2022-02-18T18:04:32.900Z","14.0.0-canary.868793776.0":"2022-02-22T19:35:58.054Z","14.0.0-canary.fdc37a445.0":"2022-02-28T18:46:32.995Z","14.0.0-canary.43c7d87dc.0":"2022-03-01T15:33:33.881Z","14.0.0-canary.23043acd0.0":"2022-03-02T20:27:47.989Z","14.0.0-canary.6505e61c5.0":"2022-03-03T20:01:03.331Z","14.0.0-canary.16c166154.0":"2022-03-08T23:22:44.849Z","14.0.0-canary.bdf1d3771.0":"2022-03-14T14:28:59.563Z","14.0.0-canary.cf4292778.0":"2022-03-15T00:29:57.907Z","14.0.0-canary.bbd43e0e0.0":"2022-03-16T20:50:26.599Z","14.0.0-canary.1b6afad86.0":"2022-03-16T21:03:58.184Z","14.0.0-canary.bdf9d4af9.0":"2022-03-16T21:18:13.931Z","14.0.0-canary.32b391398.0":"2022-03-17T17:59:36.438Z","14.0.0-canary.ae8a6a3a3.0":"2022-03-18T16:39:36.105Z","14.0.0-canary.cbd9358a6.0":"2022-03-18T22:52:22.353Z","14.0.0-canary.dcfe49c98.0":"2022-03-21T18:44:26.710Z","14.0.0-canary.f31a833fa.0":"2022-03-23T00:51:10.480Z","14.0.0-canary.4b92e210a.0":"2022-03-24T20:18:55.972Z","14.0.0-canary.a657abb61.0":"2022-03-24T20:40:18.254Z","14.0.0-canary.443f63f50.0":"2022-03-25T23:04:57.782Z","14.0.0-canary.eb382f318.0":"2022-03-29T17:35:18.056Z","14.0.0-canary.344d52823.0":"2022-03-29T18:43:37.982Z","14.0.0-canary.4e372fb49.0":"2022-04-07T20:33:19.069Z","14.0.0-canary.3e30054fb.0":"2022-04-13T22:14:38.005Z","14.0.0-canary.8c4da223a.0":"2022-04-19T15:24:34.924Z","14.0.0-canary.7de8965cc.0":"2022-04-19T20:23:46.022Z","14.0.0-canary.641ed0851.0":"2022-04-20T16:06:06.358Z","14.0.0-canary.e88f83024.0":"2022-04-20T17:48:04.697Z","14.0.0-canary.7321d6254.0":"2022-04-20T20:11:42.162Z","14.0.0-canary.3ab956515.0":"2022-04-25T15:02:16.376Z","14.0.0-canary.53b3cad2f.0":"2022-04-27T12:45:45.659Z","14.0.0":"2022-04-28T16:56:19.883Z","15.0.0-canary.432c815e5.0":"2022-04-28T16:57:25.337Z","15.0.0-canary.a0f01f669.0":"2022-05-06T20:15:03.143Z","15.0.0-canary.276cb39a4.0":"2022-05-06T21:31:54.627Z","15.0.0-canary.4fe98ed70.0":"2022-05-06T21:56:24.774Z","15.0.0-canary.58b130a3d.0":"2022-05-06T21:58:44.408Z","15.0.0-canary.ae278a2fe.0":"2022-05-09T15:24:55.241Z","15.0.0-canary.bebf5bfdf.0":"2022-05-11T02:40:44.223Z","15.0.0-canary.e6072cd6a.0":"2022-05-11T20:18:51.772Z","15.0.0-canary.5b40eb988.0":"2022-05-12T02:44:38.167Z","15.0.0-canary.6a61d62f6.0":"2022-05-12T20:27:16.874Z","15.0.0-canary.05930a453.0":"2022-05-13T18:47:52.788Z","15.0.0-canary.c0a11ef0d.0":"2022-05-18T22:01:24.724Z","15.0.0-canary.2f9b268c0.0":"2022-05-20T19:33:06.934Z","15.0.0-canary.7741345b8.0":"2022-05-20T20:03:09.502Z","15.0.0-canary.f807e793f.0":"2022-05-20T22:21:54.845Z","15.0.0-canary.9f53d4a8a.0":"2022-05-23T14:58:09.775Z","15.0.0-canary.77cf00e37.0":"2022-05-31T17:40:28.353Z","15.0.0-canary.3c7b844c2.0":"2022-06-07T22:21:28.357Z","15.0.0-canary.df47894db.0":"2022-06-13T17:08:57.201Z","15.0.0-canary.b18a873dc.0":"2022-06-14T06:30:08.699Z","15.0.0-canary.ba9c29637.0":"2022-06-14T18:57:46.416Z","15.0.0-canary.9bfd12f01.0":"2022-06-22T19:22:55.124Z","15.0.0-canary.764de225d.0":"2022-06-29T16:27:27.386Z","15.0.0-canary.31e517cea.0":"2022-07-01T18:28:46.013Z","15.0.0-canary.9ea4e8e9c.0":"2022-07-01T22:55:21.675Z","15.0.0-canary.cd5bafabb.0":"2022-07-06T17:54:46.959Z","15.0.0-canary.a02fe49d3.0":"2022-07-06T18:51:27.205Z","15.0.0-canary.826a3d8be.0":"2022-07-06T19:31:25.482Z","15.0.0-canary.ef276aa93.0":"2022-07-07T17:03:02.053Z","15.0.0-canary.59cf61d6b.0":"2022-07-07T17:31:47.410Z","15.0.0-canary.8647092f7.0":"2022-07-07T20:39:02.359Z","15.0.0-canary.02ecd4d85.0":"2022-07-11T16:39:40.844Z","15.0.0-canary.63d3a146e.0":"2022-07-12T11:37:15.200Z","15.0.0-canary.88db01990.0":"2022-07-12T11:40:26.204Z","15.0.0-canary.6432d8fd7.0":"2022-07-14T07:29:20.428Z","15.0.0-canary.085f9b25c.0":"2022-07-14T16:35:21.462Z","15.0.0-canary.39f9424b3.0":"2022-07-14T17:05:39.404Z","15.0.0-canary.ae9fce587.0":"2022-07-14T18:08:32.899Z","15.0.0-canary.1ebddc343.0":"2022-07-15T08:49:44.957Z","15.0.0-canary.c5018840c.0":"2022-07-18T09:43:33.707Z","15.0.0-canary.551b40d18.0":"2022-07-18T10:01:28.438Z","15.0.0-canary.cf9f12371.0":"2022-07-18T10:05:28.412Z","15.0.0-canary.2797ff8b6.0":"2022-07-19T00:24:34.807Z","15.0.0-canary.110fafa17.0":"2022-07-20T07:47:05.542Z","15.0.0-canary.386ef1d2f.0":"2022-07-20T18:20:11.751Z","15.0.0-canary.c3924efef.0":"2022-07-20T18:31:14.070Z","15.0.0-canary.cf5c5907c.0":"2022-07-20T21:23:18.952Z","15.0.0-canary.0617e2319.0":"2022-07-20T21:41:41.099Z","15.0.0-canary.a743b7967.0":"2022-07-20T21:58:34.447Z","15.0.0-canary.69fd619d0.0":"2022-07-20T22:10:45.225Z","15.0.0-canary.2a6ddc1cf.0":"2022-07-29T16:06:13.719Z","15.0.0-canary.86efd56f6.0":"2022-08-02T14:47:18.831Z","15.0.0-canary.ccfc24d19.0":"2022-08-03T18:15:03.123Z","15.0.0-canary.e4570146f.0":"2022-08-03T18:42:23.603Z","15.0.0-canary.6683a36cb.0":"2022-08-03T19:22:22.038Z","15.0.0-canary.10196647d.0":"2022-08-03T21:55:17.690Z","15.0.0-canary.b20d3d73c.0":"2022-08-04T22:44:23.444Z","15.0.0-canary.47c0c6b1e.0":"2022-08-09T15:22:31.541Z","15.0.0-canary.0e3dc8e38.0":"2022-08-11T18:47:24.728Z","15.0.0-canary.d5a11f1c8.0":"2022-08-30T23:02:46.779Z","15.0.0-canary.bac992a95.0":"2022-09-01T07:07:19.775Z","15.0.0-canary.920d8a79e.0":"2022-09-01T20:22:28.076Z","15.0.0-canary.c363f267b.0":"2022-09-01T21:19:47.414Z","15.0.0-canary.a4eb4937a.0":"2022-09-06T18:21:23.118Z","15.0.0-canary.4299717da.0":"2022-09-07T16:17:18.709Z","15.0.0-canary.fa7d8d44b.0":"2022-09-07T19:20:33.714Z","15.0.0-canary.a40e3c768.0":"2022-09-09T20:05:23.177Z","15.0.0-canary.7ab3cd3c8.0":"2022-09-13T22:40:40.503Z","15.0.0-canary.2860d244d.0":"2022-09-16T22:56:19.292Z","15.0.0-canary.e8726533c.0":"2022-09-20T20:19:10.301Z","15.0.0-canary.00d8de0aa.0":"2022-09-21T15:21:58.059Z","15.0.0-canary.271aedc30.0":"2022-09-21T15:37:45.458Z","15.0.0-canary.d3344c16f.0":"2022-09-22T09:26:07.207Z","15.0.0-canary.94f20ccb8.0":"2022-09-22T20:49:20.183Z","15.0.0-canary.81e4cb7b2.0":"2022-09-23T15:09:51.816Z","15.0.0-canary.aa85f9413.0":"2022-09-26T17:57:58.578Z","15.0.0-canary.7134a7752.0":"2022-09-26T21:59:05.049Z","15.0.0-canary.70b8ac16e.0":"2022-09-27T22:46:18.439Z","15.0.0-canary.c20d74405.0":"2022-09-27T23:32:39.661Z","15.0.0-canary.f033fc8d1.0":"2022-09-27T23:58:55.804Z","15.0.0-canary.8d7ae912a.0":"2022-09-28T07:57:31.243Z","15.0.0-canary.db414b864.0":"2022-09-28T14:54:14.824Z","15.0.0-canary.28cc6791f.0":"2022-09-28T18:08:40.905Z","15.0.0-canary.a515a2d18.0":"2022-09-28T18:57:16.343Z","15.0.0-canary.ce9523167.0":"2022-09-29T20:32:44.852Z","15.0.0-canary.b2310f7dc.0":"2022-09-30T00:15:13.111Z","15.0.0-canary.a44241e54.0":"2022-09-30T08:22:30.183Z","15.0.0-canary.0ce81e115.0":"2022-09-30T18:19:47.162Z","15.0.0-canary.3cc30f6ad.0":"2022-10-04T17:21:02.886Z","15.0.0-canary.d9cf98e60.0":"2022-10-04T19:05:11.699Z","15.0.0-canary.d71935c8b.0":"2022-10-06T08:16:19.386Z","15.0.0-canary.49c56a25d.0":"2022-10-06T18:52:19.199Z","15.0.0-canary.07acddef3.0":"2022-10-07T21:38:48.742Z","15.0.0-canary.1c74eb2c0.0":"2022-10-07T21:57:00.431Z","15.0.0-canary.dadfb713e.0":"2022-10-08T05:06:59.023Z","15.0.0-canary.395f1ce61.0":"2022-10-08T05:08:58.209Z","15.0.0-canary.e741b5c82.0":"2022-10-10T17:39:23.382Z","15.0.0-canary.582f3cc1c.0":"2022-10-11T04:50:18.156Z","15.0.0-canary.b1a6e3e88.0":"2022-10-12T12:03:33.435Z","15.0.0-canary.c9b1a31e4.0":"2022-10-12T16:59:46.226Z","15.0.0-canary.13e9b0d1f.0":"2022-10-12T19:22:26.389Z","15.0.0-canary.1dc797e7f.0":"2022-10-14T09:42:56.884Z","15.0.0-canary.ed4009397.0":"2022-10-14T16:52:24.124Z","15.0.0-canary.95ef196bc.0":"2022-10-14T23:15:07.288Z","15.0.0-canary.13eea1b2d.0":"2022-10-17T03:52:43.664Z","15.0.0-canary.ef9b2babb.0":"2022-10-17T09:19:19.651Z","15.0.0-canary.cec7fb987.0":"2022-10-17T10:57:28.870Z","15.0.0-canary.4fff58b08.0":"2022-10-17T15:23:49.949Z","15.0.0-canary.587d8f871.0":"2022-10-17T15:58:13.649Z","15.0.0-canary.edf4b98d0.0":"2022-10-17T16:41:36.392Z","15.0.0-canary.024ac5f16.0":"2022-10-17T22:43:30.624Z","15.0.0-canary.c8bdf6144.0":"2022-10-18T18:24:33.830Z","15.0.0-canary.bacda4885.0":"2022-10-18T18:43:57.367Z","15.0.0-canary.92b2556cf.0":"2022-10-19T01:14:33.018Z","15.0.0-canary.cc804509a.0":"2022-10-19T01:18:17.224Z","15.0.0-canary.982bedae9.0":"2022-10-19T01:38:19.195Z","15.0.0-canary.ee40081f4.0":"2022-10-19T20:13:02.472Z","15.0.0-canary.98f1b54e2.0":"2022-10-20T22:57:53.274Z","15.0.0-canary.e74b7ba7e.0":"2022-10-21T17:06:56.554Z","15.0.0-canary.ab55c07d2.0":"2022-10-22T18:20:17.469Z","15.0.0-canary.fc539db34.0":"2022-10-24T19:00:18.534Z","15.0.0-canary.e340b04c5.0":"2022-10-25T23:46:12.012Z","15.0.0-canary.2c1a8f8fd.0":"2022-10-26T17:31:47.920Z","15.0.0-canary.ecfee946f.0":"2022-10-26T20:16:33.175Z","15.0.0-canary.73ca9dbb0.0":"2022-10-31T17:33:39.177Z","15.0.0-canary.357f2e5f1.0":"2022-10-31T18:50:41.719Z","15.0.0-canary.eb103d4b5.0":"2022-10-31T19:57:36.947Z","15.0.0-canary.af5f01223.0":"2022-11-01T18:38:01.462Z","15.0.0-canary.58733ef41.0":"2022-11-02T18:11:55.354Z","15.0.0-canary.909b48215.0":"2022-11-03T04:09:07.113Z","15.0.0-canary.7f17127d5.0":"2022-11-03T18:20:23.039Z","15.0.0-canary.da95e2a05.0":"2022-11-04T17:00:17.241Z","15.0.0-canary.4832e2750.0":"2022-11-04T20:58:15.932Z","15.0.0-canary.215506426.0":"2022-11-05T01:07:11.683Z","15.0.0-canary.4cf917476.0":"2022-11-05T18:05:15.361Z","15.0.0-canary.eef14bd32.0":"2022-11-06T17:25:43.521Z","15.0.0-canary.6faa29fe9.0":"2022-11-07T03:14:34.056Z","15.0.0-canary.9af09b967.0":"2022-11-07T18:29:04.435Z","15.0.0-canary.0f54fbb93.0":"2022-11-08T21:57:43.150Z","15.0.0-canary.a8d47f9fe.0":"2022-11-09T04:19:13.760Z","15.0.0-canary.66a1e75e6.0":"2022-11-09T09:36:43.254Z","15.0.0-canary.5e5c2afc0.0":"2022-11-09T11:54:26.453Z","15.0.0-canary.3e3f43359.0":"2022-11-09T20:04:04.152Z","15.0.0-canary.3f667fac6.0":"2022-11-09T22:07:20.809Z","15.0.0-canary.faa28c1c5.0":"2022-11-11T16:37:03.319Z","15.0.0-canary.a868c7866.0":"2022-11-11T16:37:52.754Z","15.0.0-canary.602fe8efa.0":"2022-11-11T17:13:01.191Z","15.0.0-canary.558c2be62.0":"2022-11-11T22:46:25.227Z","15.0.0-canary.b5c13a7a8.0":"2022-11-14T15:59:47.801Z","15.0.0-canary.a6e1c0702.0":"2022-11-14T17:28:15.087Z","15.0.0-canary.b6f8a06de.0":"2022-11-15T09:29:39.438Z","15.0.0-canary.0163f3ba5.0":"2022-11-15T18:03:22.561Z","15.0.0-canary.66c5cbb94.0":"2022-11-15T19:31:26.886Z","15.0.0-canary.b01136063.0":"2022-11-16T00:17:08.463Z","15.0.0-canary.01da0cabb.0":"2022-11-16T09:14:32.678Z","15.0.0-canary.4ac393164.0":"2022-11-16T16:16:51.750Z","15.0.0-canary.6048fb563.0":"2022-11-16T16:19:01.148Z","15.0.0-canary.f7f56fff7.0":"2022-11-16T19:57:18.260Z","15.0.0-canary.7c73f6134.0":"2022-11-16T20:01:52.751Z","15.0.0-canary.f1e037150.0":"2022-11-16T20:06:41.694Z","15.0.0-canary.40b18d043.0":"2022-11-16T23:00:03.996Z","15.0.0-canary.86bde5c06.0":"2022-11-16T23:10:13.280Z","15.0.0-canary.bb7751002.0":"2022-11-17T00:01:25.763Z","15.0.0-canary.63aca9af6.0":"2022-11-17T19:03:02.913Z","15.0.0-canary.56482dc2e.0":"2022-11-17T21:56:48.699Z","15.0.0-canary.953e689f3.0":"2022-11-17T22:05:56.139Z","15.0.0-canary.b5606a793.0":"2022-11-18T10:22:22.093Z","15.0.0-canary.8c5675942.0":"2022-11-18T15:17:35.705Z","15.0.0-canary.697fbdebd.0":"2022-11-18T17:02:21.862Z","15.0.0-canary.d58410453.0":"2022-11-18T19:26:23.896Z","15.0.0-canary.7971d6ad5.0":"2022-11-19T08:46:25.404Z","15.0.0-canary.a0ae73b0e.0":"2022-11-21T10:55:20.047Z","15.0.0-canary.96f472604.0":"2022-11-21T12:54:03.993Z","15.0.0-canary.18b8f31e1.0":"2022-11-21T16:03:47.368Z","15.0.0-canary.912f33ce4.0":"2022-11-21T17:55:22.243Z","15.0.0-canary.1e1b1c369.0":"2022-11-23T19:02:05.445Z","15.0.0-canary.a2ec49244.0":"2022-11-23T19:32:13.324Z","15.0.0-canary.a7458ba0b.0":"2022-11-23T20:17:50.042Z","15.0.0-canary.7c35e5036.0":"2022-11-24T08:40:43.952Z","15.0.0-canary.4356e05c5.0":"2022-11-24T09:58:10.050Z","15.0.0-canary.cb605f8af.0":"2022-11-24T10:17:13.419Z","15.0.0-canary.05fb07f9f.0":"2022-11-24T17:15:01.465Z","15.0.0-canary.a911b386b.0":"2022-11-28T16:48:40.081Z","15.0.0-canary.2aa8050b4.0":"2022-11-28T19:13:06.104Z","15.0.0-canary.323904a9f.0":"2022-11-29T15:35:47.664Z","15.0.0-canary.168a629a4.0":"2022-11-29T16:50:48.165Z","15.0.0-canary.65c411674.0":"2022-11-29T17:40:05.103Z","15.0.0-canary.a86d36fd2.0":"2022-11-30T02:15:34.956Z","15.0.0-canary.3a1f46c66.0":"2022-11-30T12:09:08.553Z","15.0.0-canary.32d8a9648.0":"2022-12-01T17:30:39.637Z","15.0.0-canary.03618ab70.0":"2022-12-01T20:55:44.178Z","15.0.0-canary.68aaed940.0":"2022-12-01T21:25:38.151Z","15.0.0-canary.f0a0bbc75.0":"2022-12-02T09:03:33.832Z","15.0.0-canary.dd99c8764.0":"2022-12-02T14:02:23.033Z","15.0.0-canary.fabdcca3a.0":"2022-12-02T15:08:16.739Z","15.0.0-canary.2d26722d2.0":"2022-12-02T16:28:01.201Z","15.0.0-canary.eaa0c3a86.0":"2022-12-02T17:44:05.486Z","15.0.0-canary.79a613bbd.0":"2022-12-06T14:27:28.920Z","15.0.0-canary.c871fe61e.0":"2022-12-07T07:53:13.172Z","15.0.0-canary.9eaee7936.0":"2022-12-07T20:04:29.402Z","15.0.0-canary.1d37bf601.0":"2022-12-07T20:42:42.171Z","15.0.0-canary.a5fe069d5.0":"2022-12-09T18:45:51.832Z","15.0.0-canary.ce8b5326f.0":"2022-12-09T23:32:11.015Z","15.0.0-canary.43f5323bc.0":"2022-12-12T16:48:17.820Z","15.0.0-canary.5490e32e7.0":"2022-12-12T17:03:40.249Z","15.0.0-canary.817002c29.0":"2022-12-13T21:55:32.486Z","15.0.0-canary.313a1326a.0":"2022-12-14T10:30:21.048Z","15.0.0-canary.a69c14e10.0":"2022-12-14T11:20:56.910Z","15.0.0-canary.f43e0ceb5.0":"2022-12-14T16:46:15.489Z","15.0.0-canary.34767110.0":"2022-12-14T17:22:55.440Z","15.0.0-canary.1f99f3c50.0":"2022-12-15T14:27:03.231Z","15.0.0-canary.cfd69490f.0":"2022-12-16T20:10:02.767Z","15.0.0-canary.94ad8d986.0":"2022-12-19T19:28:38.494Z","15.0.0-canary.604264203.0":"2022-12-21T21:42:09.670Z","15.0.0-canary.85bcff6af.0":"2022-12-22T10:27:08.851Z","15.0.0-canary.ece3e8d21.0":"2022-12-22T17:13:38.201Z","15.0.0-canary.278ad53d1.0":"2022-12-27T17:06:37.039Z","15.0.0-canary.a7d8389e1.0":"2022-12-27T19:05:22.504Z","15.0.0-canary.8175d5eff.0":"2022-12-28T01:53:03.173Z","15.0.0-canary.e21dcb86d.0":"2022-12-29T14:03:44.270Z","15.0.0-canary.20ab6f5a8.0":"2022-12-29T19:42:23.975Z","15.0.0-canary.b9806f623.0":"2022-12-29T23:07:21.751Z","15.0.0-canary.50c9f550e.0":"2023-01-03T15:49:05.220Z","15.0.0-canary.af490a848.0":"2023-01-03T15:59:20.646Z","15.0.0-canary.7cf487c98.0":"2023-01-03T17:40:14.441Z","15.0.0-canary.a52be2d5e.0":"2023-01-03T19:14:35.598Z","15.0.0-canary.e38ba17c5.0":"2023-01-03T22:34:13.823Z","15.0.0-canary.49041a6c3.0":"2023-01-04T15:19:13.388Z","15.0.0-canary.c492898c2.0":"2023-01-04T17:39:13.761Z","15.0.0-canary.d7a2277de.0":"2023-01-04T21:37:08.188Z","15.0.0-canary.fd95ca7ef.0":"2023-01-05T01:04:15.163Z","15.0.0-canary.1eb44faf9.0":"2023-01-05T09:10:45.297Z","15.0.0-canary.adcdb7db9.0":"2023-01-05T16:23:42.856Z","15.0.0-canary.067af7eff.0":"2023-01-06T23:17:26.596Z","15.0.0-canary.21d1196a7.0":"2023-01-09T10:45:03.334Z","15.0.0-canary.8d2d8d3c4.0":"2023-01-09T22:25:31.678Z","15.0.0-canary.fc6ee6c32.0":"2023-01-10T16:29:36.100Z","15.0.0-canary.73537ab0f.0":"2023-01-10T18:13:04.292Z","15.0.0-canary.684e33d25.0":"2023-01-10T19:19:59.067Z","15.0.0-canary.0e89aab6b.0":"2023-01-11T16:19:57.541Z","15.0.0-canary.b0103d10a.0":"2023-01-11T19:14:30.649Z","15.0.0-canary.50e7a5312.0":"2023-01-11T20:55:39.676Z","15.0.0-canary.202823f54.0":"2023-01-11T21:37:09.402Z","15.0.0-canary.199fe2a2a.0":"2023-01-11T21:57:11.239Z","15.0.0-canary.8c0786d6f.0":"2023-01-12T14:37:55.637Z","15.0.0-canary.8a74f7c6d.0":"2023-01-17T19:26:06.412Z","15.0.0-canary.b4687fdc1.0":"2023-01-19T19:51:08.344Z","15.0.0-canary.b836b9892.0":"2023-01-24T22:40:38.540Z","15.0.0-canary.e8912fd37.0":"2023-01-26T18:31:14.492Z","15.0.0-canary.16fbd30ff.0":"2023-01-26T18:36:40.870Z","15.0.0-canary.033ae083a.0":"2023-01-26T19:28:25.004Z","15.0.0-canary.3a705fa1d.0":"2023-01-27T22:44:54.892Z","15.0.0-canary.d6bea2ff2.0":"2023-01-31T15:31:30.045Z","15.0.0-canary.0c94182c8.0":"2023-02-01T17:45:41.341Z","15.0.0-canary.15b221540.0":"2023-02-01T17:54:05.139Z","15.0.0-canary.6a4b3f834.0":"2023-02-01T18:59:54.097Z","15.0.0-canary.b177b40e2.0":"2023-02-02T03:35:42.029Z","15.0.0-canary.d9f821042.0":"2023-02-02T17:39:49.057Z","15.0.0-canary.47c7deb19.0":"2023-02-03T09:10:20.141Z","15.0.0-canary.a16dbd1a6.0":"2023-02-04T06:15:55.083Z","15.0.0-canary.93416f87a.0":"2023-02-07T13:26:01.989Z","15.0.0-canary.49b8e7442.0":"2023-02-07T23:11:00.173Z","15.0.0-canary.de38de758.0":"2023-02-09T15:43:52.438Z","15.0.0-canary.4d62de70c.0":"2023-02-09T22:04:28.635Z","15.0.0-canary.6fcd8d418.0":"2023-02-13T11:51:11.012Z","15.0.0-canary.066d9439b.0":"2023-02-15T19:59:29.903Z","15.0.0-canary.7ab32468c.0":"2023-02-21T18:35:38.416Z","15.0.0-canary.fa27ba61d.0":"2023-02-27T16:21:40.486Z","15.0.0-canary.311ab4d4a.0":"2023-02-27T16:42:51.929Z","15.0.0-canary.5cb8e2174.0":"2023-03-01T16:37:12.413Z","15.0.0-canary.f32339937.0":"2023-03-06T15:17:04.965Z","15.0.0-canary.7644d63d5.0":"2023-03-06T22:28:51.187Z","15.0.0-canary.d96330c08.0":"2023-03-08T11:43:12.829Z","15.0.0-canary.c99cae77c.0":"2023-03-08T23:44:15.864Z","15.0.0-canary.6023b1cd3.0":"2023-03-09T14:27:42.194Z","15.0.0-canary.274610c77.0":"2023-03-09T15:00:11.393Z","15.0.0-canary.a274583b9.0":"2023-03-09T19:54:00.515Z","15.0.0-canary.da22ca960.0":"2023-03-09T20:19:43.447Z","15.0.0-canary.304a94e8b.0":"2023-03-09T20:46:20.042Z","15.0.0-canary.6c265915c.0":"2023-03-09T21:48:38.128Z","15.0.0-canary.de5224633.0":"2023-03-09T23:57:04.733Z","15.0.0-canary.8879557e6.0":"2023-03-10T14:09:14.776Z","15.0.0-canary.23073a303.0":"2023-03-10T14:16:22.538Z","15.0.0-canary.51c7d4014.0":"2023-03-10T16:48:45.853Z","15.0.0-canary.1175a5be0.0":"2023-03-10T20:49:21.114Z","15.0.0-canary.7adf3af80.0":"2023-03-11T01:26:17.551Z","15.0.0-canary.82554d770.0":"2023-03-11T01:38:32.430Z","15.0.0-canary.93fc524b7.0":"2023-03-13T08:40:20.105Z","15.0.0-canary.50be0fbae.0":"2023-03-13T17:45:34.050Z","15.0.0-canary.6b5ffccd9.0":"2023-03-13T17:48:58.947Z","15.0.0-canary.1c8013f4e.0":"2023-03-13T18:04:17.812Z","15.0.0-canary.112715df5.0":"2023-03-13T18:40:38.781Z","15.0.0-canary.d250911f2.0":"2023-03-13T19:32:58.722Z","15.0.0-canary.7cd925c12.0":"2023-03-13T19:40:28.266Z","15.0.0-canary.b2ddacf73.0":"2023-03-13T19:44:47.413Z","15.0.0-canary.989ae2ecc.0":"2023-03-13T19:54:02.358Z","15.0.0-canary.89c66483a.0":"2023-03-13T20:17:45.787Z","15.0.0-canary.6a85742c2.0":"2023-03-14T02:48:41.855Z","15.0.0-canary.bb6cd78d5.0":"2023-03-14T18:18:15.789Z","15.0.0-canary.5f94aa37d.0":"2023-03-14T18:21:30.339Z","15.0.0-canary.1bd317240.0":"2023-03-14T18:25:23.740Z","15.0.0-canary.d441d2a2a.0":"2023-03-14T18:28:09.352Z","15.0.0-canary.fff4066c6.0":"2023-03-14T18:28:46.959Z","15.0.0-canary.87809c710.0":"2023-03-14T18:44:47.310Z","15.0.0-canary.48d30012d.0":"2023-03-14T18:49:06.522Z","15.0.0-canary.419b23cc6.0":"2023-03-14T19:00:08.990Z","15.0.0-canary.bf86521f4.0":"2023-03-14T23:14:47.923Z","15.0.0-canary.11f3d280e.0":"2023-03-15T00:12:38.080Z","15.0.0-canary.b281a409a.0":"2023-03-21T15:42:54.555Z","15.0.0-canary.39e473690.0":"2023-03-21T17:52:51.422Z","15.0.0-canary.cedffb44c.0":"2023-03-21T17:59:49.860Z","15.0.0-canary.36a4cba99.0":"2023-03-28T17:51:29.781Z","15.0.0-canary.ed7e82ded.0":"2023-03-28T20:36:09.330Z","15.0.0-canary.55093ee1e.0":"2023-03-29T18:50:20.090Z","15.0.0-canary.0c53abc81.0":"2023-04-07T01:42:22.043Z","15.0.0-canary.51311e69e.0":"2023-04-07T18:09:08.271Z","15.0.0-canary.113b1a38e.0":"2023-04-10T21:55:04.558Z","15.0.0-canary.ea2191426.0":"2023-04-11T21:57:21.428Z","15.0.0-canary.5a5c38538.0":"2023-04-11T22:31:35.583Z","15.0.0-canary.e4b5ea7eb.0":"2023-04-11T23:05:55.756Z","15.0.0-canary.a094dd9c1.0":"2023-04-14T22:43:46.275Z","15.0.0-canary.f771b091c.0":"2023-04-17T15:39:51.183Z","15.0.0-canary.79b1b612b.0":"2023-04-19T23:41:48.951Z","15.0.0-canary.6f50071e5.0":"2023-04-20T18:02:43.179Z","15.0.0-canary.ef754381c.0":"2023-04-24T20:52:14.216Z","15.0.0-canary.69ebf61ea.0":"2023-04-27T17:22:56.048Z","15.0.0-canary.b90be86de.0":"2023-04-29T00:22:57.054Z","15.0.0-canary.51f9c0c28.0":"2023-04-29T00:32:41.292Z","15.0.0-canary.4e840d685.0":"2023-05-02T15:35:03.279Z","15.0.0-canary.10b8563e4.0":"2023-05-02T23:43:05.974Z","15.0.0-canary.736b7fda4.0":"2023-05-03T15:10:55.935Z","15.0.0-canary.0e533c5a1.0":"2023-05-05T16:57:56.871Z","15.0.0-canary.5f01c15a2.0":"2023-05-05T17:27:37.273Z","15.0.0-canary.3b5b55e31.0":"2023-05-05T18:40:36.355Z","15.0.0-canary.d0788120f.0":"2023-05-09T08:24:32.959Z","15.0.0-canary.f52358dd0.0":"2023-05-12T14:31:46.643Z","15.0.0-canary.576d3d2c8.0":"2023-05-16T02:01:18.739Z","15.0.0-canary.19bb36a46.0":"2023-05-16T19:55:19.628Z","15.0.0-canary.aa5ac7fe5.0":"2023-05-22T17:27:12.182Z","15.0.0-canary.90291f2e2.0":"2023-05-23T17:44:14.673Z","15.0.0-canary.446734f27.0":"2023-05-30T21:49:29.817Z","15.0.0-canary.19de312d8.0":"2023-06-06T17:19:46.905Z","15.0.0-canary.6081d829b.0":"2023-06-07T01:15:21.344Z","15.0.0-canary.b26c34a68.0":"2023-06-07T20:19:48.705Z","15.0.0-canary.4fe911371.0":"2023-06-07T23:07:24.184Z","15.0.0-canary.a9ff9866f.0":"2023-06-13T11:39:32.996Z","15.0.0-canary.b994146f6.0":"2023-06-14T21:05:08.895Z","15.0.0-canary.1fb4b1a06.0":"2023-06-27T18:58:39.419Z","15.0.0-canary.c64a2776e.0":"2023-06-27T20:18:04.804Z","15.0.0-canary.b05d9eb7c.0":"2023-06-29T16:25:08.511Z","15.0.0-canary.2a9697dc5.0":"2023-06-30T22:15:12.681Z","15.0.0-canary.0c52adeab.0":"2023-07-05T16:27:15.224Z","15.0.0-canary.83355c322.0":"2023-07-10T15:07:04.153Z","15.0.0-canary.bc9ae6c9c.0":"2023-08-03T21:22:54.070Z","15.0.0-canary.3c44cd956.0":"2023-08-07T17:49:42.538Z","15.0.0-canary.02702296e.0":"2023-08-25T12:06:30.596Z","15.0.0-canary.872b65832.0":"2023-08-30T12:15:03.342Z","15.0.0-canary.89b2e4122.0":"2023-08-31T16:08:17.177Z","15.0.0-canary.7a3942e7a.0":"2023-08-31T18:41:07.578Z","15.0.0-canary.54feb3020.0":"2023-09-11T21:06:45.620Z","15.0.0-canary.6cda3ce8d.0":"2023-09-12T01:46:40.820Z","15.0.0-canary.205b20b36.0":"2023-09-13T17:20:16.250Z","15.0.0-canary.22bf82024.0":"2023-09-18T09:13:17.171Z","15.0.0-canary.a246a4439.0":"2023-09-18T17:47:34.914Z","15.0.0-canary.d153db62b.0":"2023-09-19T19:16:30.699Z","15.0.0-canary.2528c1c3b.0":"2023-09-20T18:08:09.378Z","15.0.0-canary.1728a6dcf.0":"2023-09-26T01:24:31.399Z","15.0.0-canary.ebb636f3d.0":"2023-09-29T19:45:39.319Z","15.0.0-canary.c0d21ecc9.0":"2023-10-09T19:38:04.585Z","15.0.0-canary.127a44b28.0":"2023-10-12T20:01:55.652Z","15.0.0-canary.0ad128337.0":"2023-10-19T18:53:33.073Z","15.0.0-canary.9cec94097.0":"2023-10-19T23:10:43.263Z","15.0.0-canary.c51a0bbcc.0":"2023-11-15T20:59:12.954Z","15.0.0-canary.d76666ad4.0":"2023-11-27T22:13:38.231Z","15.0.0-canary.8656bf0e0.0":"2023-12-12T21:19:14.674Z","15.0.0-canary.7f224ddd4.0":"2023-12-28T06:09:39.054Z","15.0.0-canary.a0b8a90c0.0":"2024-02-07T19:20:05.239Z","15.0.0-canary.e50b478eb.0":"2024-02-08T18:08:35.604Z","15.0.0-canary.c43b3438b.0":"2024-02-23T20:18:08.673Z","15.0.0-canary.819498d8c.0":"2024-03-15T15:15:47.056Z","15.0.0-canary.453a6248a.0":"2024-03-25T17:14:06.921Z","15.0.0-canary.68edc03c6.0":"2024-04-08T19:06:53.742Z","15.0.0-canary.5bebc0064.0":"2024-04-11T21:41:58.737Z","15.0.0-canary.311f29a60.0":"2024-04-23T18:00:50.012Z","15.0.0-canary.65c10a622.0":"2024-04-25T18:49:30.808Z","15.0.0-canary.4b35cb7d0.0":"2024-05-02T12:03:35.405Z","15.0.0-canary.f80ac92b0.0":"2024-05-02T12:13:43.960Z","15.0.0-canary.2f5b899bc.0":"2024-05-20T13:57:27.836Z","15.0.0-canary.cfec83c74.0":"2024-05-20T18:57:24.093Z","15.0.0-canary.423edc3dc.0":"2024-06-26T18:12:22.145Z"},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-tooltip"},"keywords":["material components","material design","tooltip"],"license":"MIT","homepage":"https://github.com/material-components/material-components-web#readme","bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"readme":"","readmeFilename":""}